"MDL-13766, fixed maxbytes limit"

This commit is contained in:
Dongsheng Cai
2010-03-08 16:49:51 +00:00
parent 990650f94c
commit 8a3e6a5604
3 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
$this->_options[$name] = $value;
}
}
if (!empty($options['maxbytes'])) {
if (empty($options['maxbytes'])) {
$this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']);
}
parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
@@ -152,7 +152,7 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
$options = file_get_draft_area_files($draftitemid);
$options->mainfile = $this->_options['mainfile'];
$options->maxbytes = $this->getMaxbytes();
$options->maxbytes = $this->_options['maxbytes'];
$options->maxfiles = $this->getMaxfiles();
$options->client_id = $client_id;
$options->filecount = $filecount;
+1
View File
@@ -95,6 +95,7 @@ M.core_filepicker.init = function(Y, options) {
params['sesskey']=M.cfg.sesskey;
params['client_id'] = args.client_id;
params['itemid'] = this.options.itemid?this.options.itemid:0;
params['maxbytes'] = this.options.maxbytes?this.options.maxbytes:-1;
if (args['params']) {
for (i in args['params']) {
params[i] = args['params'][i];
+1 -1
View File
@@ -270,7 +270,7 @@ EOD;
break;
case 'upload':
try {
$result = $repo->upload();
$result = $repo->upload($maxbytes);
$result['client_id'] = $client_id;
echo json_encode($result);
} catch (Exception $e){