. /** * @package theme_boost * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); if ($ADMIN->fulltree) { $settings = new theme_boost_admin_settingspage_tabs('themesettingboost', get_string('configtitle', 'theme_boost')); $page = new admin_settingpage('theme_boost_general', get_string('generalsettings', 'theme_boost')); // Preset. $name = 'theme_boost/preset'; $title = get_string('preset', 'theme_boost'); $description = get_string('preset_desc', 'theme_boost'); $choices = [ // A file named 'preset-' . key . '.scss' is expected. 'plain' => get_string('presetplain', 'theme_boost'), 'default' => get_string('presetdefault', 'theme_boost'), 'flatly' => get_string('presetflatly', 'theme_boost'), 'paper' => get_string('presetpaper', 'theme_boost'), 'readable' => get_string('presetreadable', 'theme_boost') ]; $default = 'default'; $setting = new admin_setting_configselect($name, $title, $description, $default, $choices); $setting->set_updatedcallback('theme_reset_all_caches'); $page->add($setting); // Variable $body-color. // We use an empty default value because the default colour should come from the preset. $name = 'theme_boost/brandcolor'; $title = get_string('brandcolor', 'theme_boost'); $description = get_string('brandcolor_desc', 'theme_boost'); $setting = new admin_setting_configcolourpicker($name, $title, $description, ''); $setting->set_updatedcallback('theme_reset_all_caches'); $page->add($setting); // Must add the page after definiting all the settings! $settings->add($page); // Advanced settings. $page = new admin_settingpage('theme_boost_advanced', get_string('advancedsettings', 'theme_boost')); // Raw SCSS for before the content. $setting = new theme_boost_admin_setting_scss_variables('theme_boost/scss_variables', get_string('scssvariables', 'theme_boost'), get_string('scssvariables_desc', 'theme_boost'), '', PARAM_RAW); $setting->set_updatedcallback('theme_reset_all_caches'); $page->add($setting); // Raw SCSS for after the content. $setting = new admin_setting_configtextarea('theme_boost/scss', get_string('rawscss', 'theme_boost'), get_string('rawscss_desc', 'theme_boost'), '', PARAM_RAW); $setting->set_updatedcallback('theme_reset_all_caches'); $page->add($setting); $settings->add($page); }