]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16597 default to unlimited number of files instead of 0 which means no files
authorskodak <skodak>
Mon, 16 Feb 2009 20:53:23 +0000 (20:53 +0000)
committerskodak <skodak>
Mon, 16 Feb 2009 20:53:23 +0000 (20:53 +0000)
lib/form/filemanager.php

index bc1ff41d92077853719c940cc08a7281e63ac853..3b2d8ad2ab788f0df2ce3c22837d5d58e4ed1206 100644 (file)
@@ -5,7 +5,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . '/lib/filelib.php');
 
 class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
     protected $_helpbutton = '';
-    protected $_options    = array('subdirs'=>0, 'maxbytes'=>0, 'maxfiles'=>0);
+    protected $_options    = array('subdirs'=>0, 'maxbytes'=>0, 'maxfiles'=>-1);
 
     function MoodleQuickForm_filemanager($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
         global $CFG;
@@ -138,6 +138,8 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
 
     function toHtml() {
         global $CFG, $USER, $COURSE;
+        require_once("$CFG->dirroot/repository/lib.php");
+
         $strdelete  = get_string('confirmdeletefile', 'repository');
         $straddfile = get_string('add', 'repository');