forked from dualcube/moodle-theme_rocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
executable file
·213 lines (211 loc) · 10.1 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
// This file is part of Moodle - http://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 <http://www.gnu.org/licenses/>.
/**
* @package theme
* @subpackage rocket
* @copyright Julian Ridden
* @maintaned by 2014 Dualcube {@link http://dualcube.com/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
// Institution Name.
$name = 'theme_rocket/sitename';
$title = get_string('sitename', 'theme_rocket');
$description = get_string('sitenamedesc', 'theme_rocket');
$default = 'Welcome to my site';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Set status of Autohide functionality.
$name = 'theme_rocket/autohide';
$title = get_string('autohide', 'theme_rocket');
$description = get_string('autohidedesc', 'theme_rocket');
$default = 'enable';
$choices = array(
'enable' => get_string('enable', 'theme_rocket'),
'disable' => get_string('disable', 'theme_rocket')
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Set status of Edit Toggle functionality.
$name = 'theme_rocket/edittoggle';
$title = get_string('editmodetoggle', 'theme_rocket');
$description = get_string('edittoggledesc', 'theme_rocket');
$default = 'enable';
$choices = array(
'enable' => get_string('enable', 'theme_rocket'),
'disable' => get_string('disable', 'theme_rocket')
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Set status of Bootstrap functionality.
$name = 'theme_rocket/bootstrap';
$title = get_string('bootstrap', 'theme_rocket');
$description = get_string('bootstrapdesc', 'theme_rocket');
$default = 'disable';
$choices = array(
'enable' => get_string('enable', 'theme_rocket'),
'disable' => get_string('disable', 'theme_rocket')
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Set terminology for dropdown couse list.
$name = 'theme_rocket/mycoursetitle';
$title = get_string('mycoursetitle', 'theme_rocket');
$description = get_string('mycoursetitledesc', 'theme_rocket');
$default = 'course';
$choices = array(
'course' => get_string('mycourses', 'theme_rocket'),
'unit' => get_string('myunits', 'theme_rocket'),
'class' => get_string('myclasses', 'theme_rocket'),
'module' => get_string('mymodules', 'theme_rocket')
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Logo file setting.
$name = 'theme_rocket/logo';
$title = get_string('logo', 'theme_rocket');
$description = get_string('logodesc', 'theme_rocket');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'logo');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Banner file setting.
$name = 'theme_rocket/bannerimage';
$title = get_string('bannerimage', 'theme_rocket');
$description = get_string('bannerimagedesc', 'theme_rocket');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'bannerimage');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Banner Height.
$name = 'theme_rocket/bannerheight';
$title = get_string('bannerheight', 'theme_rocket');
$description = get_string('bannerheightdesc', 'theme_rocket');
$default = 255;
$choices = array(5 => get_string('nobanner', 'theme_rocket'), 55 => '50px', 105 => '100px', 155 => '150px', 205 => '200px',
255 => '250px', 305 => '300px', 355 => '350px');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Fullscreen Toggle.
$name = 'theme_rocket/screenwidth';
$title = get_string('screenwidth', 'theme_rocket');
$description = get_string('screenwidthdesc', 'theme_rocket');
$default = 1000;
$choices = array(1000 => get_string('fixedwidth', 'theme_rocket'), 97 => get_string('variablewidth', 'theme_rocket'));
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Main theme background colour setting.
$name = 'theme_rocket/themecolor';
$title = get_string('themecolor', 'theme_rocket');
$description = get_string('themecolordesc', 'theme_rocket');
$default = '#a8213a';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Main theme trim colour setting.
$name = 'theme_rocket/themetrimcolor';
$title = get_string('themetrimcolor', 'theme_rocket');
$description = get_string('themetrimcolordesc', 'theme_rocket');
$default = '#660000';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Menu colour setting.
$name = 'theme_rocket/menucolor';
$title = get_string('menucolor', 'theme_rocket');
$description = get_string('menucolordesc', 'theme_rocket');
$default = '#76777c';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Menu hover colour setting.
$name = 'theme_rocket/menuhovercolor';
$title = get_string('menuhovercolor', 'theme_rocket');
$description = get_string('menuhovercolordesc', 'theme_rocket');
$default = '#8a8a8a';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Menu trim colour setting.
$name = 'theme_rocket/menutrimcolor';
$title = get_string('menutrimcolor', 'theme_rocket');
$description = get_string('menutrimcolordesc', 'theme_rocket');
$default = '#4c4c4c';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Content link colour setting.
$name = 'theme_rocket/contentlinkcolor';
$title = get_string('contentlinkcolor', 'theme_rocket');
$description = get_string('contentlinkcolordesc', 'theme_rocket');
$default = '#006699';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Block link colour setting.
$name = 'theme_rocket/blocklinkcolor';
$title = get_string('blocklinkcolor', 'theme_rocket');
$description = get_string('blocklinkcolordesc', 'theme_rocket');
$default = '#333333';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Menu link colour setting.
$name = 'theme_rocket/menulinkcolor';
$title = get_string('menulinkcolor', 'theme_rocket');
$description = get_string('menulinkcolordesc', 'theme_rocket');
$default = '#ffffff';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Footer text or link.
$name = 'theme_rocket/footnote';
$title = get_string('footnote', 'theme_rocket');
$description = get_string('footnotedesc', 'theme_rocket');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Copyright Notice.
$name = 'theme_rocket/copyright';
$title = get_string('copyright', 'theme_rocket');
$description = get_string('copyrightdesc', 'theme_rocket');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
// Custom CSS file.
$name = 'theme_rocket/customcss';
$title = get_string('customcss', 'theme_rocket');
$description = get_string('customcssdesc', 'theme_rocket');
$setting = new admin_setting_configtextarea($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
}