forked from willianmano/moodle-theme_moove
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
742 lines (644 loc) · 32.5 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
<?php
// This file is part of Ranking block for 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 Moove block settings file
*
* @package theme_moove
* @copyright 2017 Willian Mano http://conecti.me
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This line protects the file from being accessed by a URL directly.
defined('MOODLE_INTERNAL') || die();
// This is used for performance, we don't need to know about these settings on every page in Moodle, only when
// we are looking at the admin settings pages.
if ($ADMIN->fulltree) {
// Boost provides a nice setting page which splits settings onto separate tabs. We want to use it here.
$settings = new theme_boost_admin_settingspage_tabs('themesettingmoove', get_string('configtitle', 'theme_moove'));
/*
* ----------------------
* General settings tab
* ----------------------
*/
$page = new admin_settingpage('theme_moove_general', get_string('generalsettings', 'theme_moove'));
// Logo file setting.
$name = 'theme_moove/logo';
$title = get_string('logo', 'theme_moove');
$description = get_string('logodesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'), 'maxfiles' => 1);
$setting = new admin_setting_configstoredfile($name, $title, $description, 'logo', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Favicon setting.
$name = 'theme_moove/favicon';
$title = get_string('favicon', 'theme_moove');
$description = get_string('favicondesc', 'theme_moove');
$opts = array('accepted_types' => array('.ico'), 'maxfiles' => 1);
$setting = new admin_setting_configstoredfile($name, $title, $description, 'favicon', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Preset.
$name = 'theme_moove/preset';
$title = get_string('preset', 'theme_moove');
$description = get_string('preset_desc', 'theme_moove');
$default = 'default.scss';
$context = context_system::instance();
$fs = get_file_storage();
$files = $fs->get_area_files($context->id, 'theme_moove', 'preset', 0, 'itemid, filepath, filename', false);
$choices = [];
foreach ($files as $file) {
$choices[$file->get_filename()] = $file->get_filename();
}
// These are the built in presets.
$choices['default.scss'] = 'default.scss';
$choices['plain.scss'] = 'plain.scss';
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Preset files setting.
$name = 'theme_moove/presetfiles';
$title = get_string('presetfiles', 'theme_moove');
$description = get_string('presetfiles_desc', 'theme_moove');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'preset', 0,
array('maxfiles' => 20, 'accepted_types' => array('.scss')));
$page->add($setting);
// Login page background image.
$name = 'theme_moove/loginbgimg';
$title = get_string('loginbgimg', 'theme_moove');
$description = get_string('loginbgimg_desc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.svg'));
$setting = new admin_setting_configstoredfile($name, $title, $description, 'loginbgimg', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Variable $brand-color.
// We use an empty default value because the default colour should come from the preset.
$name = 'theme_moove/brandcolor';
$title = get_string('brandcolor', 'theme_moove');
$description = get_string('brandcolor_desc', 'theme_moove');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Variable $navbar-header-color.
// We use an empty default value because the default colour should come from the preset.
$name = 'theme_moove/navbarheadercolor';
$title = get_string('navbarheadercolor', 'theme_moove');
$description = get_string('navbarheadercolor_desc', 'theme_moove');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Variable $navbar-bg.
// We use an empty default value because the default colour should come from the preset.
$name = 'theme_moove/navbarbg';
$title = get_string('navbarbg', 'theme_moove');
$description = get_string('navbarbg_desc', 'theme_moove');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Variable $navbar-bg-hover.
// We use an empty default value because the default colour should come from the preset.
$name = 'theme_moove/navbarbghover';
$title = get_string('navbarbghover', 'theme_moove');
$description = get_string('navbarbghover_desc', 'theme_moove');
$setting = new admin_setting_configcolourpicker($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Course format option.
$name = 'theme_moove/coursepresentation';
$title = get_string('coursepresentation', 'theme_moove');
$description = get_string('coursepresentationdesc', 'theme_moove');
$options = [];
$options[1] = get_string('coursedefault', 'theme_moove');
$options[2] = get_string('coursecover', 'theme_moove');
$setting = new admin_setting_configselect($name, $title, $description, $default, $options);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$name = 'theme_moove/courselistview';
$title = get_string('courselistview', 'theme_moove');
$description = get_string('courselistviewdesc', 'theme_moove');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$page->add($setting);
// Must add the page after definiting all the settings!
$settings->add($page);
/*
* ----------------------
* Advanced settings tab
* ----------------------
*/
$page = new admin_settingpage('theme_moove_advanced', get_string('advancedsettings', 'theme_moove'));
// Raw SCSS to include before the content.
$setting = new admin_setting_scsscode('theme_moove/scsspre',
get_string('rawscsspre', 'theme_moove'), get_string('rawscsspre_desc', 'theme_moove'), '', PARAM_RAW);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Raw SCSS to include after the content.
$setting = new admin_setting_scsscode('theme_moove/scss', get_string('rawscss', 'theme_moove'),
get_string('rawscss_desc', 'theme_moove'), '', PARAM_RAW);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Google analytics block.
$name = 'theme_moove/googleanalytics';
$title = get_string('googleanalytics', 'theme_moove');
$description = get_string('googleanalyticsdesc', 'theme_moove');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$settings->add($page);
/*
* -----------------------
* Frontpage settings tab
* -----------------------
*/
$page = new admin_settingpage('theme_moove_frontpage', get_string('frontpagesettings', 'theme_moove'));
// Disable bottom footer.
$name = 'theme_moove/disablefrontpageloginbox';
$title = get_string('disablefrontpageloginbox', 'theme_moove');
$description = get_string('disablefrontpageloginboxdesc', 'theme_moove');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$page->add($setting);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Disable teachers from cards.
$name = 'theme_moove/disableteacherspic';
$title = get_string('disableteacherspic', 'theme_moove');
$description = get_string('disableteacherspicdesc', 'theme_moove');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$page->add($setting);
// Headerimg file setting.
$name = 'theme_moove/headerimg';
$title = get_string('headerimg', 'theme_moove');
$description = get_string('headerimgdesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'));
$setting = new admin_setting_configstoredfile($name, $title, $description, 'headerimg', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Bannerheading.
$name = 'theme_moove/bannerheading';
$title = get_string('bannerheading', 'theme_moove');
$description = get_string('bannerheadingdesc', 'theme_moove');
$default = 'Perfect Learning System';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Bannercontent.
$name = 'theme_moove/bannercontent';
$title = get_string('bannercontent', 'theme_moove');
$description = get_string('bannercontentdesc', 'theme_moove');
$default = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$name = 'theme_moove/displaymarketingbox';
$title = get_string('displaymarketingbox', 'theme_moove');
$description = get_string('displaymarketingboxdesc', 'theme_moove');
$default = 1;
$choices = array(0 => 'No', 1 => 'Yes');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$page->add($setting);
// Marketing1icon.
$name = 'theme_moove/marketing1icon';
$title = get_string('marketing1icon', 'theme_moove');
$description = get_string('marketing1icondesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'));
$setting = new admin_setting_configstoredfile($name, $title, $description, 'marketing1icon', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing1heading.
$name = 'theme_moove/marketing1heading';
$title = get_string('marketing1heading', 'theme_moove');
$description = get_string('marketing1headingdesc', 'theme_moove');
$default = 'We host';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing1subheading.
$name = 'theme_moove/marketing1subheading';
$title = get_string('marketing1subheading', 'theme_moove');
$description = get_string('marketing1subheadingdesc', 'theme_moove');
$default = 'your MOODLE';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing1content.
$name = 'theme_moove/marketing1content';
$title = get_string('marketing1content', 'theme_moove');
$description = get_string('marketing1contentdesc', 'theme_moove');
$default = 'Moodle hosting in a powerful cloud infrastructure';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing1url.
$name = 'theme_moove/marketing1url';
$title = get_string('marketing1url', 'theme_moove');
$description = get_string('marketing1urldesc', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing2icon.
$name = 'theme_moove/marketing2icon';
$title = get_string('marketing2icon', 'theme_moove');
$description = get_string('marketing2icondesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'));
$setting = new admin_setting_configstoredfile($name, $title, $description, 'marketing2icon', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing2heading.
$name = 'theme_moove/marketing2heading';
$title = get_string('marketing2heading', 'theme_moove');
$description = get_string('marketing2headingdesc', 'theme_moove');
$default = 'Consulting';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing2subheading.
$name = 'theme_moove/marketing2subheading';
$title = get_string('marketing2subheading', 'theme_moove');
$description = get_string('marketing2subheadingdesc', 'theme_moove');
$default = 'for your company';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing2content.
$name = 'theme_moove/marketing2content';
$title = get_string('marketing2content', 'theme_moove');
$description = get_string('marketing2contentdesc', 'theme_moove');
$default = 'Moodle consulting and training for you';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing2url.
$name = 'theme_moove/marketing2url';
$title = get_string('marketing2url', 'theme_moove');
$description = get_string('marketing2urldesc', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing3icon.
$name = 'theme_moove/marketing3icon';
$title = get_string('marketing3icon', 'theme_moove');
$description = get_string('marketing3icondesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'));
$setting = new admin_setting_configstoredfile($name, $title, $description, 'marketing3icon', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing3heading.
$name = 'theme_moove/marketing3heading';
$title = get_string('marketing3heading', 'theme_moove');
$description = get_string('marketing3headingdesc', 'theme_moove');
$default = 'Development';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing3subheading.
$name = 'theme_moove/marketing3subheading';
$title = get_string('marketing3subheading', 'theme_moove');
$description = get_string('marketing3subheadingdesc', 'theme_moove');
$default = 'themes and plugins';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing3content.
$name = 'theme_moove/marketing3content';
$title = get_string('marketing3content', 'theme_moove');
$description = get_string('marketing3contentdesc', 'theme_moove');
$default = 'We develop themes and plugins as your desires';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing3url.
$name = 'theme_moove/marketing3url';
$title = get_string('marketing3url', 'theme_moove');
$description = get_string('marketing3urldesc', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing4icon.
$name = 'theme_moove/marketing4icon';
$title = get_string('marketing4icon', 'theme_moove');
$description = get_string('marketing4icondesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'));
$setting = new admin_setting_configstoredfile($name, $title, $description, 'marketing4icon', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing4heading.
$name = 'theme_moove/marketing4heading';
$title = get_string('marketing4heading', 'theme_moove');
$description = get_string('marketing4headingdesc', 'theme_moove');
$default = 'Support';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing4subheading.
$name = 'theme_moove/marketing4subheading';
$title = get_string('marketing4subheading', 'theme_moove');
$description = get_string('marketing4subheadingdesc', 'theme_moove');
$default = 'we give you answers';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing4content.
$name = 'theme_moove/marketing4content';
$title = get_string('marketing4content', 'theme_moove');
$description = get_string('marketing4contentdesc', 'theme_moove');
$default = 'MOODLE specialized support';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Marketing4url.
$name = 'theme_moove/marketing4url';
$title = get_string('marketing4url', 'theme_moove');
$description = get_string('marketing4urldesc', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Enable or disable Slideshow settings.
$name = 'theme_moove/sliderenabled';
$title = get_string('sliderenabled', 'theme_moove');
$description = get_string('sliderenableddesc', 'theme_moove');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$page->add($setting);
// Enable slideshow on frontpage guest page.
$name = 'theme_moove/sliderfrontpage';
$title = get_string('sliderfrontpage', 'theme_moove');
$description = get_string('sliderfrontpagedesc', 'theme_moove');
$default = 0;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$page->add($setting);
$name = 'theme_moove/slidercount';
$title = get_string('slidercount', 'theme_moove');
$description = get_string('slidercountdesc', 'theme_moove');
$default = 1;
$options = array();
for ($i = 0; $i < 13; $i++) {
$options[$i] = $i;
}
$setting = new admin_setting_configselect($name, $title, $description, $default, $options);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// If we don't have an slide yet, default to the preset.
$slidercount = get_config('theme_moove', 'slidercount');
if (!$slidercount) {
$slidercount = 1;
}
for ($sliderindex = 1; $sliderindex <= $slidercount; $sliderindex++) {
$fileid = 'sliderimage' . $sliderindex;
$name = 'theme_moove/sliderimage' . $sliderindex;
$title = get_string('sliderimage', 'theme_moove');
$description = get_string('sliderimagedesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'), 'maxfiles' => 1);
$setting = new admin_setting_configstoredfile($name, $title, $description, $fileid, 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$name = 'theme_moove/slidertitle' . $sliderindex;
$title = get_string('slidertitle', 'theme_moove');
$description = get_string('slidertitledesc', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_TEXT);
$page->add($setting);
$name = 'theme_moove/slidercap' . $sliderindex;
$title = get_string('slidercaption', 'theme_moove');
$description = get_string('slidercaptiondesc', 'theme_moove');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$page->add($setting);
}
// Enable or disable Slideshow settings.
$name = 'theme_moove/numbersfrontpage';
$title = get_string('numbersfrontpage', 'theme_moove');
$description = get_string('numbersfrontpagedesc', 'theme_moove');
$default = 1;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$page->add($setting);
// Enable sponsors on frontpage guest page.
$name = 'theme_moove/sponsorsfrontpage';
$title = get_string('sponsorsfrontpage', 'theme_moove');
$description = get_string('sponsorsfrontpagedesc', 'theme_moove');
$default = 0;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$page->add($setting);
$name = 'theme_moove/sponsorstitle';
$title = get_string('sponsorstitle', 'theme_moove');
$description = get_string('sponsorstitledesc', 'theme_moove');
$default = get_string('sponsorstitledefault', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_TEXT);
$page->add($setting);
$name = 'theme_moove/sponsorssubtitle';
$title = get_string('sponsorssubtitle', 'theme_moove');
$description = get_string('sponsorssubtitledesc', 'theme_moove');
$default = get_string('sponsorssubtitledefault', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_TEXT);
$page->add($setting);
$name = 'theme_moove/sponsorscount';
$title = get_string('sponsorscount', 'theme_moove');
$description = get_string('sponsorscountdesc', 'theme_moove');
$default = 1;
$options = array();
for ($i = 0; $i < 5; $i++) {
$options[$i] = $i;
}
$setting = new admin_setting_configselect($name, $title, $description, $default, $options);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// If we don't have an slide yet, default to the preset.
$sponsorscount = get_config('theme_moove', 'sponsorscount');
if (!$sponsorscount) {
$sponsorscount = 1;
}
for ($sponsorsindex = 1; $sponsorsindex <= $sponsorscount; $sponsorsindex++) {
$fileid = 'sponsorsimage' . $sponsorsindex;
$name = 'theme_moove/sponsorsimage' . $sponsorsindex;
$title = get_string('sponsorsimage', 'theme_moove');
$description = get_string('sponsorsimagedesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'), 'maxfiles' => 1);
$setting = new admin_setting_configstoredfile($name, $title, $description, $fileid, 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$name = 'theme_moove/sponsorsurl' . $sponsorsindex;
$title = get_string('sponsorsurl', 'theme_moove');
$description = get_string('sponsorsurldesc', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_TEXT);
$page->add($setting);
}
// Enable clients on frontpage guest page.
$name = 'theme_moove/clientsfrontpage';
$title = get_string('clientsfrontpage', 'theme_moove');
$description = get_string('clientsfrontpagedesc', 'theme_moove');
$default = 0;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$page->add($setting);
$name = 'theme_moove/clientstitle';
$title = get_string('clientstitle', 'theme_moove');
$description = get_string('clientstitledesc', 'theme_moove');
$default = get_string('clientstitledefault', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_TEXT);
$page->add($setting);
$name = 'theme_moove/clientssubtitle';
$title = get_string('clientssubtitle', 'theme_moove');
$description = get_string('clientssubtitledesc', 'theme_moove');
$default = get_string('clientssubtitledefault', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_TEXT);
$page->add($setting);
$name = 'theme_moove/clientscount';
$title = get_string('clientscount', 'theme_moove');
$description = get_string('clientscountdesc', 'theme_moove');
$default = 1;
$options = array();
for ($i = 0; $i < 5; $i++) {
$options[$i] = $i;
}
$setting = new admin_setting_configselect($name, $title, $description, $default, $options);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// If we don't have an slide yet, default to the preset.
$clientscount = get_config('theme_moove', 'clientscount');
if (!$clientscount) {
$clientscount = 1;
}
for ($clientsindex = 1; $clientsindex <= $clientscount; $clientsindex++) {
$fileid = 'clientsimage' . $clientsindex;
$name = 'theme_moove/clientsimage' . $clientsindex;
$title = get_string('clientsimage', 'theme_moove');
$description = get_string('clientsimagedesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg'), 'maxfiles' => 1);
$setting = new admin_setting_configstoredfile($name, $title, $description, $fileid, 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$name = 'theme_moove/clientsurl' . $clientsindex;
$title = get_string('clientsurl', 'theme_moove');
$description = get_string('clientsurldesc', 'theme_moove');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_TEXT);
$page->add($setting);
}
$settings->add($page);
/*
* --------------------
* Footer settings tab
* --------------------
*/
$page = new admin_settingpage('theme_moove_footer', get_string('footersettings', 'theme_moove'));
$name = 'theme_moove/getintouchcontent';
$title = get_string('getintouchcontent', 'theme_moove');
$description = get_string('getintouchcontentdesc', 'theme_moove');
$default = 'Conecti.me';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Website.
$name = 'theme_moove/website';
$title = get_string('website', 'theme_moove');
$description = get_string('websitedesc', 'theme_moove');
$default = 'http://conecti.me';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Mobile.
$name = 'theme_moove/mobile';
$title = get_string('mobile', 'theme_moove');
$description = get_string('mobiledesc', 'theme_moove');
$default = 'Mobile : +55 (98) 00123-45678';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Mail.
$name = 'theme_moove/mail';
$title = get_string('mail', 'theme_moove');
$description = get_string('maildesc', 'theme_moove');
$default = 'willianmano@conecti.me';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Facebook url setting.
$name = 'theme_moove/facebook';
$title = get_string('facebook', 'theme_moove');
$description = get_string('facebookdesc', 'theme_moove');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Twitter url setting.
$name = 'theme_moove/twitter';
$title = get_string('twitter', 'theme_moove');
$description = get_string('twitterdesc', 'theme_moove');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Linkdin url setting.
$name = 'theme_moove/linkedin';
$title = get_string('linkedin', 'theme_moove');
$description = get_string('linkedindesc', 'theme_moove');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Youtube url setting.
$name = 'theme_moove/youtube';
$title = get_string('youtube', 'theme_moove');
$description = get_string('youtubedesc', 'theme_moove');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Instagram url setting.
$name = 'theme_moove/instagram';
$title = get_string('instagram', 'theme_moove');
$description = get_string('instagramdesc', 'theme_moove');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Whatsapp url setting.
$name = 'theme_moove/whatsapp';
$title = get_string('whatsapp', 'theme_moove');
$description = get_string('whatsappdesc', 'theme_moove');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Top footer background image.
$name = 'theme_moove/topfooterimg';
$title = get_string('topfooterimg', 'theme_moove');
$description = get_string('topfooterimgdesc', 'theme_moove');
$opts = array('accepted_types' => array('.png', '.jpg', '.svg'));
$setting = new admin_setting_configstoredfile($name, $title, $description, 'topfooterimg', 0, $opts);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
$settings->add($page);
// Forum page.
$settingpage = new admin_settingpage('theme_moove_forum', get_string('forumsettings', 'theme_moove'));
$settingpage->add(new admin_setting_heading('theme_moove_forumheading', null,
format_text(get_string('forumsettingsdesc', 'theme_moove'), FORMAT_MARKDOWN)));
// Enable custom template.
$name = 'theme_moove/forumcustomtemplate';
$title = get_string('forumcustomtemplate', 'theme_moove');
$description = get_string('forumcustomtemplatedesc', 'theme_moove');
$default = 0;
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$settingpage->add($setting);
// Header setting.
$name = 'theme_moove/forumhtmlemailheader';
$title = get_string('forumhtmlemailheader', 'theme_moove');
$description = get_string('forumhtmlemailheaderdesc', 'theme_moove');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$settingpage->add($setting);
// Footer setting.
$name = 'theme_moove/forumhtmlemailfooter';
$title = get_string('forumhtmlemailfooter', 'theme_moove');
$description = get_string('forumhtmlemailfooterdesc', 'theme_moove');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$settingpage->add($setting);
$settings->add($settingpage);
}