Skip to content

Commit

Permalink
MDL-16596 support for restricting of subdirectory browsing/upload - g…
Browse files Browse the repository at this point in the history
…etter and setter methods
  • Loading branch information
skodak committed Sep 21, 2008
1 parent b5b188c commit 45d0b87
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion lib/form/areafiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
Expand Down

0 comments on commit 45d0b87

Please sign in to comment.