Skip to content

Commit

Permalink
MDL-46317 admin: convert userquota config from text to filesize widget
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies committed Aug 12, 2019
1 parent e2d97a4 commit e945b88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions admin/settings/security.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use core_admin\local\settings\filesize as filesize;

if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page

// "ip blocker" settingpage
Expand Down Expand Up @@ -36,12 +38,9 @@
// 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));
// 100MB
$defaultuserquota = 104857600;
$params = new stdClass();
$params->bytes = $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));
$defaultuserquota = 100 * filesize::UNIT_MB;
$temp->add(new filesize('userquota', new lang_string('userquota', 'admin'),
new lang_string('userquota_desc', 'admin'), $defaultuserquota));

$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));
Expand Down
1 change: 1 addition & 0 deletions lang/en/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,7 @@
$string['userpolicies'] = 'User policies';
$string['users'] = 'Users';
$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['usetags'] = 'Enable tags functionality';
$string['validateemptylineerror'] = 'Empty lines are not valid';
Expand Down

0 comments on commit e945b88

Please sign in to comment.