Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
// This file defines settingpages and externalpages under the "appearance" category
4
 
1441 ariadna 5
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themesettingscustom', 'admin')));
6
 
1 efrain 7
$capabilities = array(
8
    'moodle/my:configsyspages',
9
    'moodle/tag:manage'
10
);
11
 
12
if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // speedup for non-admins, add all caps used on this page
13
    // Logos section.
14
    $temp = new admin_settingpage('logos', new lang_string('logossettings', 'admin'));
15
 
16
    // Logo file setting.
17
    $title = get_string('logo', 'admin');
18
    $description = get_string('logo_desc', 'admin');
19
    $setting = new admin_setting_configstoredfile('core_admin/logo', $title, $description, 'logo', 0,
20
        ['maxfiles' => 1, 'accepted_types' => ['.jpg', '.png']]);
21
    $setting->set_updatedcallback('theme_reset_all_caches');
22
    $temp->add($setting);
23
 
24
    // Small logo file setting.
25
    $title = get_string('logocompact', 'admin');
26
    $description = get_string('logocompact_desc', 'admin');
27
    $setting = new admin_setting_configstoredfile('core_admin/logocompact', $title, $description, 'logocompact', 0,
28
        ['maxfiles' => 1, 'accepted_types' => ['.jpg', '.png']]);
29
    $setting->set_updatedcallback('theme_reset_all_caches');
30
    $temp->add($setting);
31
 
32
    // Favicon file setting.
33
    $title = get_string('favicon', 'admin');
34
    $description = get_string('favicon_desc', 'admin');
35
    $setting = new admin_setting_configstoredfile('core_admin/favicon', $title, $description, 'favicon', 0,
36
        ['maxfiles' => 1, 'accepted_types' => ['image']]);
37
    $setting->set_updatedcallback('theme_reset_all_caches');
38
    $temp->add($setting);
39
 
40
    $ADMIN->add('appearance', $temp);
41
 
42
    // Course colours section.
43
    $temp = new admin_settingpage('coursecolors', new lang_string('coursecolorsettings', 'admin'));
44
    $temp->add(new admin_setting_heading('coursecolorheading', '',
45
        new lang_string('coursecolorheading_desc', 'admin')));
46
 
47
    $basecolors = ['#81ecec', '#74b9ff', '#a29bfe', '#dfe6e9', '#00b894',
48
            '#0984e3', '#b2bec3', '#fdcb6e', '#fd79a8', '#6c5ce7'];
49
 
50
    foreach ($basecolors as $key => $color) {
51
        $number = $key + 1;
52
        $name = 'core_admin/coursecolor' . $number;
53
        $title = get_string('coursecolor', 'admin', $number);
54
        $setting = new admin_setting_configcolourpicker($name, $title, '', $color);
55
        $temp->add($setting);
56
    }
57
 
58
    $ADMIN->add('appearance', $temp);
59
 
60
    // Calendar settings.
61
    $temp = new admin_settingpage('calendar', new lang_string('calendarsettings','admin'));
62
 
63
    $temp->add(new admin_setting_configselect('calendartype', new lang_string('calendartype', 'admin'),
64
        new lang_string('calendartype_desc', 'admin'), 'gregorian', \core_calendar\type_factory::get_list_of_calendar_types()));
65
    $temp->add(new admin_setting_special_adminseesall());
66
    //this is hacky because we do not want to include the stuff from calendar/lib.php
67
    $temp->add(new admin_setting_configselect('calendar_site_timeformat', new lang_string('pref_timeformat', 'calendar'),
68
                                              new lang_string('explain_site_timeformat', 'calendar'), '0',
69
                                              array('0'        => new lang_string('default', 'calendar'),
70
                                                    '%I:%M %p' => new lang_string('timeformat_12', 'calendar'),
71
                                                    '%H:%M'    => new lang_string('timeformat_24', 'calendar'))));
72
    $temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'),
