forked from Annoto/moodle-local_annoto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
executable file
·209 lines (183 loc) · 6.69 KB
/
settings.php
File metadata and controls
executable file
·209 lines (183 loc) · 6.69 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
<?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/>.
/**
* Settings.
*
* @package local_annoto
* @copyright Annoto Ltd.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($hassiteconfig) {
require_once($CFG->dirroot . '/local/annoto/classes/admin_setting_custompickroles.php');
require_once($CFG->dirroot . '/local/annoto/lib.php');
$pluginmanager = core_plugin_manager::instance();
$plugininfo = $pluginmanager->get_plugin_info('local_annoto');
$version = $plugininfo->versiondb;
$release = $plugininfo->release;
$name = get_string('pluginname', 'local_annoto') . ' (rel. ' . $release . ' ver. ' . $version . ')';
$settings = new admin_settingpage('local_annoto', $name);
$ADMIN->add('localplugins', $settings);
/* Annoto setup. */
$settings->add(new admin_setting_heading(
'local_annoto/setupheading',
get_string('setupheading', 'local_annoto'),
''
));
// API key / clientID.
$settings->add(new admin_setting_configtext(
'local_annoto/clientid',
get_string('clientid', 'local_annoto'),
get_string('clientiddesc', 'local_annoto'),
null
));
// SSO Secret.
$settings->add(new admin_setting_configtext(
'local_annoto/ssosecret',
get_string('ssosecret', 'local_annoto'),
get_string('ssosecretdesc', 'local_annoto'),
null
));
// Annoto script url.
$settings->add(new admin_setting_configtext(
'local_annoto/scripturl',
get_string('scripturl', 'local_annoto'),
get_string('scripturldesc', 'local_annoto'),
'https://cdn.annoto.net/widget/latest/bootstrap.js'
));
// Deployment domain.
$settings->add(new admin_setting_configselect(
'local_annoto/deploymentdomain',
get_string('deploymentdomain', 'local_annoto'),
get_string('deploymentdomaindesc', 'local_annoto'),
EUREGION,
[
EUREGION => get_string('eurregion', 'local_annoto'),
USREGION => get_string('usregion', 'local_annoto'),
CUSTOM => get_string('custom', 'local_annoto'),
]
));
$settings->add(new admin_setting_configtext(
'local_annoto/customdomain',
get_string('customdomain', 'local_annoto'),
get_string('customdomaindesc', 'local_annoto'),
null
));
$settings->hide_if('local_annoto/customdomain', 'local_annoto/deploymentdomain', 'neq', CUSTOM);
/* Annoto dashboard (LTI) */
$settings->add(new admin_setting_heading(
'local_annoto/externaltoolsettings',
get_string('externaltoolsettings', 'local_annoto'),
''
));
// Enable auto add dashboard to navigation.
$settings->add(new admin_setting_configcheckbox(
'local_annoto/addingdashboard',
get_string('addingdashboard', 'local_annoto'),
get_string('addingdashboard_desc', 'local_annoto'),
0
));
// Dashboard access roles.
[$roles, $defaultroles] = local_annoto_get_all_dashboard_roles();
$settings->add(new admin_setting_configmulticheckbox(
'local_annoto/managementdashboard',
get_string('managementdashboard', 'local_annoto'),
get_string('managementdashboard_desc', 'local_annoto'),
$defaultroles,
$roles
));
/* Annoto settings */
$settings->add(new admin_setting_heading(
'local_annoto/appsetingsheading',
get_string('appsetingsheading', 'local_annoto'),
''
));
// Locale.
$settings->add(new admin_setting_configcheckbox(
'local_annoto/locale',
get_string('locale', 'local_annoto'),
get_string('locale_desc', 'local_annoto'),
1
));
// Moderators Roles.
$settings->add(new local_annoto_admin_setting_custompickroles(
'local_annoto/moderatorroles',
get_string('moderatorroles', 'local_annoto'),
get_string('moderatorrolesdesc', 'local_annoto'),
[
'manager',
'editingteacher',
]
));
// Enable/disable debug logging.
$settings->add(new admin_setting_configcheckbox(
'local_annoto/debuglogging',
get_string('debuglogging', 'local_annoto'),
get_string('debuglogging_desc', 'local_annoto'),
0
));
/* Media player settings */
$settings->add(new admin_setting_heading(
'local_annoto/mediaplayersettingheading',
get_string(
'media_player_setting',
'local_annoto'
),
''
));
$settings->add(new admin_setting_configselect(
'local_annoto/mediasettingsoverride',
get_string('mediasettingsoverride', 'local_annoto'),
get_string('mediasettingsoverridedesc', 'local_annoto'),
1,
[
0 => get_string('no'),
1 => get_string('yes'),
]
));
// Default player width.
$settings->add(new admin_setting_configtext(
'local_annoto/defaultwidth',
get_string('defaultwidth', 'local_annoto'),
get_string('defaultwidthdesc', 'local_annoto'),
DEFAULTWIDTH
));
$settings->hide_if('local_annoto/defaultwidth', 'local_annoto/mediasettingsoverride', 'neq', 1);
// Default player height.
$settings->add(new admin_setting_configtext(
'local_annoto/defaultheight',
get_string('defaultheight', 'local_annoto'),
get_string('defaultheightdesc', 'local_annoto'),
DEFAULTHEIGHT
));
$settings->hide_if('local_annoto/defaultheight', 'local_annoto/mediasettingsoverride', 'neq', 1);
// Activity completion.
$settings->add(new admin_setting_heading(
'local_annoto/activitycompletionheading',
get_string('activitycompletion_settings', 'local_annoto'),
''
));
$settings->add(new admin_setting_configselect(
'local_annoto/activitycompletion',
get_string('activitycompletion_enable', 'local_annoto'),
get_string('activitycompletion_enabledesc', 'local_annoto'),
0,
[
0 => get_string('no'),
1 => get_string('yes'),
]
));
}