From 45d0b8729c96e7d3a0b53501d925205b593a430a Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 21 Sep 2008 20:48:05 +0000 Subject: [PATCH] MDL-16596 support for restricting of subdirectory browsing/upload - getter and setter methods --- lib/form/areafiles.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/form/areafiles.php b/lib/form/areafiles.php index 58bbc7ed3c..55c4da26fb 100644 --- a/lib/form/areafiles.php +++ b/lib/form/areafiles.php @@ -4,12 +4,15 @@ require_once('HTML/QuickForm/element.php'); 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 @@ class MoodleQuickForm_areafiles extends HTML_QuickForm_element { 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); -- 2.39.5