forked from gjb2048/moodle-theme_essential
-
Notifications
You must be signed in to change notification settings - Fork 2
/
settings.php
1667 lines (1500 loc) · 71.6 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
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
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?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/>.
/**
* This is built using the Clean template to allow for new theme's using
* Moodle's new Bootstrap theme engine
*
*
* @package theme_essential
* @copyright 2013 Julian Ridden
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$settings = null;
defined('MOODLE_INTERNAL') || die;
$ADMIN->add('themes', new admin_category('theme_essential', 'Essential'));
// "geneicsettings" settingpage
$temp = new admin_settingpage('theme_essential_generic', get_string('geneicsettings', 'theme_essential'));
// Default Site icon setting.
$name = 'theme_essential/siteicon';
$title = get_string('siteicon', 'theme_essential');
$description = get_string('siteicondesc', 'theme_essential');
$default = 'laptop';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$temp->add($setting);
// Include Awesome Font from Bootstrapcdn
$name = 'theme_essential/bootstrapcdn';
$title = get_string('bootstrapcdn', 'theme_essential');
$description = get_string('bootstrapcdndesc', 'theme_essential');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Logo file setting.
$name = 'theme_essential/logo';
$title = get_string('logo', 'theme_essential');
$description = get_string('logodesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'logo');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Font Selector.
$name = 'theme_essential/fontselect';
$title = get_string('fontselect' , 'theme_essential');
$description = get_string('fontselectdesc', 'theme_essential');
$default = '1';
$choices = array(
'1'=>'Oswald & PT Sans',
'2'=>'Lobster & Cabin',
'3'=>'Raleway & Goudy',
'4'=>'Allerta & Crimson Text',
'5'=>'Arvo & PT Sans',
'6'=>'Dancing Script & Josefin Sans',
'7'=>'Allan & Cardo',
'8'=>'Molengo & Lekton',
'9'=>'Droid Serif & Droid Sans',
'10'=>'Corbin & Nobile',
'11'=>'Ubuntu & Vollkorn',
'12'=>'Bree Serif & Open Sans',
'13'=>'Bevan & Pontano Sans',
'14'=>'Abril Fatface & Average',
'15'=>'Playfair Display and Muli',
'16'=>'Sansita One & Kameron',
'17'=>'Istok Web & Lora',
'18'=>'Pacifico & Arimo',
'19'=>'Nixie One & Ledger',
'20'=>'Cantata One & Imprima',
'21'=>'Rancho & Gudea',
'22'=>'DISABLE Google Fonts');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// User picture in header setting.
$name = 'theme_essential/headerprofilepic';
$title = get_string('headerprofilepic', 'theme_essential');
$description = get_string('headerprofilepicdesc', 'theme_essential');
$default = true;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Fixed or Variable Width.
$name = 'theme_essential/pagewidth';
$title = get_string('pagewidth', 'theme_essential');
$description = get_string('pagewidthdesc', 'theme_essential');
$default = 1200;
$choices = array(1900=>get_string('fixedwidthwide','theme_essential'), 1200=>get_string('fixedwidthnarrow','theme_essential'), 100=>get_string('variablewidth','theme_essential'));
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Custom or standard layout.
$name = 'theme_essential/layout';
$title = get_string('layout', 'theme_essential');
$description = get_string('layoutdesc', 'theme_essential');
$default = false;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Use max width for side regions.
$name = 'theme_essential/sideregionsmaxwidth';
$title = get_string('sideregionsmaxwidth', 'theme_essential');
$description = get_string('sideregionsmaxwidthdesc', 'theme_essential');
$default = false;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
//Include the Editicons css rules
$name = 'theme_essential/editicons';
$title = get_string('editicons', 'theme_essential');
$description = get_string('editiconsdesc', 'theme_essential');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$temp->add($setting);
// Performance Information Display.
$name = 'theme_essential/perfinfo';
$title = get_string('perfinfo' , 'theme_essential');
$description = get_string('perfinfodesc', 'theme_essential');
$perf_max = get_string('perf_max', 'theme_essential');
$perf_min = get_string('perf_min', 'theme_essential');
$default = 'min';
$choices = array('min'=>$perf_min, 'max'=>$perf_max);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Navbar Seperator.
$name = 'theme_essential/navbarsep';
$title = get_string('navbarsep' , 'theme_essential');
$description = get_string('navbarsepdesc', 'theme_essential');
$nav_thinbracket = get_string('nav_thinbracket', 'theme_essential');
$nav_doublebracket = get_string('nav_doublebracket', 'theme_essential');
$nav_thickbracket = get_string('nav_thickbracket', 'theme_essential');
$nav_slash = get_string('nav_slash', 'theme_essential');
$nav_pipe = get_string('nav_pipe', 'theme_essential');
$dontdisplay = get_string('dontdisplay', 'theme_essential');
$default = '/';
$choices = array('/'=>$nav_slash, '\f105'=>$nav_thinbracket, '\f101'=>$nav_doublebracket, '\f054'=>$nav_thickbracket, '|'=>$nav_pipe);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Copyright setting.
$name = 'theme_essential/copyright';
$title = get_string('copyright', 'theme_essential');
$description = get_string('copyrightdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$temp->add($setting);
// Footnote setting.
$name = 'theme_essential/footnote';
$title = get_string('footnote', 'theme_essential');
$description = get_string('footnotedesc', 'theme_essential');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Custom CSS file.
$name = 'theme_essential/customcss';
$title = get_string('customcss', 'theme_essential');
$description = get_string('customcssdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$ADMIN->add('theme_essential', $temp);
/* Custom Menu Settings */
$temp = new admin_settingpage('theme_essential_custommenu', get_string('custommenuheading', 'theme_essential'));
//This is the descriptor for the following Moodle color settings
$name = 'theme_essential/mydashboardinfo';
$heading = get_string('mydashboardinfo', 'theme_essential');
$information = get_string('mydashboardinfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
// Toggle dashboard display in custommenu.
$name = 'theme_essential/displaymydashboard';
$title = get_string('displaymydashboard', 'theme_essential');
$description = get_string('displaymydashboarddesc', 'theme_essential');
$default = true;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
//This is the descriptor for the following Moodle color settings
$name = 'theme_essential/mycoursesinfo';
$heading = get_string('mycoursesinfo', 'theme_essential');
$information = get_string('mycoursesinfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
// Toggle courses display in custommenu.
$name = 'theme_essential/displaymycourses';
$title = get_string('displaymycourses', 'theme_essential');
$description = get_string('displaymycoursesdesc', 'theme_essential');
$default = true;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Set terminology for dropdown course list
$name = 'theme_essential/mycoursetitle';
$title = get_string('mycoursetitle','theme_essential');
$description = get_string('mycoursetitledesc', 'theme_essential');
$default = 'course';
$choices = array(
'course' => get_string('mycourses', 'theme_essential'),
'unit' => get_string('myunits', 'theme_essential'),
'class' => get_string('myclasses', 'theme_essential'),
'module' => get_string('mymodules', 'theme_essential')
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$ADMIN->add('theme_essential', $temp);
/* Color Settings */
$temp = new admin_settingpage('theme_essential_color', get_string('colorheading', 'theme_essential'));
$temp->add(new admin_setting_heading('theme_essential_color', get_string('colorheadingsub', 'theme_essential'),
format_text(get_string('colordesc' , 'theme_essential'), FORMAT_MARKDOWN)));
// Background Image.
$name = 'theme_essential/pagebackground';
$title = get_string('pagebackground', 'theme_essential');
$description = get_string('pagebackgrounddesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'pagebackground');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Main theme colour setting.
$name = 'theme_essential/themecolor';
$title = get_string('themecolor', 'theme_essential');
$description = get_string('themecolordesc', 'theme_essential');
$default = '#30add1';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Main theme Hover colour setting.
$name = 'theme_essential/themehovercolor';
$title = get_string('themehovercolor', 'theme_essential');
$description = get_string('themehovercolordesc', 'theme_essential');
$default = '#29a1c4';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
//This is the descriptor for the Slideshow
$name = 'theme_essential/slidecolorinfo';
$heading = get_string('slidecolors', 'theme_essential');
$information = get_string('slidecolorsdesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
// Slide Header colour setting.
$name = 'theme_essential/slideheadercolor';
$title = get_string('slideheadercolor', 'theme_essential');
$description = get_string('slideheadercolordesc', 'theme_essential');
$default = '#30add1';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Slide Text colour setting.
$name = 'theme_essential/slidecolor';
$title = get_string('slidecolor', 'theme_essential');
$description = get_string('slidecolordesc', 'theme_essential');
$default = '#888';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Slide Button colour setting.
$name = 'theme_essential/slidebuttoncolor';
$title = get_string('slidebuttoncolor', 'theme_essential');
$description = get_string('slidebuttoncolordesc', 'theme_essential');
$default = '#30add1';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
//This is the descriptor for the Slideshow
$name = 'theme_essential/footercolorinfo';
$heading = get_string('footercolors', 'theme_essential');
$information = get_string('footercolorsdesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
// Footer background colour setting.
$name = 'theme_essential/footercolor';
$title = get_string('footercolor', 'theme_essential');
$description = get_string('footercolordesc', 'theme_essential');
$default = '#000000';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Footer text colour setting.
$name = 'theme_essential/footertextcolor';
$title = get_string('footertextcolor', 'theme_essential');
$description = get_string('footertextcolordesc', 'theme_essential');
$default = '#DDDDDD';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Footer Block Heading colour setting.
$name = 'theme_essential/footerheadingcolor';
$title = get_string('footerheadingcolor', 'theme_essential');
$description = get_string('footerheadingcolordesc', 'theme_essential');
$default = '#CCCCCC';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Footer Seperator colour setting.
$name = 'theme_essential/footersepcolor';
$title = get_string('footersepcolor', 'theme_essential');
$description = get_string('footersepcolordesc', 'theme_essential');
$default = '#313131';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Footer URL colour setting.
$name = 'theme_essential/footerurlcolor';
$title = get_string('footerurlcolor', 'theme_essential');
$description = get_string('footerurlcolordesc', 'theme_essential');
$default = '#BBBBBB';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Footer URL hover colour setting.
$name = 'theme_essential/footerhovercolor';
$title = get_string('footerhovercolor', 'theme_essential');
$description = get_string('footerhovercolordesc', 'theme_essential');
$default = '#FFFFFF';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// This is the descriptor for the user theme colors.
$name = 'theme_essential/alternativethemecolorsinfo';
$heading = get_string('alternativethemecolors', 'theme_essential');
$information = get_string('alternativethemecolorsdesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
$defaultalternativethemecolors = array('#a430d1', '#d15430', '#5dd130');
$defaultalternativethemehovercolors = array('#9929c4', '#c44c29', '#53c429');
foreach (range(1, 3) as $alternativethemenumber) {
// Enables the user to select an alternative colors choice.
$name = 'theme_essential/enablealternativethemecolors' . $alternativethemenumber;
$title = get_string('enablealternativethemecolors', 'theme_essential', $alternativethemenumber);
$description = get_string('enablealternativethemecolorsdesc', 'theme_essential', $alternativethemenumber);
$default = false;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// User theme colour name.
$name = 'theme_essential/alternativethemename' . $alternativethemenumber;
$title = get_string('alternativethemename', 'theme_essential', $alternativethemenumber);
$description = get_string('alternativethemenamedesc', 'theme_essential', $alternativethemenumber);
$default = get_string('alternativecolors', 'theme_essential', $alternativethemenumber);
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// User theme colour setting.
$name = 'theme_essential/alternativethemecolor' . $alternativethemenumber;
$title = get_string('alternativethemecolor', 'theme_essential', $alternativethemenumber);
$description = get_string('alternativethemecolordesc', 'theme_essential', $alternativethemenumber);
$default = $defaultalternativethemecolors[$alternativethemenumber - 1];
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// User theme hover colour setting.
$name = 'theme_essential/alternativethemehovercolor' . $alternativethemenumber;
$title = get_string('alternativethemehovercolor', 'theme_essential', $alternativethemenumber);
$description = get_string('alternativethemehovercolordesc', 'theme_essential', $alternativethemenumber);
$default = $defaultalternativethemehovercolors[$alternativethemenumber - 1];
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
}
$ADMIN->add('theme_essential', $temp);
/* Slideshow Widget Settings */
$temp = new admin_settingpage('theme_essential_slideshow', get_string('slideshowheading', 'theme_essential'));
$temp->add(new admin_setting_heading('theme_essential_slideshow', get_string('slideshowheadingsub', 'theme_essential'),
format_text(get_string('slideshowdesc' , 'theme_essential'), FORMAT_MARKDOWN)));
// Toggle Slideshow.
$name = 'theme_essential/toggleslideshow';
$title = get_string('toggleslideshow' , 'theme_essential');
$description = get_string('toggleslideshowdesc', 'theme_essential');
$alwaysdisplay = get_string('alwaysdisplay', 'theme_essential');
$displaybeforelogin = get_string('displaybeforelogin', 'theme_essential');
$displayafterlogin = get_string('displayafterlogin', 'theme_essential');
$dontdisplay = get_string('dontdisplay', 'theme_essential');
$default = 'alwaysdisplay';
$choices = array('1'=>$alwaysdisplay, '2'=>$displaybeforelogin, '3'=>$displayafterlogin, '0'=>$dontdisplay);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Hide slideshow on phones.
$name = 'theme_essential/hideonphone';
$title = get_string('hideonphone' , 'theme_essential');
$description = get_string('hideonphonedesc', 'theme_essential');
$display = get_string('alwaysdisplay', 'theme_essential');
$dontdisplay = get_string('dontdisplay', 'theme_essential');
$default = 'display';
$choices = array(''=>$display, 'hidden-phone'=>$dontdisplay);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Slideshow Design Picker.
$name = 'theme_essential/slideshowvariant';
$title = get_string('slideshowvariant' , 'theme_essential');
$description = get_string('slideshowvariantdesc', 'theme_essential');
$slideshow1 = get_string('slideshow1', 'theme_essential');
$slideshow2 = get_string('slideshow2', 'theme_essential');
$default = 'slideshow1';
$choices = array('1'=>$slideshow1, '2'=>$slideshow2);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
/*
* Slide 1
*/
//This is the descriptor for Slide One
$name = 'theme_essential/slide1info';
$heading = get_string('slide1', 'theme_essential');
$information = get_string('slideinfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
// Title.
$name = 'theme_essential/slide1';
$title = get_string('slidetitle', 'theme_essential');
$description = get_string('slidetitledesc', 'theme_essential');
$setting = new admin_setting_configtext($name, $title, $description, '');
$default = '';
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Image.
$name = 'theme_essential/slide1image';
$title = get_string('slideimage', 'theme_essential');
$description = get_string('slideimagedesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'slide1image');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Caption.
$name = 'theme_essential/slide1caption';
$title = get_string('slidecaption', 'theme_essential');
$description = get_string('slidecaptiondesc', 'theme_essential');
$setting = new admin_setting_configtextarea($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// URL.
$name = 'theme_essential/slide1url';
$title = get_string('slideurl', 'theme_essential');
$description = get_string('slideurldesc', 'theme_essential');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
/*
* Slide 2
*/
//This is the descriptor for Slide Two
$name = 'theme_essential/slide2info';
$heading = get_string('slide2', 'theme_essential');
$information = get_string('slideinfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
// Title.
$name = 'theme_essential/slide2';
$title = get_string('slidetitle', 'theme_essential');
$description = get_string('slidetitledesc', 'theme_essential');
$setting = new admin_setting_configtext($name, $title, $description, '');
$default = '';
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Image.
$name = 'theme_essential/slide2image';
$title = get_string('slideimage', 'theme_essential');
$description = get_string('slideimagedesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'slide2image');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Caption.
$name = 'theme_essential/slide2caption';
$title = get_string('slidecaption', 'theme_essential');
$description = get_string('slidecaptiondesc', 'theme_essential');
$setting = new admin_setting_configtextarea($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// URL.
$name = 'theme_essential/slide2url';
$title = get_string('slideurl', 'theme_essential');
$description = get_string('slideurldesc', 'theme_essential');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
/*
* Slide 3
*/
//This is the descriptor for Slide Three
$name = 'theme_essential/slide3info';
$heading = get_string('slide3', 'theme_essential');
$information = get_string('slideinfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
// Title.
$name = 'theme_essential/slide3';
$title = get_string('slidetitle', 'theme_essential');
$description = get_string('slidetitledesc', 'theme_essential');
$setting = new admin_setting_configtext($name, $title, $description, '');
$default = '';
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Image.
$name = 'theme_essential/slide3image';
$title = get_string('slideimage', 'theme_essential');
$description = get_string('slideimagedesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'slide3image');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Caption.
$name = 'theme_essential/slide3caption';
$title = get_string('slidecaption', 'theme_essential');
$description = get_string('slidecaptiondesc', 'theme_essential');
$setting = new admin_setting_configtextarea($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// URL.
$name = 'theme_essential/slide3url';
$title = get_string('slideurl', 'theme_essential');
$description = get_string('slideurldesc', 'theme_essential');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
/*
* Slide 4
*/
//This is the descriptor for Slide Four
$name = 'theme_essential/slide4info';
$heading = get_string('slide4', 'theme_essential');
$information = get_string('slideinfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
// Title.
$name = 'theme_essential/slide4';
$title = get_string('slidetitle', 'theme_essential');
$description = get_string('slidetitledesc', 'theme_essential');
$setting = new admin_setting_configtext($name, $title, $description, '');
$default = '';
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Image.
$name = 'theme_essential/slide4image';
$title = get_string('slideimage', 'theme_essential');
$description = get_string('slideimagedesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'slide4image');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Caption.
$name = 'theme_essential/slide4caption';
$title = get_string('slidecaption', 'theme_essential');
$description = get_string('slidecaptiondesc', 'theme_essential');
$setting = new admin_setting_configtextarea($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// URL.
$name = 'theme_essential/slide4url';
$title = get_string('slideurl', 'theme_essential');
$description = get_string('slideurldesc', 'theme_essential');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$ADMIN->add('theme_essential', $temp);
$temp = new admin_settingpage('theme_essential_frontcontent', get_string('frontcontentheading', 'theme_essential'));
$temp->add(new admin_setting_heading('theme_essential_frontcontent', get_string('frontcontentheadingsub', 'theme_essential'),
format_text(get_string('frontcontentdesc' , 'theme_essential'), FORMAT_MARKDOWN)));
// Enable Frontpage Content
$name = 'theme_essential/usefrontcontent';
$title = get_string('usefrontcontent', 'theme_essential');
$description = get_string('usefrontcontentdesc', 'theme_essential');
$default = false;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Frontpage Content
$name = 'theme_essential/frontcontentarea';
$title = get_string('frontcontentarea', 'theme_essential');
$description = get_string('frontcontentareadesc', 'theme_essential');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Frontpage Block alignment.
$name = 'theme_essential/frontpageblocks';
$title = get_string('frontpageblocks' , 'theme_essential');
$description = get_string('frontpageblocksdesc', 'theme_essential');
$left = get_string('left', 'theme_essential');
$right = get_string('right', 'theme_essential');
$default = 'left';
$choices = array('1'=>$left, '0'=>$right);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Toggle Frontpage Middle Blocks
$name = 'theme_essential/frontpagemiddleblocks';
$title = get_string('frontpagemiddleblocks' , 'theme_essential');
$description = get_string('frontpagemiddleblocksdesc', 'theme_essential');
$alwaysdisplay = get_string('alwaysdisplay', 'theme_essential');
$displaybeforelogin = get_string('displaybeforelogin', 'theme_essential');
$displayafterlogin = get_string('displayafterlogin', 'theme_essential');
$dontdisplay = get_string('dontdisplay', 'theme_essential');
$default = 'display';
$choices = array('1'=>$alwaysdisplay, '2'=>$displaybeforelogin, '3'=>$displayafterlogin, '0'=>$dontdisplay);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$ADMIN->add('theme_essential', $temp);
/* Marketing Spot Settings */
$temp = new admin_settingpage('theme_essential_marketing', get_string('marketingheading', 'theme_essential'));
$temp->add(new admin_setting_heading('theme_essential_marketing', get_string('marketingheadingsub', 'theme_essential'),
format_text(get_string('marketingdesc' , 'theme_essential'), FORMAT_MARKDOWN)));
// Toggle Marketing Spots.
$name = 'theme_essential/togglemarketing';
$title = get_string('togglemarketing' , 'theme_essential');
$description = get_string('togglemarketingdesc', 'theme_essential');
$alwaysdisplay = get_string('alwaysdisplay', 'theme_essential');
$displaybeforelogin = get_string('displaybeforelogin', 'theme_essential');
$displayafterlogin = get_string('displayafterlogin', 'theme_essential');
$dontdisplay = get_string('dontdisplay', 'theme_essential');
$default = 'display';
$choices = array('1'=>$alwaysdisplay, '2'=>$displaybeforelogin, '3'=>$displayafterlogin, '0'=>$dontdisplay);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Marketing Spot Image Height
$name = 'theme_essential/marketingheight';
$title = get_string('marketingheight','theme_essential');
$description = get_string('marketingheightdesc', 'theme_essential');
$default = 100;
$choices = array(50, 100, 150, 200, 250, 300);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$temp->add($setting);
//This is the descriptor for Marketing Spot One
$name = 'theme_essential/marketing1info';
$heading = get_string('marketing1', 'theme_essential');
$information = get_string('marketinginfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
//Marketing Spot One.
$name = 'theme_essential/marketing1';
$title = get_string('marketingtitle', 'theme_essential');
$description = get_string('marketingtitledesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing1icon';
$title = get_string('marketingicon', 'theme_essential');
$description = get_string('marketingicondesc', 'theme_essential');
$default = 'star';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing1image';
$title = get_string('marketingimage', 'theme_essential');
$description = get_string('marketingimagedesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'marketing1image');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing1content';
$title = get_string('marketingcontent', 'theme_essential');
$description = get_string('marketingcontentdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing1buttontext';
$title = get_string('marketingbuttontext', 'theme_essential');
$description = get_string('marketingbuttontextdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing1buttonurl';
$title = get_string('marketingbuttonurl', 'theme_essential');
$description = get_string('marketingbuttonurldesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
//This is the descriptor for Marketing Spot Two
$name = 'theme_essential/marketing2info';
$heading = get_string('marketing2', 'theme_essential');
$information = get_string('marketinginfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
//Marketing Spot Two.
$name = 'theme_essential/marketing2';
$title = get_string('marketingtitle', 'theme_essential');
$description = get_string('marketingtitledesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing2icon';
$title = get_string('marketingicon', 'theme_essential');
$description = get_string('marketingicondesc', 'theme_essential');
$default = 'star';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing2image';
$title = get_string('marketingimage', 'theme_essential');
$description = get_string('marketingimagedesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'marketing2image');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing2content';
$title = get_string('marketingcontent', 'theme_essential');
$description = get_string('marketingcontentdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing2buttontext';
$title = get_string('marketingbuttontext', 'theme_essential');
$description = get_string('marketingbuttontextdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing2buttonurl';
$title = get_string('marketingbuttonurl', 'theme_essential');
$description = get_string('marketingbuttonurldesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
//This is the descriptor for Marketing Spot Three
$name = 'theme_essential/marketing3info';
$heading = get_string('marketing3', 'theme_essential');
$information = get_string('marketinginfodesc', 'theme_essential');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
//Marketing Spot Three.
$name = 'theme_essential/marketing3';
$title = get_string('marketingtitle', 'theme_essential');
$description = get_string('marketingtitledesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing3icon';
$title = get_string('marketingicon', 'theme_essential');
$description = get_string('marketingicondesc', 'theme_essential');
$default = 'star';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing3image';
$title = get_string('marketingimage', 'theme_essential');
$description = get_string('marketingimagedesc', 'theme_essential');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'marketing3image');
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing3content';
$title = get_string('marketingcontent', 'theme_essential');
$description = get_string('marketingcontentdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing3buttontext';
$title = get_string('marketingbuttontext', 'theme_essential');
$description = get_string('marketingbuttontextdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_essential/marketing3buttonurl';
$title = get_string('marketingbuttonurl', 'theme_essential');
$description = get_string('marketingbuttonurldesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$ADMIN->add('theme_essential', $temp);
/* Social Network Settings */
$temp = new admin_settingpage('theme_essential_social', get_string('socialheading', 'theme_essential'));
$temp->add(new admin_setting_heading('theme_essential_social', get_string('socialheadingsub', 'theme_essential'),
format_text(get_string('socialdesc' , 'theme_essential'), FORMAT_MARKDOWN)));
// Website url setting.
$name = 'theme_essential/website';
$title = get_string('website', 'theme_essential');
$description = get_string('websitedesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Facebook url setting.
$name = 'theme_essential/facebook';
$title = get_string( 'facebook', 'theme_essential');
$description = get_string( 'facebookdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Flickr url setting.
$name = 'theme_essential/flickr';
$title = get_string('flickr', 'theme_essential');
$description = get_string('flickrdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Twitter url setting.
$name = 'theme_essential/twitter';
$title = get_string('twitter', 'theme_essential');
$description = get_string('twitterdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Google+ url setting.
$name = 'theme_essential/googleplus';
$title = get_string('googleplus', 'theme_essential');
$description = get_string('googleplusdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// LinkedIn url setting.
$name = 'theme_essential/linkedin';
$title = get_string('linkedin', 'theme_essential');
$description = get_string('linkedindesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Pinterest url setting.
$name = 'theme_essential/pinterest';
$title = get_string('pinterest', 'theme_essential');
$description = get_string('pinterestdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Instagram url setting.
$name = 'theme_essential/instagram';
$title = get_string('instagram', 'theme_essential');
$description = get_string('instagramdesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// YouTube url setting.
$name = 'theme_essential/youtube';
$title = get_string('youtube', 'theme_essential');
$description = get_string('youtubedesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// Skype url setting.
$name = 'theme_essential/skype';
$title = get_string('skype', 'theme_essential');
$description = get_string('skypedesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// VKontakte url setting.