choosecoursefileorimsrepo MDL-19332 pass specified attrs to text element

This commit is contained in:
samhemelryk
2009-05-29 04:14:25 +00:00
parent 38e5f26c7a
commit 1526635c51
+5 -1
View 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];