This commit is contained in:
Huong Nguyen 2024-04-18 09:26:36 +07:00
commit 978f3d42e5
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A
2 changed files with 8 additions and 4 deletions

View File

@ -349,14 +349,17 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
new lang_string('themeselector', 'admin'), $CFG->wwwroot . '/admin/themeselector.php'));
// Settings page for each theme.
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themesettingscustom', 'admin')));
foreach (core_component::get_plugin_list('theme') as $theme => $themedir) {
$settingspath = "$themedir/settings.php";
if (file_exists($settingspath)) {
$settings = new admin_externalpage('themesetting' . $theme, new lang_string('pluginname', 'theme_'.$theme),
new moodle_url($settingspath), 'moodle/site:config', true);
$settings = new admin_settingpage("themesetting$theme", new lang_string('pluginname', "theme_$theme"),
'moodle/site:config', true
);
include($settingspath);
if ($settings) {
$ADMIN->add('appearance', $settings);
// Add settings if not hidden (to avoid displaying the section if it appears empty in the UI).
if ($settings && !$settings->hidden) {
$ADMIN->add('themes', $settings);
}
}
}

View File

@ -1458,6 +1458,7 @@ $string['themeresetcaches'] = 'Clear theme caches';
$string['themeselect'] = 'Change theme';
$string['themeselector'] = 'Themes';
$string['themesettingsadvanced'] = 'Advanced theme settings';
$string['themesettingscustom'] = 'Custom theme settings';
$string['themeeditsettingsname'] = 'Edit theme settings \'{$a}\'';
$string['themesettingsname'] = 'Theme settings \'{$a}\'';
$string['themeusagereportname'] = 'Theme usage report \'{$a}\'';