-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsettings.php
More file actions
729 lines (619 loc) · 35.6 KB
/
settings.php
File metadata and controls
729 lines (619 loc) · 35.6 KB
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
<?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/>.
/**
* Theme Boost Union Child - Settings file
*
* @package theme_learnr
* @copyright 2023 Daniel Poggenpohl <daniel.poggenpohl@fernuni-hagen.de> and Alexander Bias <bias@alexanderbias.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
if ($hassiteconfig || has_capability('theme/boost_union:configure', context_system::instance())) {
// How this file works:
// Boost Union's settings are divided into multiple settings pages which resides in its own settings category.
// You will understand it as soon as you look at /theme/boost_union/settings.php.
// This settings file here is built in a way that it adds another settings page to this existing settings
// category. You can add all child-theme-specific settings to this settings page here.
// Avoid that the theme settings page is auto-created.
$settings = null;
// Create empty settings page structure to make the site administration work on non-admin pages.
if (!$ADMIN->fulltree) {
// Create Boost Union Child settings page
// (and allow users with the theme/boost_union:configure capability to access it).
$tab = new admin_settingpage('theme_learnr',
get_string('configtitle', 'theme_learnr', null, true),
'theme/boost_union:configure');
$ADMIN->add('theme_boost_union', $tab);
}
// Create full settings page structure.
// @codingStandardsIgnoreLine
else if ($ADMIN->fulltree) {
// Require the necessary libraries.
require_once($CFG->dirroot . '/theme/boost_union/lib.php');
require_once($CFG->dirroot . '/theme/boost_union/locallib.php');
require_once($CFG->dirroot . '/theme/learnr/lib.php');
require_once($CFG->dirroot . '/theme/learnr/locallib.php');
// Prepare options array for select settings.
// Due to MDL-58376, we will use binary select settings instead of checkbox settings throughout this theme.
$yesnooption = [THEME_BOOST_UNION_SETTING_SELECT_YES => get_string('yes'),
THEME_BOOST_UNION_SETTING_SELECT_NO => get_string('no'), ];
// Create Boost Union Child settings page with tabs
// (and allow users with the theme/boost_union:configure capability to access it).
$page = new theme_boost_admin_settingspage_tabs('theme_learnr',
get_string('configtitle', 'theme_learnr', null, true),
'theme/boost_union:configure');
// Create general settings tab.
$tab = new admin_settingpage('theme_learnr_general',
get_string('generalinfo', 'theme_learnr', null, true));
// This is the descriptor for the page.
$name = 'theme_learnr/learnrinformation';
$heading = get_string('learnrinfo', 'theme_learnr');
$information = get_string('learnrinfo_desc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
// This is the descriptor for the page.
$name = 'theme_learnr/learnrsetup';
$heading = get_string('learnrsetup', 'theme_learnr');
$information = get_string('learnrsetup_desc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
// Add tab to settings page.
$page->add($tab);
/******************************************************
* YOUR SETTINGS START HERE.
*****************************************************/
// Create example tab.
$tab = new admin_settingpage('theme_learnr_features',
get_string('featurestab', 'theme_learnr', null, true));
// Create example heading.
$name = 'theme_learnr/featuresheading';
$title = get_string('featuresheading', 'theme_learnr', null, true);
$setting = new admin_setting_heading($name, $title, null);
$tab->add($setting);
// Show hide course management panel.
$name = 'theme_learnr/showcoursemanagement';
$title = get_string('showcoursemanagement', 'theme_learnr');
$description = get_string('showcoursemanagement_desc', 'theme_learnr');
$default = '1';
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Show/hide course progressbar learnr.
$name = 'theme_learnr/showprogressbar';
$title = get_string('showprogressbar', 'theme_learnr');
$description = get_string('showprogressbar_desc', 'theme_learnr');
$default = '0';
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Show hide Latest Courses learnr.
$name = 'theme_learnr/showlatestcourses';
$title = get_string('showlatestcourses', 'theme_learnr');
$description = get_string('showlatestcourses_desc', 'theme_learnr');
$default = '1';
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Show hide easy enrollment btn.
$name = 'theme_learnr/showeasyenrolbtn';
$title = get_string('showeasyenrolbtn', 'theme_learnr');
$description = get_string('showeasyenrolbtn_desc', 'theme_learnr');
$default = '0';
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Show Course Activities Grouping Menu
$name = 'theme_learnr/showcourseactivities';
$title = get_string('showcourseactivities', 'theme_learnr');
$description = get_string('showcourseactivities_desc', 'theme_learnr');
$default = '0';
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Add tab to settings page.
$page->add($tab);
// Begin DBN Update.
// Create static pages tab.
$tab = new admin_settingpage('theme_learnr_content_iconnavbar',
get_string('iconnavbartab', 'theme_learnr', null, true));
// This is the descriptor for the page.
$name = 'theme_learnr/iconnavinfo';
$heading = get_string('iconnavinfo', 'theme_learnr');
$information = get_string('iconnavinfo_desc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
// This is the descriptor for teacher create a course
$name = 'theme_learnr/createinfo';
$heading = get_string('createinfo', 'theme_learnr');
$information = get_string('createinfodesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
// Creator Icon
$name = 'theme_learnr/createicon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = 'edit';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/createbuttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = get_string('naviconbuttoncreatetextdefault', 'theme_learnr');
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/createbuttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = $CFG->wwwroot.'/course/edit.php?category=1';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for teacher create a course
$name = 'theme_learnr/sliderinfo';
$heading = get_string('sliderinfo', 'theme_learnr');
$information = get_string('sliderinfodesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
// Creator Icon
$name = 'theme_learnr/slideicon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('naviconslidedesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/slideiconbuttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Slide Textbox.
$name = 'theme_learnr/slidetextbox';
$title = get_string('slidetextbox', 'theme_learnr');
$description = get_string('slidetextbox_desc', 'theme_learnr');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for icon One
$name = 'theme_learnr/navicon1info';
$heading = get_string('navicon1', 'theme_learnr');
$information = get_string('navicondesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
// icon One
$name = 'theme_learnr/nav1icon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav1buttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav1buttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav1target';
$title = get_string('marketingurltarget' , 'theme_learnr');
$description = get_string('marketingurltargetdesc', 'theme_learnr');
$target1 = get_string('marketingurltargetself', 'theme_learnr');
$target2 = get_string('marketingurltargetnew', 'theme_learnr');
$target3 = get_string('marketingurltargetparent', 'theme_learnr');
$default = 'target1';
$choices = array('_self'=>$target1, '_blank'=>$target2, '_parent'=>$target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for icon One
$name = 'theme_learnr/navicon2info';
$heading = get_string('navicon2', 'theme_learnr');
$information = get_string('navicondesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
$name = 'theme_learnr/nav2icon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav2buttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav2buttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav2target';
$title = get_string('marketingurltarget' , 'theme_learnr');
$description = get_string('marketingurltargetdesc', 'theme_learnr');
$target1 = get_string('marketingurltargetself', 'theme_learnr');
$target2 = get_string('marketingurltargetnew', 'theme_learnr');
$target3 = get_string('marketingurltargetparent', 'theme_learnr');
$default = 'target1';
$choices = array('_self'=>$target1, '_blank'=>$target2, '_parent'=>$target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for icon three
$name = 'theme_learnr/navicon3info';
$heading = get_string('navicon3', 'theme_learnr');
$information = get_string('navicondesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
$name = 'theme_learnr/nav3icon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav3buttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav3buttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav3target';
$title = get_string('marketingurltarget' , 'theme_learnr');
$description = get_string('marketingurltargetdesc', 'theme_learnr');
$target1 = get_string('marketingurltargetself', 'theme_learnr');
$target2 = get_string('marketingurltargetnew', 'theme_learnr');
$target3 = get_string('marketingurltargetparent', 'theme_learnr');
$default = 'target1';
$choices = array('_self'=>$target1, '_blank'=>$target2, '_parent'=>$target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for icon four
$name = 'theme_learnr/navicon4info';
$heading = get_string('navicon4', 'theme_learnr');
$information = get_string('navicondesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
$name = 'theme_learnr/nav4icon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav4buttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav4buttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav4target';
$title = get_string('marketingurltarget' , 'theme_learnr');
$description = get_string('marketingurltargetdesc', 'theme_learnr');
$target1 = get_string('marketingurltargetself', 'theme_learnr');
$target2 = get_string('marketingurltargetnew', 'theme_learnr');
$target3 = get_string('marketingurltargetparent', 'theme_learnr');
$default = 'target1';
$choices = array('_self'=>$target1, '_blank'=>$target2, '_parent'=>$target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for icon four
$name = 'theme_learnr/navicon5info';
$heading = get_string('navicon5', 'theme_learnr');
$information = get_string('navicondesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
$name = 'theme_learnr/nav5icon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav5buttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav5buttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav5target';
$title = get_string('marketingurltarget' , 'theme_learnr');
$description = get_string('marketingurltargetdesc', 'theme_learnr');
$target1 = get_string('marketingurltargetself', 'theme_learnr');
$target2 = get_string('marketingurltargetnew', 'theme_learnr');
$target3 = get_string('marketingurltargetparent', 'theme_learnr');
$default = 'target1';
$choices = array('_self'=>$target1, '_blank'=>$target2, '_parent'=>$target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for icon six
$name = 'theme_learnr/navicon6info';
$heading = get_string('navicon6', 'theme_learnr');
$information = get_string('navicondesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
$name = 'theme_learnr/nav6icon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav6buttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav6buttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav6target';
$title = get_string('marketingurltarget' , 'theme_learnr');
$description = get_string('marketingurltargetdesc', 'theme_learnr');
$target1 = get_string('marketingurltargetself', 'theme_learnr');
$target2 = get_string('marketingurltargetnew', 'theme_learnr');
$target3 = get_string('marketingurltargetparent', 'theme_learnr');
$default = 'target1';
$choices = array('_self'=>$target1, '_blank'=>$target2, '_parent'=>$target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for icon seven
$name = 'theme_learnr/navicon7info';
$heading = get_string('navicon7', 'theme_learnr');
$information = get_string('navicondesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
$name = 'theme_learnr/nav7icon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav7buttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav7buttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav7target';
$title = get_string('marketingurltarget' , 'theme_learnr');
$description = get_string('marketingurltargetdesc', 'theme_learnr');
$target1 = get_string('marketingurltargetself', 'theme_learnr');
$target2 = get_string('marketingurltargetnew', 'theme_learnr');
$target3 = get_string('marketingurltargetparent', 'theme_learnr');
$default = 'target1';
$choices = array('_self'=>$target1, '_blank'=>$target2, '_parent'=>$target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// This is the descriptor for icon eight
$name = 'theme_learnr/navicon8info';
$heading = get_string('navicon8', 'theme_learnr');
$information = get_string('navicondesc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
$name = 'theme_learnr/nav8icon';
$title = get_string('navicon', 'theme_learnr');
$description = get_string('navicondesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav8buttontext';
$title = get_string('naviconbuttontext', 'theme_learnr');
$description = get_string('naviconbuttontextdesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav8buttonurl';
$title = get_string('naviconbuttonurl', 'theme_learnr');
$description = get_string('naviconbuttonurldesc', 'theme_learnr');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/nav8target';
$title = get_string('marketingurltarget' , 'theme_learnr');
$description = get_string('marketingurltargetdesc', 'theme_learnr');
$target1 = get_string('marketingurltargetself', 'theme_learnr');
$target2 = get_string('marketingurltargetnew', 'theme_learnr');
$target3 = get_string('marketingurltargetparent', 'theme_learnr');
$default = 'target1';
$choices = array('_self'=>$target1, '_blank'=>$target2, '_parent'=>$target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Add tab to settings page.
$page->add($tab);
// End DBN Update.
// Create static pages tab.
$tab = new admin_settingpage('theme_learnr_content_stylingtab',
get_string('stylingtab', 'theme_learnr', null, true));
// This is the descriptor for the page.
$name = 'theme_learnr/stylinginfo';
$heading = get_string('stylinginfo', 'theme_learnr');
$information = get_string('stylinginfo_desc', 'theme_learnr');
$setting = new admin_setting_heading($name, $heading, $information);
$tab->add($setting);
//Begin DBN Update
// Sections Display Options.
$name = 'theme_learnr/layoutstyle';
$title = get_string('layoutstyle' , 'theme_learnr');
$description = get_string('sectionstyle_desc', 'theme_learnr');
$option1 = get_string('layoutstyle-learnr', 'theme_learnr');
//$option2 = get_string('layoutstyle-boxed', 'theme_learnr');
$option3 = get_string('layoutstyle-boost', 'theme_learnr');
//$option4 = get_string('layoutstyle-bars', 'theme_learnr');
$default = '1';
$choices = array('1'=>$option1, '3'=>$option3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Sections Display Options.
$name = 'theme_learnr/sectionstyle';
$title = get_string('sectionstyle' , 'theme_learnr');
$description = get_string('sectionstyle_desc', 'theme_learnr');
$option1 = get_string('sections-learnr', 'theme_learnr');
$option2 = get_string('sections-boxed', 'theme_learnr');
$option3 = get_string('sections-boost', 'theme_learnr');
$option4 = get_string('sections-bars', 'theme_learnr');
$default = '1';
$choices = array('1'=>$option1, '2'=>$option2, '3'=>$option3, '4'=>$option4);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// secondary Navigation Display Options.
$name = 'theme_learnr/secondarymenuposition';
$title = get_string('secondarymenuposition' , 'theme_learnr');
$description = get_string('secondarymenuposition_desc', 'theme_learnr');
$option1 = get_string('secondarymenuposition_below', 'theme_learnr');
$option2 = get_string('secondarymenuposition_above', 'theme_learnr');
$default = '1';
$choices = array('1'=>$option1, '2'=>$option2);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/pagenavbuttonsbg';
$title = get_string('pagenavbuttonsbg', 'theme_learnr');
$description = get_string('pagenavbuttonsbg_desc', 'theme_learnr');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/drawerbg';
$title = get_string('drawerbg', 'theme_learnr');
$description = get_string('drawerbg_desc', 'theme_learnr');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/bodybg';
$title = get_string('bodybg', 'theme_learnr');
$description = get_string('bodybg_desc', 'theme_learnr');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/bgwhite';
$title = get_string('bgwhite', 'theme_learnr');
$description = get_string('bgwhite_desc', 'theme_learnr');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$name = 'theme_learnr/bgdark';
$title = get_string('bgdark', 'theme_learnr');
$description = get_string('bgdark_desc', 'theme_learnr');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// End DBN Update
// Create inheritance heading.
$name = 'theme_learnr/inheritanceheading';
$title = get_string('inheritanceheading', 'theme_learnr', null, true);
$setting = new admin_setting_heading($name, $title, null);
$tab->add($setting);
// Prepare inheritance options.
$inheritanceoptions = [
THEME_LEARNR_SETTING_INHERITANCE_INHERIT =>
get_string('inheritanceinherit', 'theme_learnr'),
THEME_LEARNR_SETTING_INHERITANCE_DUPLICATE =>
get_string('inheritanceduplicate', 'theme_learnr'),
];
// Setting: Pre SCSS inheritance setting.
$name = 'theme_learnr/prescssinheritance';
$title = get_string('prescssinheritancesetting', 'theme_learnr', null, true);
$description = get_string('prescssinheritancesetting_desc', 'theme_learnr', null, true).'<br />'.
get_string('inheritanceoptionsexplanation', 'theme_learnr', null, true);
$setting = new admin_setting_configselect($name, $title, $description,
THEME_LEARNR_SETTING_INHERITANCE_INHERIT, $inheritanceoptions);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
// Setting: Extra SCSS inheritance setting.
$name = 'theme_learnr/extrascssinheritance';
$title = get_string('extrascssinheritancesetting', 'theme_learnr', null, true);
$description = get_string('extrascssinheritancesetting_desc', 'theme_learnr', null, true).'<br />'.
get_string('inheritanceoptionsexplanation', 'theme_learnr', null, true);
$setting = new admin_setting_configselect($name, $title, $description,
THEME_LEARNR_SETTING_INHERITANCE_INHERIT, $inheritanceoptions);
$setting->set_updatedcallback('theme_reset_all_caches');
$tab->add($setting);
$page->add($tab);
// End DBN Update.
/******************************************************
* YOUR SETTINGS END HERE.
*****************************************************/
// Add settings page to the admin settings category.
$ADMIN->add('theme_boost_union', $page);
}
}