mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-23308, fixed maxbytes setting in filemanager
This commit is contained in:
parent
e2620b9d15
commit
c8f0b53409
1 changed files with 11 additions and 1 deletions
|
@ -258,6 +258,16 @@ function form_filemanager_render($options) {
|
||||||
|
|
||||||
$client_id = $options->client_id;
|
$client_id = $options->client_id;
|
||||||
$itemid = $options->itemid;
|
$itemid = $options->itemid;
|
||||||
|
list($context, $course, $cm) = get_context_info_array($options->context->id);
|
||||||
|
if (is_object($course)) {
|
||||||
|
$course_maxbytes = $course->maxbytes;
|
||||||
|
} else {
|
||||||
|
$course_maxbytes = $CFG->maxbytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($options->maxbytes == -1 || empty($options->maxbytes)) {
|
||||||
|
$options->maxbytes = $CFG->maxbytes;
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($options->filecount)) {
|
if (empty($options->filecount)) {
|
||||||
$extra = ' style="display:none"';
|
$extra = ' style="display:none"';
|
||||||
|
@ -265,7 +275,7 @@ function form_filemanager_render($options) {
|
||||||
$extra = '';
|
$extra = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$maxsize = get_string('maxfilesize', 'moodle', display_size(get_max_upload_file_size($CFG->maxbytes, 0, $options->maxbytes)));
|
$maxsize = get_string('maxfilesize', 'moodle', display_size(get_max_upload_file_size($CFG->maxbytes, $course_maxbytes, $options->maxbytes)));
|
||||||
$html .= <<<FMHTML
|
$html .= <<<FMHTML
|
||||||
<div class="filemanager-loading mdl-align" id='filemanager-loading-{$client_id}'>
|
<div class="filemanager-loading mdl-align" id='filemanager-loading-{$client_id}'>
|
||||||
$icon_progress
|
$icon_progress
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue