Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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
/**
18
 *
19
 * @package   theme_universe
20
 * @copyright 2023 Marcin Czaja (https://rosea.io)
21
 * @license   Commercial https://themeforest.net/licenses
22
 *
23
 */
24
 
25
defined('MOODLE_INTERNAL') || die();
26
 
27
$page = new admin_settingpage('theme_universe_settingstopbar', get_string( 'settingstopbar', 'theme_universe'));
28
 
29
$name = 'theme_universe/topbarscss';
30
$title = get_string('topbarscss', 'theme_universe');
31
$description = get_string('topbarscss_desc', 'theme_universe');
32
$setting = new universe_setting_infosettingheading($name, $title, $description);
33
$page->add($setting);
34
 
35
// Prepare hide nodes options.
36
$hidenodesoptions = array(
37
    'home' => get_string('home'),
38
    'myhome' => get_string('myhome'),
39
    'courses' => get_string('mycourses')
40
);
41
 
42
// General settings.
43
$name = 'theme_universe/hlogoareageneral';
44
$heading = get_string('hlogoareageneral', 'theme_universe');
45
$title = get_string('hlogoareageneral_desc', 'theme_universe');
46
$setting = new admin_setting_heading($name, $heading, format_text($title, FORMAT_MARKDOWN));
47
$page->add($setting);
48
 
49
// Setting: Hide nodes in primary navigation.
50
$name = 'theme_universe/hidenodesprimarynavigation';
51
$title = get_string('hidenodesprimarynavigationsetting', 'theme_universe', null, true);
52
$description = get_string('hidenodesprimarynavigationsetting_desc', 'theme_universe', null, true);
53
$setting = new admin_setting_configmulticheckbox($name, $title, $description, array(), $hidenodesoptions);
54
$setting->set_updatedcallback('theme_reset_all_caches');
55
$page->add($setting);
56
 
57
$name = 'theme_universe/topbareditmode';
58
$title = get_string('topbareditmode', 'theme_universe');
59
$description = get_string('topbareditmode_desc', 'theme_universe', $a);
60
$default = 0;
61
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
62
$setting->set_updatedcallback('theme_reset_all_caches');
63
$page->add($setting);
64
 
65
$name = 'theme_universe/topbarcustomhtml';
66
$title = get_string('topbarcustomhtml', 'theme_universe');
67
$description = get_string('topbarcustomhtml_desc', 'theme_universe', $a);
68
$default = '';
69
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
70
$page->add($setting);
71
 
72
// Custom Logo.
73
$name = 'theme_universe/hlogoarea';
74
$heading = get_string('hlogoarea', 'theme_universe');
75
$title = get_string('hlogoarea_desc', 'theme_universe');
76
$setting = new admin_setting_heading($name, $heading, format_text($title, FORMAT_MARKDOWN));
77
$page->add($setting);
78
 
79
$name = 'theme_universe/topbarlogoareaon';
80
$title = get_string('topbarlogoareaon', 'theme_universe');
81
$description = get_string('topbarlogoareaon_desc', 'theme_universe');
82
$default = 1;
83
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
84
$setting->set_updatedcallback('theme_reset_all_caches');
85
$page->add($setting);
86
 
87
$name = 'theme_universe/customlogo';
88
$title = get_string('customlogo', 'theme_universe');
89
$description = get_string('customlogo_desc', 'theme_universe');
90
$opts = array('accepted_types' => array('.png', '.jpg', '.svg', 'gif'));
91
$setting = new admin_setting_configstoredfile($name, $title, $description, 'customlogo', 0, $opts);
92
$page->add($setting);
93
 
94
$name = 'theme_universe/customdmlogo';
95
$title = get_string('customdmlogo', 'theme_universe');
96
$description = get_string('customdmlogo_desc', 'theme_universe');
97
$opts = array('accepted_types' => array('.png', '.jpg', '.svg', 'gif'));
98
$setting = new admin_setting_configstoredfile($name, $title, $description, 'customdmlogo', 0, $opts);
99
$page->add($setting);
100
 
101
$name = 'theme_universe/navbarlogobox';
102
$title = get_string('navbarlogobox', 'theme_universe');
103
$description = get_string('navbarlogobox_desc', 'theme_universe', $a);
104
$default = 0;
105
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
106
$setting->set_updatedcallback('theme_reset_all_caches');
107
$page->add($setting);
108
 
109
$name = 'theme_universe/customlogoandname';
110
$title = get_string('customlogoandname', 'theme_universe');
111
$description = get_string('customlogoandname_desc', 'theme_universe');
112
$default = 1;
113
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
114
$setting->set_updatedcallback('theme_reset_all_caches');
115
$page->add($setting);
116
 