73
        new lang_string('helpstartofweek', 'admin'), get_string('firstdayofweek', 'langconfig'),
74
    array(
75
 
76
            1 => new lang_string('monday', 'calendar'),
77
            2 => new lang_string('tuesday', 'calendar'),
78
            3 => new lang_string('wednesday', 'calendar'),
79
            4 => new lang_string('thursday', 'calendar'),
80
            5 => new lang_string('friday', 'calendar'),
81
            6 => new lang_string('saturday', 'calendar')
82
        )));
83
    $temp->add(new admin_setting_special_calendar_weekend());
84
    $options = array(365 => new lang_string('numyear', '', 1),
85
            270 => new lang_string('nummonths', '', 9),
86
            180 => new lang_string('nummonths', '', 6),
87
            150 => new lang_string('nummonths', '', 5),
88
            120 => new lang_string('nummonths', '', 4),
89
            90  => new lang_string('nummonths', '', 3),
90
            60  => new lang_string('nummonths', '', 2),
91
            30  => new lang_string('nummonth', '', 1),
92
            21  => new lang_string('numweeks', '', 3),
93
            14  => new lang_string('numweeks', '', 2),
94
            7  => new lang_string('numweek', '', 1),
95
            6  => new lang_string('numdays', '', 6),
96
            5  => new lang_string('numdays', '', 5),
97
            4  => new lang_string('numdays', '', 4),
98
            3  => new lang_string('numdays', '', 3),
99
            2  => new lang_string('numdays', '', 2),
100
            1  => new lang_string('numday', '', 1));
101
    $temp->add(new admin_setting_configselect('calendar_lookahead', new lang_string('configlookahead', 'admin'), new lang_string('helpupcominglookahead', 'admin'), 21, $options));
102
    $options = array();
103
    for ($i=1; $i<=20; $i++) {
104
        $options[$i] = $i;
105
    }
106
    $temp->add(new admin_setting_configselect('calendar_maxevents',new lang_string('configmaxevents','admin'),new lang_string('helpupcomingmaxevents', 'admin'),10,$options));
107
    $temp->add(new admin_setting_configcheckbox('enablecalendarexport', new lang_string('enablecalendarexport', 'admin'), new lang_string('configenablecalendarexport','admin'), 1));
108
 
109
    // Calendar custom export settings.
110
    $days = array(365 => new lang_string('numdays', '', 365),
111
            180 => new lang_string('numdays', '', 180),
112
            150 => new lang_string('numdays', '', 150),
113
            120 => new lang_string('numdays', '', 120),
114
            90  => new lang_string('numdays', '', 90),
115
            60  => new lang_string('numdays', '', 60),
116
            30  => new lang_string('numdays', '', 30),
117
            5  => new lang_string('numdays', '', 5));
118
    $temp->add(new admin_setting_configcheckbox('calendar_customexport', new lang_string('configcalendarcustomexport', 'admin'), new lang_string('helpcalendarcustomexport','admin'), 1));
119
    $temp->add(new admin_setting_configselect('calendar_exportlookahead', new lang_string('configexportlookahead','admin'), new lang_string('helpexportlookahead', 'admin'), 365, $days));
120
    $temp->add(new admin_setting_configselect('calendar_exportlookback', new lang_string('configexportlookback','admin'), new lang_string('helpexportlookback', 'admin'), 5, $days));
121
    $temp->add(new admin_setting_configtext('calendar_exportsalt', new lang_string('calendarexportsalt','admin'), new lang_string('configcalendarexportsalt', 'admin'), random_string(60)));
122
    $temp->add(new admin_setting_configcheckbox('calendar_showicalsource', new lang_string('configshowicalsource', 'admin'), new lang_string('helpshowicalsource','admin'), 1));
123
    $ADMIN->add('appearance', $temp);
124
 
125
    // blog
126
    $temp = new admin_settingpage('blog', new lang_string('blog','blog'), 'moodle/site:config', empty($CFG->enableblogs));
