From: dongsheng Date: Mon, 1 Sep 2008 08:21:39 +0000 (+0000) Subject: "MDL-13766, upload plugin" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a62542e08b63dc9b6a1694436adc4a97941d2a51;p=moodle.git "MDL-13766, upload plugin" --- diff --git a/repository/local/repository.class.php b/repository/local/repository.class.php index bc16ec0fb8..8164ca9b44 100755 --- a/repository/local/repository.class.php +++ b/repository/local/repository.class.php @@ -46,9 +46,6 @@ class repository_local extends repository { // no login required $ret['nologin'] = true; - // define upload form in file picker - // Use ajax upload file - $ret['upload'] = array('name'=>get_string('attachment', 'repository'), 'id'=>'repo-form'); // todo: link to file manager $ret['manage'] = $CFG->wwwroot .'/files/index.php'; // temporary diff --git a/repository/upload/icon.png b/repository/upload/icon.png new file mode 100755 index 0000000000..db5c52b769 Binary files /dev/null and b/repository/upload/icon.png differ diff --git a/repository/upload/repository.class.php b/repository/upload/repository.class.php new file mode 100755 index 0000000000..c09f3b2c9a --- /dev/null +++ b/repository/upload/repository.class.php @@ -0,0 +1,60 @@ +info = repository_store_to_filepool('repo_upload_file'); + } + } + + public function print_login($ajax = true) { + global $SESSION; + return $this->get_listing(); + } + + public function get_listing($path='', $search='') { + global $CFG, $action; + if($action=='upload'){ + return $this->info; + }else{ + $ret = array(); + $ret['nologin'] = true; + // define upload form in file picker + $ret['upload'] = array('label'=>get_string('attachment', 'repository'), 'id'=>'repo-form'); + $ret['manage'] = $CFG->wwwroot .'/files/index.php'; // temporary + $ret['list'] = array(); + $ret['dynload'] = false; + return $ret; + } + } + + public function print_listing() { + } + + public function print_search() { + return true; + } + + public static function has_admin_config() { + return true; + } + + public static function get_option_names() { + return array(); + } + + // empty function is necessary to make it possible to edit the name of the repository + public function admin_config_form(&$mform) { + } +} +?>