]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16596 support for restricting of subdirectory browsing/upload - getter and setter...
authorskodak <skodak>
Sun, 21 Sep 2008 20:48:05 +0000 (20:48 +0000)
committerskodak <skodak>
Sun, 21 Sep 2008 20:48:05 +0000 (20:48 +0000)
lib/form/areafiles.php

index 58bbc7ed3c9e17755b7484696ec3406cad3f45b0..55c4da26fbbbc074cd24f0001cabc96bba84dd59 100644 (file)
@@ -4,12 +4,15 @@ require_once('HTML/QuickForm/element.php');
 
 class MoodleQuickForm_areafiles extends HTML_QuickForm_element {
     protected $_helpbutton = '';
-    protected $_options    = array('subdirs'=>0);
+    protected $_options    = array('subdirs'=>0, 'maxbytes'=>0);
 
     function MoodleQuickForm_areafiles($elementName=null, $elementLabel=null, $options=null) {
         if (!empty($options['subdirs'])) {
             $this->_options['subdirs'] = 1;
         }
+        if (!empty($options['maxbytes'])) {
+            $this->_options['maxbytes'] = $options['maxbytes'];
+        }
         parent::HTML_QuickForm_element($elementName, $elementLabel);
     }
 
@@ -29,6 +32,22 @@ class MoodleQuickForm_areafiles extends HTML_QuickForm_element {
         return $this->getAttribute('value');
     }
 
+    function getMaxbytes() {
+        return $this->_options['maxbytes'];
+    }
+
+    function setMaxbytes($maxbytes) {
+        $this->_options['maxbytes'] = $maxbytes;
+    }
+
+    function getSubdirs() {
+        return $this->_options['subdirs'];
+    }
+
+    function setSubdirs($allow) {
+        $this->_options['subdirs'] = $allow;
+    }
+
     function setHelpButton($_helpbuttonargs, $function='_helpbutton') {
         if (!is_array($_helpbuttonargs)) {
             $_helpbuttonargs = array($_helpbuttonargs);