127
    $temp->add(new admin_setting_configcheckbox('useblogassociations', new lang_string('useblogassociations', 'blog'), new lang_string('configuseblogassociations','blog'), 1));
128
    $temp->add(new admin_setting_bloglevel('bloglevel', new lang_string('bloglevel', 'admin'), new lang_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => new lang_string('worldblogs','blog'),
129
                                                                                                                                           BLOG_SITE_LEVEL => new lang_string('siteblogs','blog'),
130
                                                                                                                                           BLOG_USER_LEVEL => new lang_string('personalblogs','blog'))));
131
    $temp->add(new admin_setting_configcheckbox('useexternalblogs', new lang_string('useexternalblogs', 'blog'), new lang_string('configuseexternalblogs','blog'), 1));
132
    $temp->add(new admin_setting_configselect('externalblogcrontime', new lang_string('externalblogcrontime', 'blog'), new lang_string('configexternalblogcrontime', 'blog'), 86400,
133
        array(43200 => new lang_string('numhours', '', 12),
134
              86400 => new lang_string('numhours', '', 24),
135
              172800 => new lang_string('numdays', '', 2),
136
              604800 => new lang_string('numdays', '', 7))));
137
    $temp->add(new admin_setting_configtext('maxexternalblogsperuser', new lang_string('maxexternalblogsperuser','blog'), new lang_string('configmaxexternalblogsperuser', 'blog'), 1));
138
    $temp->add(new admin_setting_configcheckbox('blogusecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
139
    $temp->add(new admin_setting_configcheckbox('blogshowcommentscount', new lang_string('showcommentscount', 'admin'), new lang_string('configshowcommentscount', 'admin'), 1));
140
    $ADMIN->add('appearance', $temp);
141
 
142
    // Navigation settings
143
    $temp = new admin_settingpage('navigation', new lang_string('navigation'));
144
    $temp->add(new admin_setting_configcheckbox(
145
        'enabledashboard',
146
        new lang_string('enabledashboard', 'admin'),
147
        new lang_string('enabledashboard_help', 'admin'),
148
        1
149
    ));
150
 
151
    $choices = [HOMEPAGE_SITE => new lang_string('home')];
152
    if (!isset($CFG->enabledashboard) || $CFG->enabledashboard) {
153
        $choices[HOMEPAGE_MY] = new lang_string('mymoodle', 'admin');
154
    }
155
    $choices[HOMEPAGE_MYCOURSES] = new lang_string('mycourses', 'admin');
156
    $choices[HOMEPAGE_USER] = new lang_string('userpreference', 'admin');
1441 ariadna 157
 
158
    // Allow hook callbacks to extend options.
159
    $hook = new \core_user\hook\extend_default_homepage();
160
    \core\di::get(\core\hook\manager::class)->dispatch($hook);
161
    $choices += $hook->get_options();
162
 
1 efrain 163
    $temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'),
164
            new lang_string('configdefaulthomepage', 'admin'), get_default_home_page(), $choices));
165
    if (!isset($CFG->enabledashboard) || $CFG->enabledashboard) {
166
        $temp->add(new admin_setting_configcheckbox(
167
            'allowguestmymoodle',
168
            new lang_string('allowguestmymoodle', 'admin'),
169
            new lang_string('configallowguestmymoodle', 'admin'),
170
            1
171
        ));
172
    }
173
    $temp->add(new admin_setting_configcheckbox('navshowfullcoursenames', new lang_string('navshowfullcoursenames', 'admin'), new lang_string('navshowfullcoursenames_help', 'admin'), 0));
174
    $temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
175
    $temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0));
176
    $temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0));
177
    $sortoptions = array(
178
        'sortorder' => new lang_string('sort_sortorder', 'admin'),
179
        'fullname' => new lang_string('sort_fullname', 'admin'),
180
        'shortname' => new lang_string('sort_shortname', 'admin'),
181
        'idnumber' => new lang_string('sort_idnumber', 'admin'),
182
    );
