From a62542e08b63dc9b6a1694436adc4a97941d2a51 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Mon, 1 Sep 2008 08:21:39 +0000 Subject: [PATCH] "MDL-13766, upload plugin" --- repository/local/repository.class.php | 3 -- repository/upload/icon.png | Bin 0 -> 1971 bytes repository/upload/repository.class.php | 60 +++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100755 repository/upload/icon.png create mode 100755 repository/upload/repository.class.php 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 0000000000000000000000000000000000000000..db5c52b769e74c5ff883ed02dd4f96e604f2982d GIT binary patch literal 1971 zcmV;k2Tb^hP)PyKrkN=j13{7l$sh8kRr(E5NL&1 z>!1#!rDOlGGqnS){h%GE){$|>KiZj6XZnZJPIa)3EiIJ}(L#$lXqBKHAfN#Qq>Cn- z&Ayl2_ujp?e}sKa0!SU{^vs-j_v_vB+jGu6cOU$pMOFv+#AIiFq4h=gm^qo0he(dDAnKv}nMC^z~ z(Np9LKIv4PWTLG6z5b!=v%P7w7n6c*34cds7n=9Ua))@1PNF=hvvaAV^ z!+xC6Yi?xu;&uiG^8{)v7s{fNXJ34oFH|1G7!$5nN-5v>pLbpN-aUKv6ek1N<2zbg zr=<@5p|$?mrcIlcc6N3mr3^PT#*lZ5+_vRuqy#U}Xl)o7^{GjxkanD%J9lD?8L!qe z&pdNycX#(2z!M(}Q1tcb`Ar{;h(R%b#flaD;gue~`Q%F%xy`mELI^xxp|wF9Lo8z9 z6g*~cd}_klFMY9@hq_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?b5c^)k-Effj`nwy((9EYZ+ zCUUtPsZ^?T)QKKi3?iBCBB+Ir34qW0OT(K@o!k3U4Q?i+IRo}002ovPDHLk FV1jL*$BzI2 literal 0 HcmV?d00001 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) { + } +} +?> -- 2.39.5