MDL-24497, fixed maxbytes in user editing form

This commit is contained in:
Dongsheng Cai
2010-10-04 03:09:58 +00:00
parent 0d9dcca058
commit 513aed3cf9
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -1919,7 +1919,11 @@ class core_renderer extends renderer_base {
} else {
$size = get_max_upload_file_size();
}
$maxsize = get_string('maxfilesize', 'moodle', display_size($size));
if ($size == -1) {
$maxsize = get_string('maxfilesize', 'moodle', 'unlimited');
} else {
$maxsize = get_string('maxfilesize', 'moodle', display_size($size));
}
$html = <<<EOD
<div class="filemanager-loading mdl-align" id='filepicker-loading-{$client_id}'>
$icon_progress
+1 -1
View File
@@ -246,7 +246,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$mform->addElement('checkbox', 'deletepicture', get_string('delete'));
$mform->setDefault('deletepicture', 0);
$mform->addElement('filepicker', 'imagefile', get_string('newpicture'));
$mform->addElement('filepicker', 'imagefile', get_string('newpicture'), '', array('maxbytes'=>get_max_upload_file_size($CFG->maxbytes)));
$mform->addHelpButton('imagefile', 'newpicture');
$mform->addElement('text', 'imagealt', get_string('imagealt'), 'maxlength="100" size="30"');