]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16596 minor constructor improvements
authorskodak <skodak>
Mon, 22 Sep 2008 22:56:56 +0000 (22:56 +0000)
committerskodak <skodak>
Mon, 22 Sep 2008 22:56:56 +0000 (22:56 +0000)
lib/form/areafiles.php

index c71d3a84609e95d2357bf6c0435e85a4cfd14d14..846b8c699d01e890cafa1b509892816d1395db0f 100644 (file)
@@ -6,16 +6,19 @@ class MoodleQuickForm_areafiles extends HTML_QuickForm_element {
     protected $_helpbutton = '';
     protected $_options    = array('subdirs'=>0, 'maxbytes'=>0);
 
-    function MoodleQuickForm_areafiles($elementName=null, $elementLabel=null, $options=null) {
+    function MoodleQuickForm_areafiles($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
         global $CFG;
 
-        if (!empty($options['subdirs'])) {
-            $this->_options['subdirs'] = 1;
+        $options = (array)$options;
+        foreach ($options as $name=>$value) {
+            if (array_key_exists($name, $this->_options)) {
+                $this->_options[$name] = $value;
+            }
         }
         if (!empty($options['maxbytes'])) {
             $this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']);
         }
-        parent::HTML_QuickForm_element($elementName, $elementLabel);
+        parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
     }
 
     function setName($name) {