]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19112 choosecoursefile group element - pass specified attrs to text element ...
authorstronk7 <stronk7>
Thu, 7 May 2009 20:30:48 +0000 (20:30 +0000)
committerstronk7 <stronk7>
Thu, 7 May 2009 20:30:48 +0000 (20:30 +0000)
lib/form/choosecoursefile.php

index 4ac002b48c30f7d8a68f676723afa21088c8a78f..ab0e9216629910fe2fffbc73d70440238e4d584a 100644 (file)
@@ -65,7 +65,11 @@ class MoodleQuickForm_choosecoursefile extends MoodleQuickForm_group
         global $COURSE;
         $this->_elements = array();
 
-        $this->_elements[0] =& MoodleQuickForm::createElement('text', 'value', '', array('size'=>'48'));
+        if (!is_array($this->getAttributes()) || !array_key_exists('size', $this->getAttributes())) {
+            $this->updateAttributes(array('size' => 48));
+        }
+
+        $this->_elements[0] =& MoodleQuickForm::createElement('text', 'value', '', $this->getAttributes());
         $this->_elements[1] =& MoodleQuickForm::createElement('button', 'popup', get_string('chooseafile', 'resource') .' ...');
 
         $button =& $this->_elements[1];
@@ -91,6 +95,7 @@ class MoodleQuickForm_choosecoursefile extends MoodleQuickForm_group
 
         $button->updateAttributes($buttonattributes);
     }
+
     /**
      * Output a timestamp. Give it the name of the group.
      *
@@ -144,4 +149,4 @@ class MoodleQuickForm_choosecoursefile extends MoodleQuickForm_group
     } // end func onQuickFormEvent
 
 }
-?>
\ No newline at end of file
+?>