-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
137 lines (118 loc) · 5.17 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
<?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 settings.
*
* @package theme_eadumboost
* @copyright 2022 Jonathan J. - Le Mans Université
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
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('themesettingeadumboost', get_string('configtitle', 'theme_eadumboost'));
/*
* ----------------------
* General settings tab
* ----------------------
*/
$page = new admin_settingpage('theme_eadumboost_general', get_string('general_settings', 'theme_eadumboost'));
// Set plateform environment (to have extra CSS for test & pre prod).
$name = 'theme_eadumboost/platform_env';
$title = get_string('platform_env', 'theme_eadumboost');
$description = get_string('platform_env_desc', 'theme_eadumboost');
$default = 'Production';
$choices = array(
'Production' => 'Production',
'Pre-Production' => 'Pre-Production',
'Test-annualisation' => 'Annualisation',
'Test' => 'Test'
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Show a block for Angers Université users in the login page.
$name = 'theme_eadumboost/login_connexion_angers_users';
$title = get_string('title_angers_users', 'theme_eadumboost');
$description = get_string('text_angers_user', 'theme_eadumboost');
$default = 0;
$choices = array(
0 => "No",
1 => "Yes"
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Show "course list" in navbar for everybody or just admin/manager (UMTICE: all, EADUM: manager).
$name = 'theme_eadumboost/navbar_course_list';
$title = get_string('navbar_course_list', 'theme_eadumboost');
$description = get_string('navbar_text_course_list_navbar', 'theme_eadumboost');
$default = 'manager';
$choices = array(
'everybody' => 'All users (UMTICE)',
'manager' => 'Managers (EADUM)'
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Add the page.
$settings->add($page);
/*
* ----------------------
* Course settings tab
* ----------------------
*/
$page = new admin_settingpage('theme_eadumboost_course', get_string('course_settings', 'theme_eadumboost'));
// Simplify the nav-drawer in the context "course" (hide that is not connected with the course).
// For now, it's a scss file : course_simplify_navdrawer.scss.
$name = 'theme_eadumboost/course_simplify_navdrawer';
$title = get_string('course_simplify_navdrawer', 'theme_eadumboost');
$description = get_string('course_text_simplify_navdrawer', 'theme_eadumboost');
$default = 0;
$choices = array(
0 => "No",
1 => "Yes"
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Add acess to "rapport tuteur" in the nav-drawer.
$name = 'theme_eadumboost/course_rapport_tuteur';
$title = get_string('course_rapport_tuteur', 'theme_eadumboost');
$description = get_string('course_text_rapport_tuteur', 'theme_eadumboost');
$default = 0;
$choices = array(
0 => "No",
1 => "Yes"
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Add acess to "editing mode" in the nav-drawer.
$name = 'theme_eadumboost/course_editing_mode_navdrawer';
$title = get_string('course_editing_mode_navdrawer', 'theme_eadumboost');
$description = get_string('course_text_editing_mode_navdrawer', 'theme_eadumboost');
$default = 0;
$choices = array(
0 => "No",
1 => "Yes"
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Add the page.
$settings->add($page);
}