Merge branch 'MDL-33717_admin_message2' of git://github.com/andyjdavis/moodle

This commit is contained in:
Dan Poltawski 2012-06-22 15:09:46 +08:00
commit 5b7621f78d
2 changed files with 4 additions and 2 deletions

View File

@ -455,11 +455,9 @@ class core_files_renderer extends plugin_renderer_base {
$maxbytes = display_size($fm->options->maxbytes);
if (empty($options->maxfiles) || $options->maxfiles == -1) {
$maxsize = get_string('maxfilesize', 'moodle', $maxbytes);
//$string['maxfilesize'] = 'Maximum size for new files: {$a}';
} else {
$strparam = (object)array('size' => $maxbytes, 'attachments' => $options->maxfiles);
$maxsize = get_string('maxsizeandattachments', 'moodle', $strparam);
//$string['maxsizeandattachments'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}';
}
// TODO MDL-32020 also should say about 'File types accepted'
return '<span>'. $maxsize. '</span>';

View File

@ -6049,6 +6049,10 @@ function display_size($size) {
static $gb, $mb, $kb, $b;
if ($size === USER_CAN_IGNORE_FILE_SIZE_LIMITS) {
return get_string('unlimited');
}
if (empty($gb)) {
$gb = get_string('sizegb');
$mb = get_string('sizemb');