MDL-56016 theme_boost: Add plain preset for plain Moodle & Bootstrap
[moodle.git] / theme / boost / settings.php
CommitLineData
6bde9450
RW
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
2ede86d7 18 * @package theme_boost
6bde9450
RW
19 * @copyright 2016 Ryan Wyllie
20 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
21 */
22
23defined('MOODLE_INTERNAL') || die();
24
25if ($ADMIN->fulltree) {
2ede86d7
DW
26 $settings = new theme_boost_admin_settingspage_tabs('themesettingboost', get_string('configtitle', 'theme_boost'));
27 $page = new admin_settingpage('theme_boost_general', get_string('generalsettings', 'theme_boost'));
6bde9450 28
d48dbde9 29 // Preset.
2ede86d7
DW
30 $name = 'theme_boost/preset';
31 $title = get_string('preset', 'theme_boost');
32 $description = get_string('preset_desc', 'theme_boost');
d48dbde9
FM
33 $choices = [
34 // A file named 'preset-' . key . '.scss' is expected.
239fd05c 35 'plain' => get_string('presetplain', 'theme_boost'),
2ede86d7
DW
36 'default' => get_string('presetdefault', 'theme_boost'),
37 'flatly' => get_string('presetflatly', 'theme_boost'),
38 'paper' => get_string('presetpaper', 'theme_boost'),
39 'readable' => get_string('presetreadable', 'theme_boost')
d48dbde9
FM
40 ];
41 $default = 'default';
42 $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
43 $setting->set_updatedcallback('theme_reset_all_caches');
44 $page->add($setting);
6bde9450 45
d48dbde9 46 // Variable $body-color.
2ede86d7
DW
47 $name = 'theme_boost/brandcolor';
48 $title = get_string('brandcolor', 'theme_boost');
49 $description = get_string('brandcolor_desc', 'theme_boost');
d48dbde9
FM
50 $default = '#373A3C'; // Straight from bootstrap variables.
51 $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, null, false);
52 $setting->set_updatedcallback('theme_reset_all_caches');
53 $page->add($setting);
6bde9450 54
d48dbde9
FM
55 // Must add the page after definiting all the settings!
56 $settings->add($page);
57
58 // Advanced settings.
2ede86d7 59 $page = new admin_settingpage('theme_boost_advanced', get_string('advancedsettings', 'theme_boost'));
d48dbde9
FM
60
61 // Raw SCSS for before the content.
2ede86d7
DW
62 $setting = new theme_boost_admin_setting_scss_variables('theme_boost/scss_variables',
63 get_string('scssvariables', 'theme_boost'), get_string('scssvariables_desc', 'theme_boost'), '', PARAM_RAW);
d48dbde9
FM
64 $setting->set_updatedcallback('theme_reset_all_caches');
65 $page->add($setting);
66
67 // Raw SCSS for after the content.
2ede86d7
DW
68 $setting = new admin_setting_configtextarea('theme_boost/scss', get_string('rawscss', 'theme_boost'),
69 get_string('rawscss_desc', 'theme_boost'), '', PARAM_RAW);
d48dbde9
FM
70 $setting->set_updatedcallback('theme_reset_all_caches');
71 $page->add($setting);
72
73 $settings->add($page);
6bde9450 74}