diff --git a/settings.php b/settings.php index 4d144b7..93d7a5a 100644 --- a/settings.php +++ b/settings.php @@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die; if ($hassiteconfig) { - $settings = new admin_settingpage('local_debugtoolbar', get_string('pluginname', 'local_debugtoolbar')); + $settings = new admin_settingpage('local_debugtoolbar', new lang_string('pluginname', 'local_debugtoolbar')); $ADMIN->add('localplugins', $settings); // Note : We always add the custom admin_settingpage to the tree, but the actual settings are added to that page @@ -35,48 +35,48 @@ // but only the administration pages structure (source : https://moodledev.io/docs/4.4/apis/subsystems/admin). if ($ADMIN->fulltree) { // Add warnings about usage. - $content = html_writer::tag('div', get_string('usage_warning', 'local_debugtoolbar'), ['class' => 'alert alert-warning']); - $settings->add(new admin_setting_heading('local_debugtoolbar/header', get_string('settings'), $content)); + $content = html_writer::tag('div', new lang_string('usage_warning', 'local_debugtoolbar'), ['class' => 'alert alert-warning']); + $settings->add(new admin_setting_heading('local_debugtoolbar/header', new lang_string('settings'), $content)); // Add a checkbox to enable/disable module. $name = 'local_debugtoolbar/enable'; - $label = get_string('enable_debugtoolbar', 'local_debugtoolbar'); + $label = new lang_string('enable_debugtoolbar', 'local_debugtoolbar'); $description = ''; $default = 0; $settings->add(new admin_setting_plugin_activation($name, $label, $description, $default)); // Add a checkbox to enable/disable error handler. $name = 'local_debugtoolbar/enable_error_handler'; - $label = get_string('enable_error_handler', 'local_debugtoolbar'); - $description = get_string('enable_error_handler_description', 'local_debugtoolbar'); + $label = new lang_string('enable_error_handler', 'local_debugtoolbar'); + $description = new lang_string('enable_error_handler_description', 'local_debugtoolbar'); $default = 0; $settings->add(new admin_setting_configcheckbox($name, $label, $description, $default)); // Add a field to set execution time warning threshold. $name = 'local_debugtoolbar/realtime_warning_threshold'; - $label = get_string('realtime_warning_threshold', 'local_debugtoolbar'); - $description = get_string('realtime_warning_threshold_description', 'local_debugtoolbar'); + $label = new lang_string('realtime_warning_threshold', 'local_debugtoolbar'); + $description = new lang_string('realtime_warning_threshold_description', 'local_debugtoolbar'); $default = .2; $settings->add(new admin_setting_configtext($name, $label, $description, $default, PARAM_FLOAT)); // Add a field to set execution time critical threshold. $name = 'local_debugtoolbar/realtime_critical_threshold'; - $label = get_string('realtime_critical_threshold', 'local_debugtoolbar'); - $description = get_string('realtime_critical_threshold_description', 'local_debugtoolbar'); + $label = new lang_string('realtime_critical_threshold', 'local_debugtoolbar'); + $description = new lang_string('realtime_critical_threshold_description', 'local_debugtoolbar'); $default = 2; $settings->add(new admin_setting_configtext($name, $label, $description, $default, PARAM_FLOAT)); // Add a field to set database queries warning threshold. $name = 'local_debugtoolbar/dbqueries_warning_threshold'; - $label = get_string('dbqueries_warning_threshold', 'local_debugtoolbar'); - $description = get_string('dbqueries_warning_threshold_description', 'local_debugtoolbar'); + $label = new lang_string('dbqueries_warning_threshold', 'local_debugtoolbar'); + $description = new lang_string('dbqueries_warning_threshold_description', 'local_debugtoolbar'); $default = 50; $settings->add(new admin_setting_configtext($name, $label, $description, $default, PARAM_INT)); // Add a field to set database queries critical threshold. $name = 'local_debugtoolbar/dbqueries_critical_threshold'; - $label = get_string('dbqueries_critical_threshold', 'local_debugtoolbar'); - $description = get_string('dbqueries_critical_threshold_description', 'local_debugtoolbar'); + $label = new lang_string('dbqueries_critical_threshold', 'local_debugtoolbar'); + $description = new lang_string('dbqueries_critical_threshold_description', 'local_debugtoolbar'); $default = 100; $settings->add(new admin_setting_configtext($name, $label, $description, $default, PARAM_INT)); }