Skip to content

Commit

Permalink
MDL-23308, fixed maxbytes setting in filemanager
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed Sep 13, 2010
1 parent e2620b9 commit c8f0b53
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/form/filemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,24 @@ function form_filemanager_render($options) {

$client_id = $options->client_id;
$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)) {
$extra = ' style="display:none"';
} else {
$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
<div class="filemanager-loading mdl-align" id='filemanager-loading-{$client_id}'>
$icon_progress
Expand Down

0 comments on commit c8f0b53

Please sign in to comment.