"MDL-13766, fixed maxbytes limit"
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user