183
    $temp->add(new admin_setting_configselect('navsortmycoursessort', new lang_string('navsortmycoursessort', 'admin'), new lang_string('navsortmycoursessort_help', 'admin'), 'sortorder', $sortoptions));
184
    $temp->add(new admin_setting_configcheckbox('navsortmycourseshiddenlast',
185
            new lang_string('navsortmycourseshiddenlast', 'admin'),
186
            new lang_string('navsortmycourseshiddenlast_help', 'admin'),
187
            1));
188
    $temp->add(new admin_setting_configtext('navcourselimit', new lang_string('navcourselimit', 'admin'),
189
        new lang_string('confignavcourselimit', 'admin'), 10, PARAM_INT));
190
    $temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
191
    $temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 1));
192
    $temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
193
    $temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
194
 
195
    $ADMIN->add('appearance', $temp);
196
 
197
    // "htmlsettings" settingpage
198
    $temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
199
    $sitenameintitleoptions = [
200
        'shortname' => new lang_string('shortname'),
201
        'fullname' => new lang_string('fullname'),
202
    ];
203
    $sitenameintitleconfig = new admin_setting_configselect(
204
        'sitenameintitle',
205
        new lang_string('sitenameintitle', 'admin'),
206
        new lang_string('sitenameintitle_help', 'admin'),
207
        'shortname',
208
        $sitenameintitleoptions
209
    );
210
    $temp->add($sitenameintitleconfig);
211
    $temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
212
    $temp->add(new admin_setting_emoticons());
213
    $ADMIN->add('appearance', $temp);
214
    $ADMIN->add('appearance', new admin_externalpage('resetemoticons', new lang_string('emoticonsreset', 'admin'),
215
        new moodle_url('/admin/resetemoticons.php'), 'moodle/site:config', true));
216
 
217
    // "documentation" settingpage
218
    $temp = new admin_settingpage('documentation', new lang_string('moodledocs'));
219
    $temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'https://docs.moodle.org', PARAM_URL));
220
    $ltemp = array('' => get_string('forceno'));
221
    $ltemp += get_string_manager()->get_list_of_translations(true);
222
    $temp->add(new admin_setting_configselect('doclang', get_string('doclang', 'admin'), get_string('configdoclang', 'admin'), '', $ltemp));
223
    $temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0));
224
    $temp->add(new admin_setting_configtext(
225
        'coursecreationguide',
226
        new lang_string('coursecreationguide', 'admin'),
227
        new lang_string('coursecreationguide_help', 'admin'),
228
        'https://moodle.academy/coursequickstart',
229
        PARAM_URL
230
    ));
231
    $ADMIN->add('appearance', $temp);
232
 
233
    if (!empty($CFG->enabledashboard)) {
234
        $temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php',
235
                'moodle/my:configsyspages');
236
        $ADMIN->add('appearance', $temp);
237
    }
238
 
239
    $temp = new admin_externalpage('profilepage', new lang_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php',
240
            'moodle/my:configsyspages');
241
    $ADMIN->add('appearance', $temp);
242
 
243
    // coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc.
244
    $temp = new admin_settingpage('coursecontact', new lang_string('courses'));
245
    $temp->add(new admin_setting_special_coursecontact());
246
    $temp->add(new admin_setting_configcheckbox('coursecontactduplicates',
247
            new lang_string('coursecontactduplicates', 'admin'),
248
            new lang_string('coursecontactduplicates_desc', 'admin'), 0));
249
    $temp->add(new admin_setting_configcheckbox('courselistshortnames',
250
            new lang_string('courselistshortnames', 'admin'),
251
            new lang_string('courselistshortnames_desc', 'admin'), 0));
252
    $temp->add(new admin_setting_configtext('coursesperpage', new lang_string('coursesperpage', 'admin'), new lang_string('configcoursesperpage', 'admin'), 20, PARAM_INT));
