mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-81512 core_theme: Use admin_settingpage for theme settings
This also moves any theme settings pages to the themes category instead of "appearance", so they remain where expected, and avoids adding to that section if the theme is hidden (so if there are no custom theme settings, that section will not appear on the page). Co-authored-by: Michael Hawkins <michaelh@moodle.com>
This commit is contained in:
parent
57df4a1dbb
commit
40aed04ae1
@ -353,11 +353,13 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user