diff --git a/admin/settings/security.php b/admin/settings/security.php index 94b379d171e..4fa0d1fcc19 100644 --- a/admin/settings/security.php +++ b/admin/settings/security.php @@ -23,9 +23,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page new lang_string('configprofileroles', 'admin'), array('student', 'teacher', 'editingteacher'))); - $max_upload_choices = get_max_upload_sizes(); + $max_upload_choices = get_max_upload_sizes(0, 0, 0, $CFG->maxbytes); // maxbytes set to 0 will allow the maximum server limit for uploads - $max_upload_choices[0] = new lang_string('serverlimit', 'admin'); $temp->add(new admin_setting_configselect('maxbytes', new lang_string('maxbytes', 'admin'), new lang_string('configmaxbytes', 'admin'), 0, $max_upload_choices)); // 100MB $defaultuserquota = 104857600; diff --git a/mod/assign/submission/file/settings.php b/mod/assign/submission/file/settings.php index 03bb2b5070f..f707f5bd7a3 100644 --- a/mod/assign/submission/file/settings.php +++ b/mod/assign/submission/file/settings.php @@ -33,10 +33,11 @@ if (isset($CFG->maxbytes)) { $name = new lang_string('maximumsubmissionsize', 'assignsubmission_file'); $description = new lang_string('configmaxbytes', 'assignsubmission_file'); + $config = get_config('assignsubmission_file'); $element = new admin_setting_configselect('assignsubmission_file/maxbytes', $name, $description, 1048576, - get_max_upload_sizes($CFG->maxbytes)); + get_max_upload_sizes($CFG->maxbytes, 0, 0, $config->maxbytes)); $settings->add($element); } diff --git a/mod/assignment/settings.php b/mod/assignment/settings.php index 05fa52c0c83..c036405e546 100644 --- a/mod/assignment/settings.php +++ b/mod/assignment/settings.php @@ -7,7 +7,7 @@ if ($ADMIN->fulltree) { if (isset($CFG->maxbytes)) { $settings->add(new admin_setting_configselect('assignment_maxbytes', get_string('maximumsize', 'assignment'), - get_string('configmaxbytes', 'assignment'), 1048576, get_max_upload_sizes($CFG->maxbytes))); + get_string('configmaxbytes', 'assignment'), 1048576, get_max_upload_sizes($CFG->maxbytes, 0, 0, $CFG->assignment_maxbytes))); } $options = array(ASSIGNMENT_COUNT_WORDS => trim(get_string('numwords', '', '?')), diff --git a/mod/data/field/file/mod.html b/mod/data/field/file/mod.html index 7a67a1694d6..8f8945c5bca 100644 --- a/mod/data/field/file/mod.html +++ b/mod/data/field/file/mod.html @@ -13,7 +13,7 @@ get_record('course', array('id'=>$this->data->course)); - $choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes); + $choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes, 0, $this->field->param3); echo html_writer::select($choices, 'param3', $this->field->param3, false, array('id' => 'param3')); ?> diff --git a/mod/data/field/picture/mod.html b/mod/data/field/picture/mod.html index 2ea07789ab3..99fd424b734 100644 --- a/mod/data/field/picture/mod.html +++ b/mod/data/field/picture/mod.html @@ -45,7 +45,7 @@ get_record('course', array('id'=>$this->data->course)); - $choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes); + $choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes, 0, $this->field->param3); echo html_writer::select($choices, 'param3', $this->field->param3, false, array('id'=>'param3')); ?> diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php index a173bb07b63..4403004daad 100644 --- a/mod/forum/mod_form.php +++ b/mod/forum/mod_form.php @@ -57,7 +57,7 @@ class mod_forum_mod_form extends moodleform_mod { // Attachments and word count. $mform->addElement('header', 'attachmentswordcounthdr', get_string('attachmentswordcount', 'forum')); - $choices = get_max_upload_sizes($CFG->maxbytes, $COURSE->maxbytes); + $choices = get_max_upload_sizes($CFG->maxbytes, $COURSE->maxbytes, 0, $CFG->forum_maxbytes); $choices[1] = get_string('uploadnotallowed'); $mform->addElement('select', 'maxbytes', get_string('maxattachmentsize', 'forum'), $choices); $mform->addHelpButton('maxbytes', 'maxattachmentsize', 'forum'); diff --git a/mod/forum/settings.php b/mod/forum/settings.php index 8247e0ae1e6..8a0bd1b5524 100644 --- a/mod/forum/settings.php +++ b/mod/forum/settings.php @@ -46,7 +46,7 @@ if ($ADMIN->fulltree) { if (isset($CFG->maxbytes)) { $settings->add(new admin_setting_configselect('forum_maxbytes', get_string('maxattachmentsize', 'forum'), - get_string('configmaxbytes', 'forum'), 512000, get_max_upload_sizes($CFG->maxbytes))); + get_string('configmaxbytes', 'forum'), 512000, get_max_upload_sizes($CFG->maxbytes, 0, 0, $CFG->forum_maxbytes))); } // Default number of attachments allowed per post in all forums diff --git a/mod/workshop/mod_form.php b/mod/workshop/mod_form.php index 6f68e208757..601238d04b1 100644 --- a/mod/workshop/mod_form.php +++ b/mod/workshop/mod_form.php @@ -129,7 +129,7 @@ class mod_workshop_mod_form extends moodleform_mod { $mform->addElement('select', 'nattachments', $label, $options); $mform->setDefault('nattachments', 1); - $options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes); + $options = get_max_upload_sizes($CFG->maxbytes, $this->course->maxbytes, 0, $workshopconfig->maxbytes); $mform->addElement('select', 'maxbytes', get_string('maxbytes', 'workshop'), $options); $mform->setDefault('maxbytes', $workshopconfig->maxbytes); diff --git a/mod/workshop/settings.php b/mod/workshop/settings.php index b85de36efd0..264f82726ba 100644 --- a/mod/workshop/settings.php +++ b/mod/workshop/settings.php @@ -47,7 +47,8 @@ if ($ADMIN->fulltree) { get_string('configgradedecimals', 'workshop'), 0, $options)); if (isset($CFG->maxbytes)) { - $options = get_max_upload_sizes($CFG->maxbytes); + $config = get_config('workshop'); + $options = get_max_upload_sizes($CFG->maxbytes, 0, 0, $config->maxbytes); $settings->add(new admin_setting_configselect('workshop/maxbytes', get_string('maxbytes', 'workshop'), get_string('configmaxbytes', 'workshop'), 0, $options)); }