diff --git a/lib/form/areafiles.php b/lib/form/areafiles.php index 58bbc7ed3c9e1..55c4da26fbbbc 100644 --- a/lib/form/areafiles.php +++ b/lib/form/areafiles.php @@ -4,12 +4,15 @@ class MoodleQuickForm_areafiles extends HTML_QuickForm_element { protected $_helpbutton = ''; - protected $_options = array('subdirs'=>0); + protected $_options = array('subdirs'=>0, 'maxbytes'=>0); function MoodleQuickForm_areafiles($elementName=null, $elementLabel=null, $options=null) { if (!empty($options['subdirs'])) { $this->_options['subdirs'] = 1; } + if (!empty($options['maxbytes'])) { + $this->_options['maxbytes'] = $options['maxbytes']; + } parent::HTML_QuickForm_element($elementName, $elementLabel); } @@ -29,6 +32,22 @@ function getValue() { return $this->getAttribute('value'); } + function getMaxbytes() { + return $this->_options['maxbytes']; + } + + function setMaxbytes($maxbytes) { + $this->_options['maxbytes'] = $maxbytes; + } + + function getSubdirs() { + return $this->_options['subdirs']; + } + + function setSubdirs($allow) { + $this->_options['subdirs'] = $allow; + } + function setHelpButton($_helpbuttonargs, $function='_helpbutton') { if (!is_array($_helpbuttonargs)) { $_helpbuttonargs = array($_helpbuttonargs);