]> git.mjollnir.org Git - moodle.git/commitdiff
choosecoursefileorimsrepo MDL-19332 pass specified attrs to text element
authorsamhemelryk <samhemelryk>
Fri, 29 May 2009 04:14:25 +0000 (04:14 +0000)
committersamhemelryk <samhemelryk>
Fri, 29 May 2009 04:14:25 +0000 (04:14 +0000)
lib/form/choosecoursefileorimsrepo.php

index 327be815a584028a0c9207f4ff76dcf7d64c949f..0429282f86eb981d482579e2c78f975157955358 100644 (file)
@@ -63,7 +63,11 @@ class MoodleQuickForm_choosecoursefileorimsrepo extends MoodleQuickForm_group
         global $CFG, $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];