117
$name = 'theme_universe/customlogotxt';
118
$title = get_string('customlogotxt', 'theme_universe');
119
$description = get_string('customlogotxt_desc', 'theme_universe');
120
$default = 'universe';
121
$setting = new admin_setting_configtext($name, $title, $description, $default);
122
$page->add($setting);
123
 
124
// Colors.
125
$name = 'theme_universe/htopbarcolors';
126
$heading = get_string('htopbarcolors', 'theme_universe');
127
$title = get_string('htopbarcolors_desc', 'theme_universe');
128
$setting = new admin_setting_heading($name, $heading, format_text($title, FORMAT_MARKDOWN));
129
$page->add($setting);
130
 
131
$name = 'theme_universe/colortopbarbg1';
132
$title = get_string('colortopbarbg1', 'theme_universe');
133
$description = get_string('color_desc', 'theme_universe');
134
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
135
$setting->set_updatedcallback('theme_reset_all_caches');
136
$page->add($setting);
137
 
138
$name = 'theme_universe/dmcolortopbarbg1';
139
$title = get_string('dmcolortopbarbg1', 'theme_universe');
140
$description = get_string('color_desc', 'theme_universe');
141
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
142
$setting->set_updatedcallback('theme_reset_all_caches');
143
$page->add($setting);
144
 
145
$name = 'theme_universe/colortopbarbg2';
146
$title = get_string('colortopbarbg2', 'theme_universe');
147
$description = get_string('color_desc', 'theme_universe');
148
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
149
$setting->set_updatedcallback('theme_reset_all_caches');
150
$page->add($setting);
151
 
152
$name = 'theme_universe/dmcolortopbarbg2';
153
$title = get_string('dmcolortopbarbg2', 'theme_universe');
154
$description = get_string('color_desc', 'theme_universe');
155
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
156
$setting->set_updatedcallback('theme_reset_all_caches');
157
$page->add($setting);
158
 
159
$name = 'theme_universe/colortopbartext';
160
$title = get_string('colortopbartext', 'theme_universe');
161
$description = get_string('color_desc', 'theme_universe');
162
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
163
$setting->set_updatedcallback('theme_reset_all_caches');
164
$page->add($setting);
165
 
166
$name = 'theme_universe/colortopbarbtntext';
167
$title = get_string('colortopbarbtntext', 'theme_universe');
168
$description = get_string('color_desc', 'theme_universe');
169
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
170
$setting->set_updatedcallback('theme_reset_all_caches');
171
$page->add($setting);
172
 
173
$name = 'theme_universe/colortopbarbtnhover';
174
$title = get_string('colortopbarbtnhover', 'theme_universe');
175
$description = get_string('color_desc', 'theme_universe');
176
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
177
$setting->set_updatedcallback('theme_reset_all_caches');
178
$page->add($setting);
179
 
180
$name = 'theme_universe/colortopbarbtnhovertext';
181
$title = get_string('colortopbarbtnhovertext', 'theme_universe');
182
$description = get_string('color_desc', 'theme_universe');
183
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
184
$setting->set_updatedcallback('theme_reset_all_caches');
185
$page->add($setting);
186
 
187
// Additional Button next to the Log in button.
188
$name = 'theme_universe/hadditionalbtn';
189
$heading = get_string('hadditionalbtn', 'theme_universe');
190
$title = get_string('hadditionalbtn_desc', 'theme_universe');
191
$setting = new admin_setting_heading($name, $heading, format_text($title, FORMAT_MARKDOWN));
192
$page->add($setting);
193
 
194
$name = 'theme_universe/topbaradditionalbtn';
195
$title = get_string('topbaradditionalbtn', 'theme_universe');
196
$description = get_string('topbaradditionalbtn_desc', 'theme_universe');
197
$default = 1;
198
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
199
$setting->set_updatedcallback('theme_reset_all_caches');
200
$page->add($setting);
201
 
202
$name = 'theme_universe/stopbaradditionalbtn';
203
$title = get_string('stopbaradditionalbtn', 'theme_universe');
204
$description = get_string('stopbaradditionalbtn_desc', 'theme_universe');
205
$default = '';
206
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
207
$page->add($setting);
208
 
209
$name = 'theme_universe/topbaradditionalbtnurl';
210
$title = get_string('topbaradditionalbtnurl', 'theme_universe');
211
$description = get_string('topbaradditionalbtnurl_desc', 'theme_universe');
212
$default = '';
213
$setting = new admin_setting_configtext($name, $title, $description, $default);
214
$page->add($setting);
215
 
216
// Must add the page after definiting all the settings!
217
$settings->add($page);