253
    $temp->add(new admin_setting_configtext('courseswithsummarieslimit', new lang_string('courseswithsummarieslimit', 'admin'), new lang_string('configcourseswithsummarieslimit', 'admin'), 10, PARAM_INT));
254
 
255
    $temp->add(new admin_setting_configtext('courseoverviewfileslimit', new lang_string('courseoverviewfileslimit'),
256
            new lang_string('configcourseoverviewfileslimit', 'admin'), 1, PARAM_INT));
257
    $temp->add(new admin_setting_filetypes('courseoverviewfilesext', new lang_string('courseoverviewfilesext'),
258
        new lang_string('configcourseoverviewfilesext', 'admin'), 'web_image'
259
    ));
260
 
261
    $temp->add(new admin_setting_configtext('coursegraceperiodbefore', new lang_string('coursegraceperiodbefore', 'admin'),
262
        new lang_string('configcoursegraceperiodbefore', 'admin'), 0, PARAM_INT));
263
    $temp->add(new admin_setting_configtext('coursegraceperiodafter', new lang_string('coursegraceperiodafter', 'admin'),
264
        new lang_string('configcoursegraceperiodafter', 'admin'), 0, PARAM_INT));
265
    $ADMIN->add('appearance', $temp);
266
 
267
    $temp = new admin_settingpage('ajax', new lang_string('ajaxuse'));
268
    $temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1));
269
    $setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
270
    $setting->set_updatedcallback('js_reset_all_caches');
271
    $temp->add($setting);
272
    $ADMIN->add('appearance', $temp);
273
 
274
    // Link to tag management interface.
275
    $url = new moodle_url('/tag/manage.php');
276
    $hidden = empty($CFG->usetags);
277
    $page = new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $url, 'moodle/tag:manage', $hidden);
278
    $ADMIN->add('appearance', $page);
279
 
280
    $temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin'));
281
    $temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));
