From: stronk7 Date: Thu, 7 May 2009 20:30:48 +0000 (+0000) Subject: MDL-19112 choosecoursefile group element - pass specified attrs to text element ... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3ea24f884aa6296cc8c44a5eb153e1a083f1fb14;p=moodle.git MDL-19112 choosecoursefile group element - pass specified attrs to text element ; merged from 19_STABLE --- diff --git a/lib/form/choosecoursefile.php b/lib/form/choosecoursefile.php index 4ac002b48c..ab0e921662 100644 --- a/lib/form/choosecoursefile.php +++ b/lib/form/choosecoursefile.php @@ -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 +?>