-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.php
147 lines (128 loc) · 6.22 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Plugin strings are defined here.
*
* @package theme_stream
* @category admin
* @copyright 2022 Hugo Ribeiro <ribeiro.hugo@gmail.com>
* @license https://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('themesettingstream',
get_string('configtitle', 'theme_stream'), 'theme/stream:changesettings');
$page = new admin_settingpage ('theme_stream_general', get_string('generalsettings', 'theme_stream'));
$page->add(new admin_setting_heading('theme_stream/colours', get_string('colours', 'theme_stream'), ''));
// Variable $primary.
$name = 'theme_stream/primarycolour';
$title = get_string('primarycolour', 'theme_stream');
$description = get_string('primarycolour_desc', 'theme_stream');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '#daaa00');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Variable $secondary.
$name = 'theme_stream/secondarycolour';
$title = get_string('secondarycolour', 'theme_stream');
$description = get_string('secondarycolour_desc', 'theme_stream');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '#298976');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$page->add(new admin_setting_heading('theme_stream/fonts', get_string('fonts', 'theme_stream'), ''));
// External Fonts source.
$name = 'theme_stream/externalfonts';
$title = get_string('externalfonts', 'theme_stream');
$description = get_string('externalfonts_desc', 'theme_stream');
$setting = new admin_setting_configcheckbox($name, $title, $description, '1');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Fonts settings.
$name = 'theme_stream/bunnyfonts';
$title = get_string('bunnyfonts', 'theme_stream');
$description = get_string('bunnyfonts_desc', 'theme_stream');
$choices = [
'Abel' => 'Abel',
'Roboto' => 'Roboto',
'roboto-condensed' => 'Roboto Condensed',
'Nunito' => 'Nunito',
'Montserrat' => 'Montserrat',
'Lato' => 'Lato',
'Poppins' => 'Poppins',
'Oswald' => 'Oswald',
'Mukta' => 'Mukta',
];
$setting = new admin_setting_configselect($name, $title, $description, 'Nunito', $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$page->add(new admin_setting_heading('theme_stream/customstylessettings',
get_string('customstylessettings', 'theme_stream'), ''));
// Favicon.
$name = 'theme_stream/favicon';
$title = get_string('favicon', 'theme_stream');
$description = get_string('favicon_desc', 'theme_stream');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'favicon', 0,
['maxfiles' => 1, 'accepted_types' => ['.ico', '.png' ]]);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Login Page Image.
$name = 'theme_stream/loginimg';
$title = get_string('loginimg', 'theme_stream');
$description = get_string('loginimg_desc', 'theme_stream');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'loginimg', 0,
['maxfiles' => 1, 'accepted_types' => 'web_image']);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Full-width setting.
$name = 'theme_stream/fullwidthpage';
$title = get_string('fullwidthpage', 'theme_stream');
$description = get_string('fullwidthpage_desc', 'theme_stream');
$setting = new admin_setting_configcheckbox($name, $title, $description, '1');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Raw SCSS to include before the content. As per Boost.
$setting = new admin_setting_scsscode('theme_stream/scsspre',
get_string('rawscsspre', 'theme_boost'), get_string('rawscsspre_desc', 'theme_boost'), '', PARAM_RAW);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Raw SCSS to include after the content. As per Boost.
$setting = new admin_setting_scsscode('theme_stream/scss', get_string('rawscss', 'theme_boost'),
get_string('rawscss_desc', 'theme_boost'), '', PARAM_RAW);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Show back to top icon.
$name = 'theme_stream/backtotopbutton';
$title = get_string('backtotopbutton', 'theme_stream');
$description = get_string('backtotopbutton_desc', 'theme_stream');
$setting = new admin_setting_configcheckbox($name, $title, $description, '1');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Hide primary navigation nodes.
$choices = [
'home' => get_string('home'),
'myhome' => get_string('myhome'),
'courses' => get_string('mycourses'),
];
$name = 'theme_stream/hideprimarynodes';
$title = get_string('hideprimarynodes', 'theme_stream');
$description = get_string('hideprimarynodes_desc', 'theme_stream');
$setting = new admin_setting_configmulticheckbox($name, $title, $description, null, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$settings->add($page);
require_once('settings/frontpagesettings.php');
require_once('settings/coursesettings.php');
require_once('settings/footersettings.php');
}