MDL-24382, fixed display of file size limit in filepicker

This commit is contained in:
Dongsheng Cai 2010-09-30 03:36:38 +00:00
parent fe9d5f7efc
commit b817205bec
2 changed files with 7 additions and 1 deletions

View File

@ -75,6 +75,7 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input {
$args->accepted_types = $this->_options['accepted_types']?$this->_options['accepted_types']:'*';
$args->return_types = FILE_INTERNAL;
$args->itemid = $draftitemid;
$args->maxbytes = $this->_options['maxbytes'];
$args->context = $PAGE->context;
$html = $this->_getTabs();

View File

@ -1914,7 +1914,12 @@ class core_renderer extends renderer_base {
if (empty($currentfile)) {
$currentfile = get_string('nofilesattached', 'repository');
}
$maxsize = get_string('maxfilesize', 'moodle', display_size(get_max_upload_file_size()));
if ($options->maxbytes) {
$size = $options->maxbytes;
} else {
$size = get_max_upload_file_size();
}
$maxsize = get_string('maxfilesize', 'moodle', display_size($size));
$html = <<<EOD
<div class="filemanager-loading mdl-align" id='filepicker-loading-{$client_id}'>
$icon_progress