From 1526635c512f93cb787328491d37d7a6fa19d360 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Fri, 29 May 2009 04:14:25 +0000 Subject: [PATCH] choosecoursefileorimsrepo MDL-19332 pass specified attrs to text element --- lib/form/choosecoursefileorimsrepo.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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]; -- 2.39.5