MDL-46317 admin: convert userquota config from text to filesize widget

This commit is contained in:
Shamim Rezaie 2019-08-12 13:11:19 +10:00
parent e2d97a4659
commit e945b883fa
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,7 @@
<?php <?php
use core_admin\local\settings\filesize as filesize;
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// "ip blocker" settingpage // "ip blocker" settingpage
@ -36,12 +38,9 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// maxbytes set to 0 will allow the maximum server limit for uploads // maxbytes set to 0 will allow the maximum server limit for uploads
$temp->add(new admin_setting_configselect('maxbytes', new lang_string('maxbytes', 'admin'), new lang_string('configmaxbytes', 'admin'), 0, $max_upload_choices)); $temp->add(new admin_setting_configselect('maxbytes', new lang_string('maxbytes', 'admin'), new lang_string('configmaxbytes', 'admin'), 0, $max_upload_choices));
// 100MB // 100MB
$defaultuserquota = 104857600; $defaultuserquota = 100 * filesize::UNIT_MB;
$params = new stdClass(); $temp->add(new filesize('userquota', new lang_string('userquota', 'admin'),
$params->bytes = $defaultuserquota; new lang_string('userquota_desc', 'admin'), $defaultuserquota));
$params->displaysize = display_size($defaultuserquota);
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'),
new lang_string('configuserquota', 'admin', $params), $defaultuserquota, PARAM_INT, 30));
$temp->add(new admin_setting_configcheckbox('allowobjectembed', new lang_string('allowobjectembed', 'admin'), new lang_string('configallowobjectembed', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('allowobjectembed', new lang_string('allowobjectembed', 'admin'), new lang_string('configallowobjectembed', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enabletrusttext', new lang_string('enabletrusttext', 'admin'), new lang_string('configenabletrusttext', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('enabletrusttext', new lang_string('enabletrusttext', 'admin'), new lang_string('configenabletrusttext', 'admin'), 0));

View file

@ -1390,6 +1390,7 @@ $string['userpreference'] = 'User preference';
$string['userpolicies'] = 'User policies'; $string['userpolicies'] = 'User policies';
$string['users'] = 'Users'; $string['users'] = 'Users';
$string['userquota'] = 'User quota'; $string['userquota'] = 'User quota';
$string['userquota_desc'] = 'The maximum number of bytes that a user can store in their own private file area.';
$string['usesitenameforsitepages'] = 'Use site name for site pages'; $string['usesitenameforsitepages'] = 'Use site name for site pages';
$string['usetags'] = 'Enable tags functionality'; $string['usetags'] = 'Enable tags functionality';
$string['validateemptylineerror'] = 'Empty lines are not valid'; $string['validateemptylineerror'] = 'Empty lines are not valid';