From: samhemelryk Date: Fri, 29 May 2009 04:14:25 +0000 (+0000) Subject: choosecoursefileorimsrepo MDL-19332 pass specified attrs to text element X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1526635c512f93cb787328491d37d7a6fa19d360;p=moodle.git choosecoursefileorimsrepo MDL-19332 pass specified attrs to text element --- diff --git a/lib/form/choosecoursefileorimsrepo.php b/lib/form/choosecoursefileorimsrepo.php index 327be815a5..0429282f86 100644 --- a/lib/form/choosecoursefileorimsrepo.php +++ b/lib/form/choosecoursefileorimsrepo.php @@ -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];