282
    $temp->add(new admin_setting_configtextarea('additionalhtmlhead', new lang_string('additionalhtmlhead', 'admin'), new lang_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
283
    $temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', new lang_string('additionalhtmltopofbody', 'admin'), new lang_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
284
    $temp->add(new admin_setting_configtextarea('additionalhtmlfooter', new lang_string('additionalhtmlfooter', 'admin'), new lang_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
285
    $ADMIN->add('appearance', $temp);
286
 
287
    $setting = new admin_setting_configcheckbox('cachetemplates', new lang_string('cachetemplates', 'admin'),
288
        new lang_string('cachetemplates_help', 'admin'), 1);
289
    $setting->set_updatedcallback('template_reset_all_caches');
290
    $temp = new admin_settingpage('templates', new lang_string('templates', 'admin'));
291
    $temp->add($setting);
292
    $ADMIN->add('appearance', $temp);
293
 
294
    // Advanced theme settings page.
295
    $temp = new admin_settingpage('themesettingsadvanced', new lang_string('themesettingsadvanced', 'admin'));
296
    $setting = new admin_setting_configtext('themelist', new lang_string('themelist', 'admin'),
297
        new lang_string('configthemelist', 'admin'), '', PARAM_NOTAGS);
298
    $setting->set_force_ltr(true);
299
    $temp->add($setting);
300
    $setting = new admin_setting_configcheckbox('themedesignermode', new lang_string('themedesignermode', 'admin'),
301
        new lang_string('configthemedesignermode', 'admin'), 0);
302
    $setting->set_updatedcallback('theme_reset_all_caches');
303
    $temp->add($setting);
304
 
305
    $setting = new admin_setting_configcheckbox('allowuserthemes', new lang_string('allowuserthemes', 'admin'),
306
        new lang_string('configallowuserthemes', 'admin'), 0);
307
    $setting->set_updatedcallback('theme_purge_used_in_context_caches');
308
    $temp->add($setting);
309
 
310
    $setting = new admin_setting_configcheckbox('allowcoursethemes', new lang_string('allowcoursethemes', 'admin'),
311
        new lang_string('configallowcoursethemes', 'admin'), 0);
312
    $setting->set_updatedcallback('theme_purge_used_in_context_caches');
313
    $temp->add($setting);
314
 
315
    $setting = new admin_setting_configcheckbox('allowcategorythemes',  new lang_string('allowcategorythemes', 'admin'),
316
        new lang_string('configallowcategorythemes', 'admin'), 0);
317
    $setting->set_updatedcallback('theme_purge_used_in_context_caches');
318
    $temp->add($setting);
319
 
320
    $setting = new admin_setting_configcheckbox('allowcohortthemes',  new lang_string('allowcohortthemes', 'admin'),
321
        new lang_string('configallowcohortthemes', 'admin'), 0);
322
    $setting->set_updatedcallback('theme_purge_used_in_context_caches');
323
    $temp->add($setting);
324
 
325
    $temp->add(new admin_setting_configcheckbox('allowthemechangeonurl',  new lang_string('allowthemechangeonurl', 'admin'),
326
        new lang_string('configallowthemechangeonurl', 'admin'), 0));
327
    $temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'),
328
        new lang_string('configallowuserblockhiding', 'admin'), 1));
329
    $temp->add(new admin_setting_configcheckbox('langmenuinsecurelayout',
330
        new lang_string('langmenuinsecurelayout', 'admin'),
331
        new lang_string('langmenuinsecurelayout_desc', 'admin'), 0));
332
    $temp->add(new admin_setting_configcheckbox('logininfoinsecurelayout',
333
        new lang_string('logininfoinsecurelayout', 'admin'),
334
        new lang_string('logininfoinsecurelayout_desc', 'admin'), 0));
1441 ariadna 335
    // Process primary navigation (custom menu) through Moodle filters.
336
    $temp->add(new admin_setting_configcheckbox('navfilter',
337
        new lang_string('navfilter', 'admin'),
338
        new lang_string('navfilter_desc', 'admin'), 0));
1 efrain 339
    $temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'),
340
        new lang_string('configcustommenuitems', 'admin'), '', PARAM_RAW, '50', '10'));
341
    $defaultsettingcustomusermenuitems = [
342
        'profile,moodle|/user/profile.php',
343
        'grades,grades|/grade/report/mygrades.php',
344
        'calendar,core_calendar|/calendar/view.php?view=month',
345
        'privatefiles,moodle|/user/files.php',
346
        'reports,core_reportbuilder|/reportbuilder/index.php',
347
    ];
348
    $temp->add(new admin_setting_configtextarea(
349
        'customusermenuitems',
350
        new lang_string('customusermenuitems', 'admin'),
351
        new lang_string('configcustomusermenuitems', 'admin'),
352
        implode("\n", $defaultsettingcustomusermenuitems),
353
        PARAM_RAW,
354
        '50',
355
        '10'
356
    ));
357
    $ADMIN->add('appearance', $temp);
358
 
359
    // Theme selector page.
360
    $ADMIN->add('appearance', new admin_externalpage('themeselector',
361
        new lang_string('themeselector', 'admin'), $CFG->wwwroot . '/admin/themeselector.php'));
362
 
363
    // Settings page for each theme.
364
    foreach (core_component::get_plugin_list('theme') as $theme => $themedir) {
365
        $settingspath = "$themedir/settings.php";
366
        if (file_exists($settingspath)) {
367
            $settings = new admin_settingpage("themesetting$theme", new lang_string('pluginname', "theme_$theme"),
368
                'moodle/site:config', true
369
            );
370
            include($settingspath);
371
            // Add settings if not hidden (to avoid displaying the section if it appears empty in the UI).
372
            if ($settings && !$settings->hidden) {
373
                $ADMIN->add('themes', $settings);
374
            }
375
        }
376
    }
377
} // end of speedup