require_once($CFG->libdir.'/boxlib.php');
+/**
+ *
+ */
class repository_boxnet extends repository {
private $box;
+ /**
+ *
+ * @global <type> $SESSION
+ * @param <type> $repositoryid
+ * @param <type> $context
+ * @param <type> $options
+ */
public function __construct($repositoryid, $context = SITEID, $options = array()) {
global $SESSION;
$options['username'] = optional_param('boxusername', '', PARAM_RAW);
}
}
+ /**
+ *
+ * @global <type> $SESSION
+ * @return <type>
+ */
public function check_login() {
global $SESSION;
return !empty($SESSION->{$this->sess_name});
}
+ /**
+ *
+ * @global <type> $SESSION
+ * @return <type>
+ */
public function logout() {
global $SESSION;
unset($SESSION->{$this->sess_name});
return $this->print_login();
}
+ /**
+ *
+ * @param <type> $options
+ * @return <type>
+ */
public function set_option($options = array()) {
if (!empty($options['api_key'])) {
set_config('api_key', trim($options['api_key']), 'boxnet');
return $ret;
}
+ /**
+ *
+ * @param <type> $config
+ * @return <type>
+ */
public function get_option($config = '') {
if($config==='api_key') {
return trim(get_config('boxnet', 'api_key'));
return $options;
}
+ /**
+ *
+ * @global <type> $SESSION
+ * @return <type>
+ */
public function global_search() {
global $SESSION;
if (empty($SESSION->{$this->sess_name})) {
}
}
+ /**
+ *
+ * @global <type> $DB
+ * @return <type>
+ */
public function get_login() {
global $DB;
if ($entry = $DB->get_record('repository_instances', array('id'=>$this->id))) {
}
return $ret;
}
+
+ /**
+ *
+ * @global <type> $CFG
+ * @param <type> $search_text
+ * @return <type>
+ */
public function search($search_text) {
global $CFG;
$list = array();
$ret['list'] = $list;
return $ret;
}
+
+ /**
+ *
+ * @global <type> $CFG
+ * @param <type> $path
+ * @return <type>
+ */
public function get_listing($path = '/'){
global $CFG;
$list = array();
return $ret;
}
+ /**
+ *
+ * @return <type>
+ */
public function print_login(){
$t = $this->box->getTicket();
$ret = $this->get_login();
}
}
+ /**
+ *
+ * @return <type>
+ */
public static function get_type_option_names() {
return array('api_key');
}
+ /**
+ *
+ * @param <type> $
+ */
public function type_config_form(&$mform) {
$public_account = get_config('boxnet', 'public_account');
$api_key = get_config('boxnet', 'api_key');
$mform->addElement('static', null, '', get_string('information','repository_boxnet'));
}
}
-
-?>
+?>
\ No newline at end of file
require_once($CFG->libdir.'/flickrlib.php');
+/**
+ *
+ */
class repository_flickr extends repository {
private $flickr;
public $photos;
+ /**
+ *
+ * @global <type> $SESSION
+ * @global <type> $CFG
+ * @param <type> $repositoryid
+ * @param <type> $context
+ * @param <type> $options
+ */
public function __construct($repositoryid, $context = SITEID, $options = array()) {
global $SESSION, $CFG;
$options['page'] = optional_param('p', 1, PARAM_INT);
}
}
+
+ /**
+ *
+ * @return <type>
+ */
public function check_login() {
return !empty($this->token);
}
+
+ /**
+ *
+ * @return <type>
+ */
public function logout() {
set_user_preference($this->setting, '');
set_user_preference($this->setting.'_nsid', '');
$this->nsid = '';
return $this->print_login();
}
+
+ /**
+ *
+ * @param <type> $options
+ * @return <type>
+ */
public function set_option($options = array()) {
if (!empty($options['api_key'])) {
set_config('api_key', trim($options['api_key']), 'flickr');
return $ret;
}
+ /**
+ *
+ * @param <type> $config
+ * @return <type>
+ */
public function get_option($config = '') {
if ($config==='api_key') {
return trim(get_config('flickr', 'api_key'));
return $options;
}
+ /**
+ *
+ * @return <type>
+ */
public function global_search() {
if (empty($this->token)) {
return false;
return true;
}
}
+
+ /**
+ *
+ * @param <type> $ajax
+ * @return <type>
+ */
public function print_login($ajax = true) {
if ($ajax) {
$ret = array();
return $ret;
}
}
+
+ /**
+ *
+ * @param <type> $photos
+ * @param <type> $path
+ * @return <type>
+ */
private function build_list($photos, $path = 1) {
$photos_url = $this->flickr->urls_getUserPhotos($this->nsid);
$ret = array();
}
return $ret;
}
+
+ /**
+ *
+ * @param <type> $search_text
+ * @return <type>
+ */
public function search($search_text) {
$photos = $this->flickr->photos_search(array(
'user_id'=>$this->nsid,
));
return $this->build_list($photos);
}
+
+ /**
+ *
+ * @param <type> $path
+ * @return <type>
+ */
public function get_listing($path = '1') {
$photos_url = $this->flickr->urls_getUserPhotos($this->nsid);
));
return $this->build_list($photos, $path);
}
+
+ /**
+ *
+ * @return <type>
+ */
public function print_listing() {
return false;
}
+
+ /**
+ *
+ * @global <type> $CFG
+ * @param <type> $photo_id
+ * @param <type> $file
+ * @return <type>
+ */
public function get_file($photo_id, $file = '') {
global $CFG;
$result = $this->flickr->photos_getSizes($photo_id);
return $dir.$file;
}
+ /**
+ *
+ * @global <type> $CFG
+ * @param <type> $
+ */
public function type_config_form(&$mform) {
global $CFG;
$api_key = get_config('flickr', 'api_key');
$mform->addRule('secret', $strrequired, 'required', null, 'client');
}
+ /**
+ *
+ * @return <type>
+ */
public static function get_type_option_names() {
return array('api_key', 'secret');
}
-
-}
+}
\ No newline at end of file
require_once($CFG->libdir.'/flickrlib.php');
+/**
+ *
+ */
class repository_flickr_public extends repository {
private $flickr;
public $photos;
+ /**
+ *
+ * @param <type> $options
+ * @return <type>
+ */
public function set_option($options = array()) {
if (!empty($options['api_key'])) {
set_config('api_key', trim($options['api_key']), 'flickr_public');
return $ret;
}
+ /**
+ *
+ * @param <type> $config
+ * @return <type>
+ */
public function get_option($config = '') {
if ($config==='api_key') {
return trim(get_config('flickr_public', 'api_key'));
return $options;
}
+ /**
+ *
+ * @return <type>
+ */
public function global_search() {
if (empty($this->flickr_account)) {
return false;
}
}
+ /**
+ *
+ * @global <type> $CFG
+ * @param <type> $repositoryid
+ * @param <type> $context
+ * @param <type> $options
+ * @param <type> $readonly
+ */
public function __construct($repositoryid, $context = SITEID, $options = array(), $readonly=0) {
global $CFG;
$options['page'] = optional_param('p', 1, PARAM_INT);
}
}
}
+
+ /**
+ *
+ * @return <type>
+ */
public function check_login() {
return !empty($this->flickr_account);
}
+
+ /**
+ *
+ * @param <type> $ajax
+ * @return <type>
+ */
public function print_login($ajax = true) {
if ($ajax) {
$ret = array();
return $ret;
}
}
+
+ /**
+ *
+ * @param <type> $search_text
+ * @return <type>
+ */
public function search($search_text) {
$people = $this->flickr->people_findByEmail($this->flickr_account);
$this->nsid = $people['nsid'];
}
return $this->build_list($photos);
}
+
+ /**
+ *
+ * @param <type> $path
+ * @return <type>
+ */
public function get_listing($path = '1') {
$people = $this->flickr->people_findByEmail($this->flickr_account);
$this->nsid = $people['nsid'];
return $this->build_list($photos, $path);
}
+
+ /**
+ *
+ * @param <type> $photos
+ * @param <type> $path
+ * @return <type>
+ */
private function build_list($photos, $path = 1) {
$photos_url = $this->flickr->urls_getUserPhotos($this->nsid);
$ret = array();
return $ret;
}
+ /**
+ *
+ * @return <type>
+ */
public function print_listing() {
return false;
}
+ /**
+ *
+ * @return <type>
+ */
public function print_search() {
parent::print_search();
echo '<label>Tag: </label><br /><input type="text" name="tag" /><br />';
return true;
}
+ /**
+ *
+ * @global <type> $CFG
+ * @param <type> $photo_id
+ * @param <type> $file
+ * @return <type>
+ */
public function get_file($photo_id, $file = '') {
global $CFG;
$result = $this->flickr->photos_getSizes($photo_id);
return $dir.$file;
}
+ /**
+ *
+ * @param <type> $
+ */
public function instance_config_form(&$mform) {
$mform->addElement('text', 'email_address', get_string('emailaddress', 'repository_flickr_public'));
$mform->addRule('email_address', get_string('required'), 'required', null, 'client');
}
+ /**
+ *
+ * @return <type>
+ */
public static function get_instance_option_names() {
return array('email_address');
}
+ /**
+ *
+ * @param <type> $
+ */
public function type_config_form(&$mform) {
$api_key = get_config('flickr_public', 'api_key');
if (empty($api_key)) {
$mform->addElement('static', null, '', get_string('information','repository_flickr_public'));
}
+ /**
+ *
+ * @return <type>
+ */
public static function get_type_option_names() {
return array('api_key');
}
-
+ /**
+ *
+ */
public static function plugin_init() {
//here we create a default instance for this type
repository_static_function('flickr_public','create', 'flickr_public', 0, get_system_context(), array('name' => 'default instance','email_address' => null),1);
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
+/**
+ *
+ */
class repository_local extends repository {
+ /**
+ *
+ * @global <type> $SESSION
+ * @global <type> $action
+ * @global <type> $CFG
+ * @param <type> $repositoryid
+ * @param <type> $context
+ * @param <type> $options
+ */
public function __construct($repositoryid, $context = SITEID, $options = array()) {
global $SESSION, $action, $CFG;
parent::__construct($repositoryid, $context, $options);
// You can use $_FILES to find that file
}
+ /**
+ *
+ * @global <type> $SESSION
+ * @param <type> $ajax
+ * @return <type>
+ */
public function print_login($ajax = true) {
global $SESSION;
// TODO
return $this->get_listing();
}
+ /**
+ *
+ * @param <type> $filearea
+ * @param <type> $path
+ * @param <type> $visiblename
+ * @return <type>
+ */
private function _encode_path($filearea, $path, $visiblename) {
return array('path'=>serialize(array($filearea, $path)), 'name'=>$visiblename);
}
+ /**
+ *
+ * @param <type> $path
+ * @return <type>
+ */
private function _decode_path($path) {
$filearea = '';
$path = '';
return array('filearea' => $filearea, 'path' => $path);
}
+ /**
+ *
+ * @param <type> $search_text
+ * @return <type>
+ */
public function search($search_text) {
return $this->get_listing('', $search_text);
}
+ /**
+ *
+ * @global <type> $CFG
+ * @param <type> $encodedpath
+ * @param <type> $search
+ * @return <type>
+ */
public function get_listing($encodedpath = '', $search = '') {
global $CFG;
$ret = array();
return $filecount;
}
+ /**
+ *
+ */
public function print_listing() {
// will be used in non-javascript file picker
}
-
+
+ /**
+ *
+ * @return <type>
+ */
public function get_name(){
return get_string('repositoryname', 'repository_local');;
}
}
-?>
+?>
\ No newline at end of file
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
+/**
+ *
+ */
class repository_upload extends repository {
+ /**
+ *
+ * @global <type> $SESSION
+ * @global <type> $action
+ * @global <type> $CFG
+ * @param <type> $repositoryid
+ * @param <type> $context
+ * @param <type> $options
+ */
public function __construct($repositoryid, $context = SITEID, $options = array()){
global $SESSION, $action, $CFG;
parent::__construct($repositoryid, $context, $options);
}
}
+ /**
+ *
+ * @global <type> $SESSION
+ * @param <type> $ajax
+ * @return <type>
+ */
public function print_login($ajax = true) {
global $SESSION;
return $this->get_listing();
}
+ /**
+ *
+ * @global <type> $CFG
+ * @global <type> $action
+ * @param <type> $path
+ * @param <type> $search
+ * @return <type>
+ */
public function get_listing($path='', $search='') {
global $CFG, $action;
if($action=='upload'){
}
}
+ /**
+ *
+ */
public function print_listing() {
}
+ /**
+ *
+ * @return <type>
+ */
public function print_search() {
return true;
}
+ /**
+ *
+ * @return <type>
+ */
public function get_name(){
return get_string('repositoryname', 'repository_upload');;
}