1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
namespace mod_bigbluebuttonbn;
|
|
|
18 |
|
|
|
19 |
use admin_category;
|
|
|
20 |
use admin_setting;
|
|
|
21 |
use admin_setting_configcheckbox;
|
|
|
22 |
use admin_setting_configmultiselect;
|
|
|
23 |
use admin_setting_configpasswordunmask;
|
|
|
24 |
use admin_setting_configselect;
|
|
|
25 |
use admin_setting_configstoredfile;
|
|
|
26 |
use admin_setting_configtext;
|
|
|
27 |
use admin_setting_configtextarea;
|
|
|
28 |
use admin_setting_heading;
|
|
|
29 |
use admin_settingpage;
|
|
|
30 |
use cache_helper;
|
|
|
31 |
use core_plugin_manager;
|
|
|
32 |
use lang_string;
|
|
|
33 |
use mod_bigbluebuttonbn\local\config;
|
|
|
34 |
use mod_bigbluebuttonbn\local\helpers\roles;
|
|
|
35 |
use mod_bigbluebuttonbn\local\plugins\admin_page_manage_extensions;
|
|
|
36 |
use mod_bigbluebuttonbn\local\proxy\bigbluebutton_proxy;
|
|
|
37 |
|
|
|
38 |
/**
|
|
|
39 |
* The mod_bigbluebuttonbn settings helper
|
|
|
40 |
*
|
|
|
41 |
* @package mod_bigbluebuttonbn
|
|
|
42 |
* @copyright 2021 onwards, Blindside Networks Inc
|
|
|
43 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
44 |
* @author Laurent David (laurent [at] call-learning [dt] fr)
|
|
|
45 |
*/
|
|
|
46 |
class settings {
|
|
|
47 |
|
|
|
48 |
/** @var admin_category shared value */
|
|
|
49 |
private $admin;
|
|
|
50 |
|
|
|
51 |
/** @var bool whether the current user has moodle/site:config capability */
|
|
|
52 |
private $hassiteconfig;
|
|
|
53 |
|
|
|
54 |
/** @var bool Module is enabled */
|
|
|
55 |
private $moduleenabled;
|
|
|
56 |
|
|
|
57 |
/** @var string The name of the section */
|
|
|
58 |
private $section;
|
|
|
59 |
|
|
|
60 |
/** @var string The parent name */
|
|
|
61 |
private $parent = "modbigbluebuttonbnfolder";
|
|
|
62 |
|
|
|
63 |
/** @var string The section name prefix */
|
|
|
64 |
private $sectionnameprefix = "mod_bigbluebuttonbn";
|
|
|
65 |
|
|
|
66 |
/**
|
|
|
67 |
* Constructor for the bigbluebuttonbn settings.
|
|
|
68 |
*
|
|
|
69 |
* @param admin_category $admin
|
|
|
70 |
* @param \core\plugininfo\mod $module
|
|
|
71 |
* @param string $categoryname for the plugin setting (main setting page)
|
|
|
72 |
* @param bool $hassiteconfig whether the current user has moodle/site:config capability
|
|
|
73 |
*/
|
|
|
74 |
public function __construct(admin_category $admin, \core\plugininfo\mod $module, string $categoryname, bool $hassiteconfig) {
|
|
|
75 |
$this->moduleenabled = $module->is_enabled() === true;
|
|
|
76 |
$this->admin = $admin;
|
|
|
77 |
$this->section = $categoryname;
|
|
|
78 |
$this->hassiteconfig = $hassiteconfig;
|
|
|
79 |
|
|
|
80 |
$modbigbluebuttobnfolder = new admin_category(
|
|
|
81 |
$this->parent,
|
|
|
82 |
new lang_string('pluginname', 'mod_bigbluebuttonbn'),
|
|
|
83 |
$module->is_enabled() === false
|
|
|
84 |
);
|
|
|
85 |
|
|
|
86 |
$admin->add('modsettings', $modbigbluebuttobnfolder);
|
|
|
87 |
|
|
|
88 |
$mainsettings = $this->add_general_settings();
|
|
|
89 |
$admin->add($this->parent, $mainsettings);
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
/**
|
|
|
93 |
* Add all settings.
|
|
|
94 |
*/
|
|
|
95 |
public function add_all_settings(): void {
|
|
|
96 |
// Renders settings for welcome messages.
|
|
|
97 |
$this->add_defaultmessages_settings();
|
|
|
98 |
// Evaluates if recordings are enabled for the Moodle site.
|
|
|
99 |
// Renders settings for record feature.
|
|
|
100 |
$this->add_record_settings();
|
|
|
101 |
// Renders settings for import recordings.
|
|
|
102 |
$this->add_importrecordings_settings();
|
|
|
103 |
// Renders settings for showing recordings.
|
|
|
104 |
$this->add_showrecordings_settings();
|
|
|
105 |
|
|
|
106 |
// Renders settings for meetings.
|
|
|
107 |
$this->add_waitmoderator_settings();
|
|
|
108 |
$this->add_voicebridge_settings();
|
|
|
109 |
$this->add_preupload_settings();
|
|
|
110 |
$this->add_userlimit_settings();
|
|
|
111 |
$this->add_participants_settings();
|
|
|
112 |
$this->add_muteonstart_settings();
|
|
|
113 |
$this->add_lock_settings();
|
|
|
114 |
// Renders settings for extended capabilities.
|
|
|
115 |
$this->add_extended_settings();
|
|
|
116 |
// Renders settings for experimental features.
|
|
|
117 |
$this->add_experimental_settings();
|
|
|
118 |
|
|
|
119 |
// Add all subplugin settings if any.
|
|
|
120 |
$this->admin->add($this->parent, new admin_category('bbbextplugins',
|
|
|
121 |
new lang_string('subplugintype_bbbext', 'mod_bigbluebuttonbn'), !$this->moduleenabled));
|
|
|
122 |
$this->admin->add($this->parent, new admin_page_manage_extensions());
|
|
|
123 |
foreach (core_plugin_manager::instance()->get_plugins_of_type(extension::BBB_EXTENSION_PLUGIN_NAME) as $plugin) {
|
|
|
124 |
$plugin->load_settings($this->admin, extension::BBB_EXTENSION_PLUGIN_NAME, $this->hassiteconfig);
|
|
|
125 |
}
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
/**
|
|
|
129 |
* Add the setting and lock it conditionally.
|
|
|
130 |
*
|
|
|
131 |
* @param string $name
|
|
|
132 |
* @param admin_setting $item
|
|
|
133 |
* @param admin_settingpage $settings
|
|
|
134 |
*/
|
|
|
135 |
protected function add_conditional_element(string $name, admin_setting $item, admin_settingpage $settings): void {
|
|
|
136 |
global $CFG;
|
|
|
137 |
if (isset($CFG->bigbluebuttonbn) && isset($CFG->bigbluebuttonbn[$name])) {
|
|
|
138 |
if ($item->config_read($item->name)) {
|
|
|
139 |
// A value has been set, we can safely omit the setting and it won't interfere with installation
|
|
|
140 |
// process.
|
|
|
141 |
// The idea behind it is to hide values from end-users in case we use multitenancy for example.
|
|
|
142 |
return;
|
|
|
143 |
}
|
|
|
144 |
}
|
|
|
145 |
$settings->add($item);
|
|
|
146 |
}
|
|
|
147 |
|
|
|
148 |
/**
|
|
|
149 |
* Helper function renders general settings if the feature is enabled.
|
|
|
150 |
*
|
|
|
151 |
* @return admin_settingpage
|
|
|
152 |
* @throws \coding_exception
|
|
|
153 |
*/
|
|
|
154 |
protected function add_general_settings(): admin_settingpage {
|
|
|
155 |
global $CFG, $OUTPUT;
|
|
|
156 |
$settingsgeneral = new admin_settingpage(
|
|
|
157 |
$this->section,
|
|
|
158 |
get_string('config_general', 'bigbluebuttonbn'),
|
|
|
159 |
'moodle/site:config',
|
|
|
160 |
!((boolean) setting_validator::section_general_shown()) && ($this->moduleenabled)
|
|
|
161 |
);
|
|
|
162 |
if ($this->admin->fulltree) {
|
|
|
163 |
// Configuration for BigBlueButton.
|
|
|
164 |
$item = new admin_setting_heading('bigbluebuttonbn_config_general',
|
|
|
165 |
'',
|
|
|
166 |
get_string('config_general_description', 'bigbluebuttonbn')
|
|
|
167 |
);
|
|
|
168 |
$settingsgeneral->add($item);
|
|
|
169 |
|
|
|
170 |
if (config::server_credentials_invalid()) {
|
|
|
171 |
// A notification should appear when default credentials are used.
|
|
|
172 |
$settingsgeneral->add(new admin_setting_heading(
|
|
|
173 |
'bigbluebuttonbn_notification',
|
|
|
174 |
'',
|
|
|
175 |
$OUTPUT->notification(get_string('credentials_warning', 'mod_bigbluebuttonbn'), 'error')
|
|
|
176 |
));
|
|
|
177 |
}
|
|
|
178 |
|
|
|
179 |
$item = new admin_setting_configtext(
|
|
|
180 |
'bigbluebuttonbn_server_url',
|
|
|
181 |
get_string('config_server_url', 'bigbluebuttonbn'),
|
|
|
182 |
get_string('config_server_url_description', 'bigbluebuttonbn'),
|
|
|
183 |
'',
|
|
|
184 |
PARAM_RAW
|
|
|
185 |
);
|
|
|
186 |
$item->set_updatedcallback(
|
|
|
187 |
function() {
|
|
|
188 |
$this->reset_cache();
|
|
|
189 |
$task = new \mod_bigbluebuttonbn\task\reset_recordings();
|
|
|
190 |
\core\task\manager::queue_adhoc_task($task);
|
|
|
191 |
}
|
|
|
192 |
);
|
|
|
193 |
$this->add_conditional_element(
|
|
|
194 |
'server_url',
|
|
|
195 |
$item,
|
|
|
196 |
$settingsgeneral
|
|
|
197 |
);
|
|
|
198 |
$item = new admin_setting_configpasswordunmask(
|
|
|
199 |
'bigbluebuttonbn_shared_secret',
|
|
|
200 |
get_string('config_shared_secret', 'bigbluebuttonbn'),
|
|
|
201 |
get_string('config_shared_secret_description', 'bigbluebuttonbn'),
|
|
|
202 |
''
|
|
|
203 |
);
|
|
|
204 |
$this->add_conditional_element(
|
|
|
205 |
'shared_secret',
|
|
|
206 |
$item,
|
|
|
207 |
$settingsgeneral
|
|
|
208 |
);
|
|
|
209 |
|
|
|
210 |
$item = new admin_setting_configselect(
|
|
|
211 |
'bigbluebuttonbn_checksum_algorithm',
|
|
|
212 |
get_string('config_checksum_algorithm', 'bigbluebuttonbn'),
|
|
|
213 |
get_string('config_checksum_algorithm_description', 'bigbluebuttonbn'),
|
|
|
214 |
config::DEFAULT_CHECKSUM_ALGORITHM,
|
|
|
215 |
array_combine(config::CHECKSUM_ALGORITHMS, config::CHECKSUM_ALGORITHMS)
|
|
|
216 |
);
|
|
|
217 |
$this->add_conditional_element(
|
|
|
218 |
'checksum_algorithm',
|
|
|
219 |
$item,
|
|
|
220 |
$settingsgeneral
|
|
|
221 |
);
|
|
|
222 |
|
|
|
223 |
$item = new admin_setting_configtext(
|
|
|
224 |
'bigbluebuttonbn_poll_interval',
|
|
|
225 |
get_string('config_poll_interval', 'bigbluebuttonbn'),
|
|
|
226 |
get_string('config_poll_interval_description', 'bigbluebuttonbn'),
|
|
|
227 |
bigbluebutton_proxy::DEFAULT_POLL_INTERVAL,
|
|
|
228 |
PARAM_INT
|
|
|
229 |
);
|
|
|
230 |
$this->add_conditional_element(
|
|
|
231 |
'poll_interval',
|
|
|
232 |
$item,
|
|
|
233 |
$settingsgeneral
|
|
|
234 |
);
|
|
|
235 |
}
|
|
|
236 |
return $settingsgeneral;
|
|
|
237 |
}
|
|
|
238 |
|
|
|
239 |
/**
|
|
|
240 |
* Helper function renders default messages settings if the feature is enabled.
|
|
|
241 |
*/
|
|
|
242 |
protected function add_defaultmessages_settings(): void {
|
|
|
243 |
// Configuration for 'default messages' feature.
|
|
|
244 |
$defaultmessagessetting = new admin_settingpage(
|
|
|
245 |
"{$this->sectionnameprefix}_default_messages",
|
|
|
246 |
get_string('config_default_messages', 'bigbluebuttonbn'),
|
|
|
247 |
'moodle/site:config',
|
|
|
248 |
!((boolean) setting_validator::section_default_messages_shown()) && ($this->moduleenabled)
|
|
|
249 |
);
|
|
|
250 |
|
|
|
251 |
if ($this->admin->fulltree) {
|
|
|
252 |
$item = new admin_setting_heading(
|
|
|
253 |
'bigbluebuttonbn_config_default_messages',
|
|
|
254 |
'',
|
|
|
255 |
get_string('config_default_messages_description', 'bigbluebuttonbn')
|
|
|
256 |
);
|
|
|
257 |
$defaultmessagessetting->add($item);
|
|
|
258 |
$item = new admin_setting_configtextarea(
|
|
|
259 |
'bigbluebuttonbn_welcome_default',
|
|
|
260 |
get_string('config_welcome_default', 'bigbluebuttonbn'),
|
|
|
261 |
get_string('config_welcome_default_description', 'bigbluebuttonbn'),
|
|
|
262 |
'',
|
|
|
263 |
PARAM_TEXT
|
|
|
264 |
);
|
|
|
265 |
$this->add_conditional_element(
|
|
|
266 |
'welcome_default',
|
|
|
267 |
$item,
|
|
|
268 |
$defaultmessagessetting
|
|
|
269 |
);
|
|
|
270 |
$item = new admin_setting_configcheckbox(
|
|
|
271 |
'bigbluebuttonbn_welcome_editable',
|
|
|
272 |
get_string('config_welcome_editable', 'bigbluebuttonbn'),
|
|
|
273 |
get_string('config_welcome_editable_description', 'bigbluebuttonbn'),
|
|
|
274 |
1,
|
|
|
275 |
);
|
|
|
276 |
$this->add_conditional_element(
|
|
|
277 |
'welcome_editable',
|
|
|
278 |
$item,
|
|
|
279 |
$defaultmessagessetting
|
|
|
280 |
);
|
|
|
281 |
}
|
|
|
282 |
$this->admin->add($this->parent, $defaultmessagessetting);
|
|
|
283 |
|
|
|
284 |
}
|
|
|
285 |
|
|
|
286 |
/**
|
|
|
287 |
* Helper function renders record settings if the feature is enabled.
|
|
|
288 |
*/
|
|
|
289 |
protected function add_record_settings(): void {
|
|
|
290 |
// Configuration for 'recording' feature.
|
|
|
291 |
$recordingsetting = new admin_settingpage(
|
|
|
292 |
"{$this->sectionnameprefix}_recording",
|
|
|
293 |
get_string('config_recording', 'bigbluebuttonbn'),
|
|
|
294 |
'moodle/site:config',
|
|
|
295 |
!((boolean) setting_validator::section_record_meeting_shown()) && ($this->moduleenabled)
|
|
|
296 |
);
|
|
|
297 |
|
|
|
298 |
if ($this->admin->fulltree) {
|
|
|
299 |
$item = new admin_setting_heading(
|
|
|
300 |
'bigbluebuttonbn_config_recording',
|
|
|
301 |
'',
|
|
|
302 |
get_string('config_recording_description', 'bigbluebuttonbn')
|
|
|
303 |
);
|
|
|
304 |
$recordingsetting->add($item);
|
|
|
305 |
$item = new admin_setting_configcheckbox(
|
|
|
306 |
'bigbluebuttonbn_recording_default',
|
|
|
307 |
get_string('config_recording_default', 'bigbluebuttonbn'),
|
|
|
308 |
get_string('config_recording_default_description', 'bigbluebuttonbn'),
|
|
|
309 |
1
|
|
|
310 |
);
|
|
|
311 |
$this->add_conditional_element(
|
|
|
312 |
'recording_default',
|
|
|
313 |
$item,
|
|
|
314 |
$recordingsetting
|
|
|
315 |
);
|
|
|
316 |
$item = new admin_setting_configtext(
|
|
|
317 |
'bigbluebuttonbn_recording_refresh_period',
|
|
|
318 |
get_string('config_recording_refresh_period', 'bigbluebuttonbn'),
|
|
|
319 |
get_string('config_recording_refresh_period_description', 'bigbluebuttonbn'),
|
|
|
320 |
recording::RECORDING_REFRESH_DEFAULT_PERIOD,
|
|
|
321 |
PARAM_INT
|
|
|
322 |
);
|
|
|
323 |
$this->add_conditional_element(
|
|
|
324 |
'recording_refresh_period',
|
|
|
325 |
$item,
|
|
|
326 |
$recordingsetting
|
|
|
327 |
);
|
|
|
328 |
$item = new admin_setting_configcheckbox(
|
|
|
329 |
'bigbluebuttonbn_recording_editable',
|
|
|
330 |
get_string('config_recording_editable', 'bigbluebuttonbn'),
|
|
|
331 |
get_string('config_recording_editable_description', 'bigbluebuttonbn'),
|
|
|
332 |
1
|
|
|
333 |
);
|
|
|
334 |
$this->add_conditional_element(
|
|
|
335 |
'recording_editable',
|
|
|
336 |
$item,
|
|
|
337 |
$recordingsetting
|
|
|
338 |
);
|
|
|
339 |
|
|
|
340 |
// Add recording start to load and allow/hide stop/pause.
|
|
|
341 |
$item = new admin_setting_configcheckbox(
|
|
|
342 |
'bigbluebuttonbn_recording_all_from_start_default',
|
|
|
343 |
get_string('config_recording_all_from_start_default', 'bigbluebuttonbn'),
|
|
|
344 |
get_string('config_recording_all_from_start_default_description', 'bigbluebuttonbn'),
|
|
|
345 |
|
|
|
346 |
);
|
|
|
347 |
$this->add_conditional_element(
|
|
|
348 |
'recording_all_from_start_default',
|
|
|
349 |
$item,
|
|
|
350 |
$recordingsetting
|
|
|
351 |
);
|
|
|
352 |
$item = new admin_setting_configcheckbox(
|
|
|
353 |
'bigbluebuttonbn_recording_all_from_start_editable',
|
|
|
354 |
get_string('config_recording_all_from_start_editable', 'bigbluebuttonbn'),
|
|
|
355 |
get_string('config_recording_all_from_start_editable_description', 'bigbluebuttonbn'),
|
|
|
356 |
|
|
|
357 |
);
|
|
|
358 |
$this->add_conditional_element(
|
|
|
359 |
'recording_all_from_start_editable',
|
|
|
360 |
$item,
|
|
|
361 |
$recordingsetting
|
|
|
362 |
);
|
|
|
363 |
$item = new admin_setting_configcheckbox(
|
|
|
364 |
'bigbluebuttonbn_recording_hide_button_default',
|
|
|
365 |
get_string('config_recording_hide_button_default', 'bigbluebuttonbn'),
|
|
|
366 |
get_string('config_recording_hide_button_default_description', 'bigbluebuttonbn'),
|
|
|
367 |
|
|
|
368 |
);
|
|
|
369 |
$this->add_conditional_element(
|
|
|
370 |
'recording_hide_button_default',
|
|
|
371 |
$item,
|
|
|
372 |
$recordingsetting
|
|
|
373 |
);
|
|
|
374 |
$item = new admin_setting_configcheckbox(
|
|
|
375 |
'bigbluebuttonbn_recording_hide_button_editable',
|
|
|
376 |
get_string('config_recording_hide_button_editable', 'bigbluebuttonbn'),
|
|
|
377 |
get_string('config_recording_hide_button_editable_description', 'bigbluebuttonbn'),
|
|
|
378 |
|
|
|
379 |
);
|
|
|
380 |
$this->add_conditional_element(
|
|
|
381 |
'recording_hide_button_editable',
|
|
|
382 |
$item,
|
|
|
383 |
$recordingsetting
|
|
|
384 |
);
|
|
|
385 |
$recordingsafeformat = [
|
|
|
386 |
'notes' => get_string('view_recording_format_notes', 'mod_bigbluebuttonbn'),
|
|
|
387 |
'podcast' => get_string('view_recording_format_podcast', 'mod_bigbluebuttonbn'),
|
|
|
388 |
'presentation' => get_string('view_recording_format_presentation', 'mod_bigbluebuttonbn'),
|
|
|
389 |
'screenshare' => get_string('view_recording_format_screenshare', 'mod_bigbluebuttonbn'),
|
|
|
390 |
'statistics' => get_string('view_recording_format_statistics', 'mod_bigbluebuttonbn'),
|
|
|
391 |
'video' => get_string('view_recording_format_video', 'mod_bigbluebuttonbn'),
|
|
|
392 |
];
|
|
|
393 |
$item = new admin_setting_configmultiselect(
|
|
|
394 |
'bigbluebuttonbn_recording_safe_formats',
|
|
|
395 |
get_string('config_recording_safe_formats', 'mod_bigbluebuttonbn'),
|
|
|
396 |
get_string('config_recording_safe_formats_description', 'mod_bigbluebuttonbn'),
|
|
|
397 |
['video', 'presentation'],
|
|
|
398 |
$recordingsafeformat
|
|
|
399 |
);
|
|
|
400 |
$this->add_conditional_element(
|
|
|
401 |
'recording_hide_button_editable',
|
|
|
402 |
$item,
|
|
|
403 |
$recordingsetting
|
|
|
404 |
);
|
|
|
405 |
}
|
|
|
406 |
$this->admin->add($this->parent, $recordingsetting);
|
|
|
407 |
}
|
|
|
408 |
|
|
|
409 |
/**
|
|
|
410 |
* Helper function renders import recording settings if the feature is enabled.
|
|
|
411 |
*/
|
|
|
412 |
protected function add_importrecordings_settings(): void {
|
|
|
413 |
// Configuration for 'import recordings' feature.
|
|
|
414 |
$importrecordingsettings = new admin_settingpage(
|
|
|
415 |
"{$this->sectionnameprefix}_importrecording",
|
|
|
416 |
get_string('config_importrecordings', 'bigbluebuttonbn'),
|
|
|
417 |
'moodle/site:config',
|
|
|
418 |
!((boolean) setting_validator::section_import_recordings_shown()) && ($this->moduleenabled)
|
|
|
419 |
);
|
|
|
420 |
|
|
|
421 |
if ($this->admin->fulltree) {
|
|
|
422 |
$item = new admin_setting_heading(
|
|
|
423 |
'bigbluebuttonbn_config_importrecordings',
|
|
|
424 |
'',
|
|
|
425 |
get_string('config_importrecordings_description', 'bigbluebuttonbn')
|
|
|
426 |
);
|
|
|
427 |
$importrecordingsettings->add($item);
|
|
|
428 |
$item = new admin_setting_configcheckbox(
|
|
|
429 |
'bigbluebuttonbn_importrecordings_enabled',
|
|
|
430 |
get_string('config_importrecordings_enabled', 'bigbluebuttonbn'),
|
|
|
431 |
get_string('config_importrecordings_enabled_description', 'bigbluebuttonbn'),
|
|
|
432 |
|
|
|
433 |
);
|
|
|
434 |
$this->add_conditional_element(
|
|
|
435 |
'importrecordings_enabled',
|
|
|
436 |
$item,
|
|
|
437 |
$importrecordingsettings
|
|
|
438 |
);
|
|
|
439 |
$item = new admin_setting_configcheckbox(
|
|
|
440 |
'bigbluebuttonbn_importrecordings_from_deleted_enabled',
|
|
|
441 |
get_string('config_importrecordings_from_deleted_enabled', 'bigbluebuttonbn'),
|
|
|
442 |
get_string('config_importrecordings_from_deleted_enabled_description', 'bigbluebuttonbn'),
|
|
|
443 |
|
|
|
444 |
);
|
|
|
445 |
$this->add_conditional_element(
|
|
|
446 |
'importrecordings_from_deleted_enabled',
|
|
|
447 |
$item,
|
|
|
448 |
$importrecordingsettings
|
|
|
449 |
);
|
|
|
450 |
}
|
|
|
451 |
$this->admin->add($this->parent, $importrecordingsettings);
|
|
|
452 |
}
|
|
|
453 |
|
|
|
454 |
/**
|
|
|
455 |
* Helper function renders show recording settings if the feature is enabled.
|
|
|
456 |
*/
|
|
|
457 |
protected function add_showrecordings_settings(): void {
|
|
|
458 |
// Configuration for 'show recordings' feature.
|
|
|
459 |
$showrecordingsettings = new admin_settingpage(
|
|
|
460 |
"{$this->sectionnameprefix}_showrecordings",
|
|
|
461 |
get_string('config_recordings', 'bigbluebuttonbn'),
|
|
|
462 |
'moodle/site:config',
|
|
|
463 |
!((boolean) setting_validator::section_show_recordings_shown()) && ($this->moduleenabled)
|
|
|
464 |
);
|
|
|
465 |
|
|
|
466 |
if ($this->admin->fulltree) {
|
|
|
467 |
$item = new admin_setting_heading(
|
|
|
468 |
'bigbluebuttonbn_config_recordings',
|
|
|
469 |
'',
|
|
|
470 |
get_string('config_recordings_description', 'bigbluebuttonbn')
|
|
|
471 |
);
|
|
|
472 |
$showrecordingsettings->add($item);
|
|
|
473 |
$item = new admin_setting_configcheckbox(
|
|
|
474 |
'bigbluebuttonbn_recordings_deleted_default',
|
|
|
475 |
get_string('config_recordings_deleted_default', 'bigbluebuttonbn'),
|
|
|
476 |
get_string('config_recordings_deleted_default_description', 'bigbluebuttonbn'),
|
|
|
477 |
1
|
|
|
478 |
);
|
|
|
479 |
$this->add_conditional_element(
|
|
|
480 |
'recordings_deleted_default',
|
|
|
481 |
$item,
|
|
|
482 |
$showrecordingsettings
|
|
|
483 |
);
|
|
|
484 |
$item = new admin_setting_configcheckbox(
|
|
|
485 |
'bigbluebuttonbn_recordings_deleted_editable',
|
|
|
486 |
get_string('config_recordings_deleted_editable', 'bigbluebuttonbn'),
|
|
|
487 |
get_string('config_recordings_deleted_editable_description', 'bigbluebuttonbn'),
|
|
|
488 |
|
|
|
489 |
);
|
|
|
490 |
$this->add_conditional_element(
|
|
|
491 |
'recordings_deleted_editable',
|
|
|
492 |
$item,
|
|
|
493 |
$showrecordingsettings
|
|
|
494 |
);
|
|
|
495 |
$item = new admin_setting_configcheckbox(
|
|
|
496 |
'bigbluebuttonbn_recordings_imported_default',
|
|
|
497 |
get_string('config_recordings_imported_default', 'bigbluebuttonbn'),
|
|
|
498 |
get_string('config_recordings_imported_default_description', 'bigbluebuttonbn'),
|
|
|
499 |
|
|
|
500 |
);
|
|
|
501 |
$this->add_conditional_element(
|
|
|
502 |
'recordings_imported_default',
|
|
|
503 |
$item,
|
|
|
504 |
$showrecordingsettings
|
|
|
505 |
);
|
|
|
506 |
$item = new admin_setting_configcheckbox(
|
|
|
507 |
'bigbluebuttonbn_recordings_imported_editable',
|
|
|
508 |
get_string('config_recordings_imported_editable', 'bigbluebuttonbn'),
|
|
|
509 |
get_string('config_recordings_imported_editable_description', 'bigbluebuttonbn'),
|
|
|
510 |
1
|
|
|
511 |
);
|
|
|
512 |
$this->add_conditional_element(
|
|
|
513 |
'recordings_imported_editable',
|
|
|
514 |
$item,
|
|
|
515 |
$showrecordingsettings
|
|
|
516 |
);
|
|
|
517 |
$item = new admin_setting_configcheckbox(
|
|
|
518 |
'bigbluebuttonbn_recordings_preview_default',
|
|
|
519 |
get_string('config_recordings_preview_default', 'bigbluebuttonbn'),
|
|
|
520 |
get_string('config_recordings_preview_default_description', 'bigbluebuttonbn'),
|
|
|
521 |
1
|
|
|
522 |
);
|
|
|
523 |
$this->add_conditional_element(
|
|
|
524 |
'recordings_preview_default',
|
|
|
525 |
$item,
|
|
|
526 |
$showrecordingsettings
|
|
|
527 |
);
|
|
|
528 |
$item = new admin_setting_configcheckbox(
|
|
|
529 |
'bigbluebuttonbn_recordings_preview_editable',
|
|
|
530 |
get_string('config_recordings_preview_editable', 'bigbluebuttonbn'),
|
|
|
531 |
get_string('config_recordings_preview_editable_description', 'bigbluebuttonbn'),
|
|
|
532 |
|
|
|
533 |
);
|
|
|
534 |
$this->add_conditional_element(
|
|
|
535 |
'recordings_preview_editable',
|
|
|
536 |
$item,
|
|
|
537 |
$showrecordingsettings
|
|
|
538 |
);
|
|
|
539 |
$item = new admin_setting_configcheckbox(
|
|
|
540 |
'bigbluebuttonbn_recordings_asc_sort',
|
|
|
541 |
get_string('config_recordings_asc_sort', 'bigbluebuttonbn'),
|
|
|
542 |
get_string('config_recordings_asc_sort_description', 'bigbluebuttonbn'),
|
|
|
543 |
|
|
|
544 |
);
|
|
|
545 |
$this->add_conditional_element(
|
|
|
546 |
'recordings_asc_sort',
|
|
|
547 |
$item,
|
|
|
548 |
$showrecordingsettings
|
|
|
549 |
);
|
|
|
550 |
$item = new admin_setting_configcheckbox(
|
|
|
551 |
'bigbluebuttonbn_recording_protect_editable',
|
|
|
552 |
get_string('config_recording_protect_editable', 'bigbluebuttonbn'),
|
|
|
553 |
get_string('config_recording_protect_editable_description', 'bigbluebuttonbn'),
|
|
|
554 |
1
|
|
|
555 |
);
|
|
|
556 |
$this->add_conditional_element(
|
|
|
557 |
'recording_protect_editable',
|
|
|
558 |
$item,
|
|
|
559 |
$showrecordingsettings
|
|
|
560 |
);
|
|
|
561 |
}
|
|
|
562 |
$this->admin->add($this->parent, $showrecordingsettings);
|
|
|
563 |
}
|
|
|
564 |
|
|
|
565 |
/**
|
|
|
566 |
* Helper function renders wait for moderator settings if the feature is enabled.
|
|
|
567 |
*/
|
|
|
568 |
protected function add_waitmoderator_settings(): void {
|
|
|
569 |
// Configuration for wait for moderator feature.
|
|
|
570 |
$waitmoderatorsettings = new admin_settingpage(
|
|
|
571 |
"{$this->sectionnameprefix}_waitformoderator",
|
|
|
572 |
get_string('config_waitformoderator', 'bigbluebuttonbn'),
|
|
|
573 |
'moodle/site:config',
|
|
|
574 |
!((boolean) setting_validator::section_wait_moderator_shown()) && ($this->moduleenabled)
|
|
|
575 |
);
|
|
|
576 |
|
|
|
577 |
if ($this->admin->fulltree) {
|
|
|
578 |
$item = new admin_setting_heading(
|
|
|
579 |
'bigbluebuttonbn_config_waitformoderator',
|
|
|
580 |
'',
|
|
|
581 |
get_string('config_waitformoderator_description', 'bigbluebuttonbn')
|
|
|
582 |
);
|
|
|
583 |
$waitmoderatorsettings->add($item);
|
|
|
584 |
$item = new admin_setting_configcheckbox(
|
|
|
585 |
'bigbluebuttonbn_waitformoderator_default',
|
|
|
586 |
get_string('config_waitformoderator_default', 'bigbluebuttonbn'),
|
|
|
587 |
get_string('config_waitformoderator_default_description', 'bigbluebuttonbn'),
|
|
|
588 |
|
|
|
589 |
);
|
|
|
590 |
$this->add_conditional_element(
|
|
|
591 |
'waitformoderator_default',
|
|
|
592 |
$item,
|
|
|
593 |
$waitmoderatorsettings
|
|
|
594 |
);
|
|
|
595 |
$item = new admin_setting_configcheckbox(
|
|
|
596 |
'bigbluebuttonbn_waitformoderator_editable',
|
|
|
597 |
get_string('config_waitformoderator_editable', 'bigbluebuttonbn'),
|
|
|
598 |
get_string('config_waitformoderator_editable_description', 'bigbluebuttonbn'),
|
|
|
599 |
1
|
|
|
600 |
);
|
|
|
601 |
$this->add_conditional_element(
|
|
|
602 |
'waitformoderator_editable',
|
|
|
603 |
$item,
|
|
|
604 |
$waitmoderatorsettings
|
|
|
605 |
);
|
|
|
606 |
$item = new admin_setting_configtext(
|
|
|
607 |
'bigbluebuttonbn_waitformoderator_ping_interval',
|
|
|
608 |
get_string('config_waitformoderator_ping_interval', 'bigbluebuttonbn'),
|
|
|
609 |
get_string('config_waitformoderator_ping_interval_description', 'bigbluebuttonbn'),
|
|
|
610 |
10,
|
|
|
611 |
PARAM_INT
|
|
|
612 |
);
|
|
|
613 |
$this->add_conditional_element(
|
|
|
614 |
'waitformoderator_ping_interval',
|
|
|
615 |
$item,
|
|
|
616 |
$waitmoderatorsettings
|
|
|
617 |
);
|
|
|
618 |
$item = new admin_setting_configtext(
|
|
|
619 |
'bigbluebuttonbn_waitformoderator_cache_ttl',
|
|
|
620 |
get_string('config_waitformoderator_cache_ttl', 'bigbluebuttonbn'),
|
|
|
621 |
get_string('config_waitformoderator_cache_ttl_description', 'bigbluebuttonbn'),
|
|
|
622 |
60,
|
|
|
623 |
PARAM_INT
|
|
|
624 |
);
|
|
|
625 |
$this->add_conditional_element(
|
|
|
626 |
'waitformoderator_cache_ttl',
|
|
|
627 |
$item,
|
|
|
628 |
$waitmoderatorsettings
|
|
|
629 |
);
|
|
|
630 |
}
|
|
|
631 |
$this->admin->add($this->parent, $waitmoderatorsettings);
|
|
|
632 |
}
|
|
|
633 |
|
|
|
634 |
/**
|
|
|
635 |
* Helper function renders static voice bridge settings if the feature is enabled.
|
|
|
636 |
*/
|
|
|
637 |
protected function add_voicebridge_settings(): void {
|
|
|
638 |
// Configuration for "static voice bridge" feature.
|
|
|
639 |
$voicebridgesettings = new admin_settingpage(
|
|
|
640 |
"{$this->sectionnameprefix}_voicebridge",
|
|
|
641 |
get_string('config_voicebridge', 'bigbluebuttonbn'),
|
|
|
642 |
'moodle/site:config',
|
|
|
643 |
!((boolean) setting_validator::section_static_voice_bridge_shown()) && ($this->moduleenabled)
|
|
|
644 |
);
|
|
|
645 |
|
|
|
646 |
if ($this->admin->fulltree) {
|
|
|
647 |
$item = new admin_setting_heading(
|
|
|
648 |
'bigbluebuttonbn_config_voicebridge',
|
|
|
649 |
'',
|
|
|
650 |
get_string('config_voicebridge_description', 'bigbluebuttonbn')
|
|
|
651 |
);
|
|
|
652 |
$voicebridgesettings->add($item);
|
|
|
653 |
$item = new admin_setting_configcheckbox(
|
|
|
654 |
'bigbluebuttonbn_voicebridge_editable',
|
|
|
655 |
get_string('config_voicebridge_editable', 'bigbluebuttonbn'),
|
|
|
656 |
get_string('config_voicebridge_editable_description', 'bigbluebuttonbn'),
|
|
|
657 |
|
|
|
658 |
);
|
|
|
659 |
$this->add_conditional_element(
|
|
|
660 |
'voicebridge_editable',
|
|
|
661 |
$item,
|
|
|
662 |
$voicebridgesettings
|
|
|
663 |
);
|
|
|
664 |
}
|
|
|
665 |
$this->admin->add($this->parent, $voicebridgesettings);
|
|
|
666 |
}
|
|
|
667 |
|
|
|
668 |
/**
|
|
|
669 |
* Helper function renders preuploaded presentation settings if the feature is enabled.
|
|
|
670 |
*/
|
|
|
671 |
protected function add_preupload_settings(): void {
|
|
|
672 |
// Configuration for "preupload presentation" feature.
|
|
|
673 |
$preuploadsettings = new admin_settingpage(
|
|
|
674 |
"{$this->sectionnameprefix}_preupload",
|
|
|
675 |
get_string('config_preuploadpresentation', 'bigbluebuttonbn'),
|
|
|
676 |
'moodle/site:config',
|
|
|
677 |
!((boolean) setting_validator::section_preupload_presentation_shown()) && ($this->moduleenabled)
|
|
|
678 |
);
|
|
|
679 |
|
|
|
680 |
if ($this->admin->fulltree) {
|
|
|
681 |
// This feature only works if curl is installed (but it is as now required by Moodle). The checks have been removed.
|
|
|
682 |
$item = new admin_setting_heading(
|
|
|
683 |
'bigbluebuttonbn_config_preuploadpresentation',
|
|
|
684 |
'',
|
|
|
685 |
get_string('config_preuploadpresentation_description', 'bigbluebuttonbn')
|
|
|
686 |
);
|
|
|
687 |
$preuploadsettings->add($item);
|
|
|
688 |
|
|
|
689 |
$item = new admin_setting_configcheckbox(
|
|
|
690 |
'bigbluebuttonbn_preuploadpresentation_editable',
|
|
|
691 |
get_string('config_preuploadpresentation_editable', 'bigbluebuttonbn'),
|
|
|
692 |
get_string('config_preuploadpresentation_editable_description', 'bigbluebuttonbn'),
|
|
|
693 |
|
|
|
694 |
);
|
|
|
695 |
$this->add_conditional_element(
|
|
|
696 |
'preuploadpresentation_editable',
|
|
|
697 |
$item,
|
|
|
698 |
$preuploadsettings
|
|
|
699 |
);
|
|
|
700 |
// Note: checks on curl library have been removed as it is a requirement from Moodle.
|
|
|
701 |
$filemanageroptions = [];
|
|
|
702 |
$filemanageroptions['accepted_types'] = '*';
|
|
|
703 |
$filemanageroptions['maxbytes'] = 0;
|
|
|
704 |
$filemanageroptions['subdirs'] = 0;
|
|
|
705 |
$filemanageroptions['maxfiles'] = 1;
|
|
|
706 |
$filemanageroptions['mainfile'] = true;
|
|
|
707 |
|
|
|
708 |
$filemanager = new admin_setting_configstoredfile(
|
|
|
709 |
'mod_bigbluebuttonbn/presentationdefault',
|
|
|
710 |
get_string('config_presentation_default', 'bigbluebuttonbn'),
|
|
|
711 |
get_string('config_presentation_default_description', 'bigbluebuttonbn'),
|
|
|
712 |
'presentationdefault',
|
|
|
713 |
0,
|
|
|
714 |
$filemanageroptions
|
|
|
715 |
);
|
|
|
716 |
|
|
|
717 |
$preuploadsettings->add($filemanager);
|
|
|
718 |
}
|
|
|
719 |
$this->admin->add($this->parent, $preuploadsettings);
|
|
|
720 |
}
|
|
|
721 |
|
|
|
722 |
/**
|
|
|
723 |
* Helper function renders userlimit settings if the feature is enabled.
|
|
|
724 |
*/
|
|
|
725 |
protected function add_userlimit_settings(): void {
|
|
|
726 |
$userlimitsettings = new admin_settingpage(
|
|
|
727 |
"{$this->sectionnameprefix}_userlimit",
|
|
|
728 |
get_string('config_userlimit', 'bigbluebuttonbn'),
|
|
|
729 |
'moodle/site:config',
|
|
|
730 |
!((boolean) setting_validator::section_user_limit_shown()) && ($this->moduleenabled)
|
|
|
731 |
);
|
|
|
732 |
|
|
|
733 |
if ($this->admin->fulltree) {
|
|
|
734 |
// Configuration for "user limit" feature.
|
|
|
735 |
$item = new admin_setting_heading(
|
|
|
736 |
'bigbluebuttonbn_config_userlimit',
|
|
|
737 |
'',
|
|
|
738 |
get_string('config_userlimit_description', 'bigbluebuttonbn')
|
|
|
739 |
);
|
|
|
740 |
$userlimitsettings->add($item);
|
|
|
741 |
$item = new admin_setting_configtext(
|
|
|
742 |
'bigbluebuttonbn_userlimit_default',
|
|
|
743 |
get_string('config_userlimit_default', 'bigbluebuttonbn'),
|
|
|
744 |
get_string('config_userlimit_default_description', 'bigbluebuttonbn'),
|
|
|
745 |
0,
|
|
|
746 |
PARAM_INT
|
|
|
747 |
);
|
|
|
748 |
$this->add_conditional_element(
|
|
|
749 |
'userlimit_default',
|
|
|
750 |
$item,
|
|
|
751 |
$userlimitsettings
|
|
|
752 |
);
|
|
|
753 |
$item = new admin_setting_configcheckbox(
|
|
|
754 |
'bigbluebuttonbn_userlimit_editable',
|
|
|
755 |
get_string('config_userlimit_editable', 'bigbluebuttonbn'),
|
|
|
756 |
get_string('config_userlimit_editable_description', 'bigbluebuttonbn'),
|
|
|
757 |
|
|
|
758 |
);
|
|
|
759 |
$this->add_conditional_element(
|
|
|
760 |
'userlimit_editable',
|
|
|
761 |
$item,
|
|
|
762 |
$userlimitsettings
|
|
|
763 |
);
|
|
|
764 |
}
|
|
|
765 |
$this->admin->add($this->parent, $userlimitsettings);
|
|
|
766 |
}
|
|
|
767 |
|
|
|
768 |
/**
|
|
|
769 |
* Helper function renders participant settings if the feature is enabled.
|
|
|
770 |
*/
|
|
|
771 |
protected function add_participants_settings(): void {
|
|
|
772 |
// Configuration for defining the default role/user that will be moderator on new activities.
|
|
|
773 |
$participantsettings = new admin_settingpage(
|
|
|
774 |
"{$this->sectionnameprefix}_participant",
|
|
|
775 |
get_string('config_participant', 'bigbluebuttonbn'),
|
|
|
776 |
'moodle/site:config',
|
|
|
777 |
!((boolean) setting_validator::section_moderator_default_shown()) && ($this->moduleenabled)
|
|
|
778 |
);
|
|
|
779 |
|
|
|
780 |
if ($this->admin->fulltree) {
|
|
|
781 |
$item = new admin_setting_heading(
|
|
|
782 |
'bigbluebuttonbn_config_participant',
|
|
|
783 |
'',
|
|
|
784 |
get_string('config_participant_description', 'bigbluebuttonbn')
|
|
|
785 |
);
|
|
|
786 |
$participantsettings->add($item);
|
|
|
787 |
|
|
|
788 |
// UI for 'participants' feature.
|
|
|
789 |
$roles = roles::get_roles(null, false);
|
|
|
790 |
$owner = [
|
|
|
791 |
'0' => get_string('mod_form_field_participant_list_type_owner', 'bigbluebuttonbn')
|
|
|
792 |
];
|
|
|
793 |
$item = new admin_setting_configmultiselect(
|
|
|
794 |
'bigbluebuttonbn_participant_moderator_default',
|
|
|
795 |
get_string('config_participant_moderator_default', 'bigbluebuttonbn'),
|
|
|
796 |
get_string('config_participant_moderator_default_description', 'bigbluebuttonbn'),
|
|
|
797 |
array_keys($owner),
|
|
|
798 |
$owner + $roles
|
|
|
799 |
);
|
|
|
800 |
$this->add_conditional_element(
|
|
|
801 |
'participant_moderator_default',
|
|
|
802 |
$item,
|
|
|
803 |
$participantsettings
|
|
|
804 |
);
|
|
|
805 |
}
|
|
|
806 |
$this->admin->add($this->parent, $participantsettings);
|
|
|
807 |
}
|
|
|
808 |
|
|
|
809 |
/**
|
|
|
810 |
* Helper function renders general settings if the feature is enabled.
|
|
|
811 |
*/
|
|
|
812 |
protected function add_muteonstart_settings(): void {
|
|
|
813 |
// Configuration for BigBlueButton.
|
|
|
814 |
$muteonstartsetting = new admin_settingpage(
|
|
|
815 |
"{$this->sectionnameprefix}_muteonstart",
|
|
|
816 |
get_string('config_muteonstart', 'bigbluebuttonbn'),
|
|
|
817 |
'moodle/site:config',
|
|
|
818 |
!((boolean) setting_validator::section_muteonstart_shown()) && ($this->moduleenabled)
|
|
|
819 |
);
|
|
|
820 |
|
|
|
821 |
if ($this->admin->fulltree) {
|
|
|
822 |
$item = new admin_setting_heading(
|
|
|
823 |
'bigbluebuttonbn_config_muteonstart',
|
|
|
824 |
'',
|
|
|
825 |
get_string('config_muteonstart_description', 'bigbluebuttonbn')
|
|
|
826 |
);
|
|
|
827 |
$muteonstartsetting->add($item);
|
|
|
828 |
$item = new admin_setting_configcheckbox(
|
|
|
829 |
'bigbluebuttonbn_muteonstart_default',
|
|
|
830 |
get_string('config_muteonstart_default', 'bigbluebuttonbn'),
|
|
|
831 |
get_string('config_muteonstart_default_description', 'bigbluebuttonbn'),
|
|
|
832 |
|
|
|
833 |
);
|
|
|
834 |
$this->add_conditional_element(
|
|
|
835 |
'muteonstart_default',
|
|
|
836 |
$item,
|
|
|
837 |
$muteonstartsetting
|
|
|
838 |
);
|
|
|
839 |
$item = new admin_setting_configcheckbox(
|
|
|
840 |
'bigbluebuttonbn_muteonstart_editable',
|
|
|
841 |
get_string('config_muteonstart_editable', 'bigbluebuttonbn'),
|
|
|
842 |
get_string('config_muteonstart_editable_description', 'bigbluebuttonbn'),
|
|
|
843 |
|
|
|
844 |
);
|
|
|
845 |
$this->add_conditional_element(
|
|
|
846 |
'muteonstart_editable',
|
|
|
847 |
$item,
|
|
|
848 |
$muteonstartsetting
|
|
|
849 |
);
|
|
|
850 |
}
|
|
|
851 |
$this->admin->add($this->parent, $muteonstartsetting);
|
|
|
852 |
}
|
|
|
853 |
|
|
|
854 |
/**
|
|
|
855 |
* Helper function to render lock settings.
|
|
|
856 |
*/
|
|
|
857 |
protected function add_lock_settings(): void {
|
|
|
858 |
$lockingsetting = new admin_settingpage(
|
|
|
859 |
"{$this->sectionnameprefix}_locksettings",
|
|
|
860 |
get_string('config_locksettings', 'bigbluebuttonbn'),
|
|
|
861 |
'moodle/site:config',
|
|
|
862 |
!((boolean) setting_validator::section_lock_shown()) && ($this->moduleenabled)
|
|
|
863 |
);
|
|
|
864 |
// Configuration for various lock settings for meetings.
|
|
|
865 |
if ($this->admin->fulltree) {
|
|
|
866 |
$this->add_lock_setting_from_name('disablecam', $lockingsetting);
|
|
|
867 |
$this->add_lock_setting_from_name('disablemic', $lockingsetting);
|
|
|
868 |
$this->add_lock_setting_from_name('disableprivatechat', $lockingsetting);
|
|
|
869 |
$this->add_lock_setting_from_name('disablepublicchat', $lockingsetting);
|
|
|
870 |
$this->add_lock_setting_from_name('disablenote', $lockingsetting);
|
|
|
871 |
$this->add_lock_setting_from_name('hideuserlist', $lockingsetting);
|
|
|
872 |
}
|
|
|
873 |
$this->admin->add($this->parent, $lockingsetting);
|
|
|
874 |
}
|
|
|
875 |
|
|
|
876 |
/**
|
|
|
877 |
* Helper function renders setting if the feature is enabled.
|
|
|
878 |
*
|
|
|
879 |
* @param string $settingname
|
|
|
880 |
* @param admin_settingpage $lockingsetting The parent settingpage to add to
|
|
|
881 |
*/
|
|
|
882 |
protected function add_lock_setting_from_name(string $settingname, admin_settingpage $lockingsetting): void {
|
|
|
883 |
$validatorname = "section_{$settingname}_shown";
|
|
|
884 |
if ((boolean) setting_validator::$validatorname()) {
|
|
|
885 |
// Configuration for BigBlueButton.
|
|
|
886 |
$item = new admin_setting_configcheckbox(
|
|
|
887 |
'bigbluebuttonbn_' . $settingname . '_default',
|
|
|
888 |
get_string('config_' . $settingname . '_default', 'bigbluebuttonbn'),
|
|
|
889 |
get_string('config_' . $settingname . '_default_description', 'bigbluebuttonbn'),
|
|
|
890 |
config::defaultvalue($settingname . '_default')
|
|
|
891 |
);
|
|
|
892 |
$this->add_conditional_element(
|
|
|
893 |
$settingname . '_default',
|
|
|
894 |
$item,
|
|
|
895 |
$lockingsetting
|
|
|
896 |
);
|
|
|
897 |
$item = new admin_setting_configcheckbox(
|
|
|
898 |
'bigbluebuttonbn_' . $settingname . '_editable',
|
|
|
899 |
get_string('config_' . $settingname . '_editable', 'bigbluebuttonbn'),
|
|
|
900 |
get_string('config_' . $settingname . '_editable_description', 'bigbluebuttonbn'),
|
|
|
901 |
config::defaultvalue($settingname . '_editable')
|
|
|
902 |
);
|
|
|
903 |
$this->add_conditional_element(
|
|
|
904 |
$settingname . '_editable',
|
|
|
905 |
$item,
|
|
|
906 |
$lockingsetting
|
|
|
907 |
);
|
|
|
908 |
}
|
|
|
909 |
}
|
|
|
910 |
|
|
|
911 |
/**
|
|
|
912 |
* Helper function renders extended settings if any of the features there is enabled.
|
|
|
913 |
*/
|
|
|
914 |
protected function add_extended_settings(): void {
|
|
|
915 |
// Configuration for extended capabilities.
|
|
|
916 |
$extendedcapabilitiessetting = new admin_settingpage(
|
|
|
917 |
"{$this->sectionnameprefix}_extendedcapabilities",
|
|
|
918 |
get_string('config_extended_capabilities', 'bigbluebuttonbn'),
|
|
|
919 |
'moodle/site:config',
|
|
|
920 |
!((boolean) setting_validator::section_settings_extended_shown()) && ($this->moduleenabled)
|
|
|
921 |
);
|
|
|
922 |
|
|
|
923 |
if ($this->admin->fulltree) {
|
|
|
924 |
$item = new admin_setting_heading(
|
|
|
925 |
'bigbluebuttonbn_config_extended_capabilities',
|
|
|
926 |
'',
|
|
|
927 |
get_string('config_extended_capabilities_description', 'bigbluebuttonbn')
|
|
|
928 |
);
|
|
|
929 |
$extendedcapabilitiessetting->add($item);
|
|
|
930 |
// UI for 'notify users when recording ready' feature.
|
|
|
931 |
$item = new admin_setting_configcheckbox(
|
|
|
932 |
'bigbluebuttonbn_recordingready_enabled',
|
|
|
933 |
get_string('config_recordingready_enabled', 'bigbluebuttonbn'),
|
|
|
934 |
get_string('config_recordingready_enabled_description', 'bigbluebuttonbn'),
|
|
|
935 |
|
|
|
936 |
);
|
|
|
937 |
$this->add_conditional_element(
|
|
|
938 |
'recordingready_enabled',
|
|
|
939 |
$item,
|
|
|
940 |
$extendedcapabilitiessetting
|
|
|
941 |
);
|
|
|
942 |
$item = new admin_setting_configcheckbox(
|
|
|
943 |
'bigbluebuttonbn_profile_picture_enabled',
|
|
|
944 |
get_string('config_profile_picture_enabled', 'bigbluebuttonbn'),
|
|
|
945 |
get_string('config_profile_picture_enabled_description', 'bigbluebuttonbn'),
|
|
|
946 |
false
|
|
|
947 |
);
|
|
|
948 |
$this->add_conditional_element(
|
|
|
949 |
'profile_picture_enabled',
|
|
|
950 |
$item,
|
|
|
951 |
$extendedcapabilitiessetting
|
|
|
952 |
);
|
|
|
953 |
}
|
|
|
954 |
$this->admin->add($this->parent, $extendedcapabilitiessetting);
|
|
|
955 |
// Configuration for extended BN capabilities should go here.
|
|
|
956 |
}
|
|
|
957 |
|
|
|
958 |
/**
|
|
|
959 |
* Helper function renders experimental settings if any of the features there is enabled.
|
|
|
960 |
*/
|
|
|
961 |
protected function add_experimental_settings(): void {
|
|
|
962 |
// Configuration for experimental features should go here.
|
|
|
963 |
$experimentalfeaturessetting = new admin_settingpage(
|
|
|
964 |
"{$this->sectionnameprefix}_experimentalfeatures",
|
|
|
965 |
get_string('config_experimental_features', 'bigbluebuttonbn'),
|
|
|
966 |
'moodle/site:config',
|
|
|
967 |
!((boolean) setting_validator::section_settings_extended_shown()) && ($this->moduleenabled)
|
|
|
968 |
);
|
|
|
969 |
|
|
|
970 |
if ($this->admin->fulltree) {
|
|
|
971 |
$item = new admin_setting_heading(
|
|
|
972 |
'bigbluebuttonbn_config_experimental_features',
|
|
|
973 |
'',
|
|
|
974 |
get_string('config_experimental_features_description', 'bigbluebuttonbn')
|
|
|
975 |
);
|
|
|
976 |
$experimentalfeaturessetting->add($item);
|
|
|
977 |
// UI for 'register meeting events' feature.
|
|
|
978 |
$item = new admin_setting_configcheckbox(
|
|
|
979 |
'bigbluebuttonbn_meetingevents_enabled',
|
|
|
980 |
get_string('config_meetingevents_enabled', 'bigbluebuttonbn'),
|
|
|
981 |
get_string('config_meetingevents_enabled_description', 'bigbluebuttonbn'),
|
|
|
982 |
|
|
|
983 |
);
|
|
|
984 |
$this->add_conditional_element(
|
|
|
985 |
'meetingevents_enabled',
|
|
|
986 |
$item,
|
|
|
987 |
$experimentalfeaturessetting
|
|
|
988 |
);
|
|
|
989 |
// UI for 'register meeting events' feature.
|
|
|
990 |
$item = new admin_setting_configcheckbox(
|
|
|
991 |
'bigbluebuttonbn_guestaccess_enabled',
|
|
|
992 |
get_string('config_guestaccess_enabled', 'bigbluebuttonbn'),
|
|
|
993 |
get_string('config_guestaccess_enabled_description', 'bigbluebuttonbn'),
|
|
|
994 |
|
|
|
995 |
);
|
|
|
996 |
$this->add_conditional_element(
|
|
|
997 |
'guestaccess_enabled',
|
|
|
998 |
$item,
|
|
|
999 |
$experimentalfeaturessetting
|
|
|
1000 |
);
|
|
|
1001 |
}
|
|
|
1002 |
$this->admin->add($this->parent, $experimentalfeaturessetting);
|
|
|
1003 |
}
|
|
|
1004 |
|
|
|
1005 |
/**
|
|
|
1006 |
* Process reset cache.
|
|
|
1007 |
*/
|
|
|
1008 |
protected function reset_cache() {
|
|
|
1009 |
// Reset serverinfo cache.
|
|
|
1010 |
cache_helper::purge_by_event('mod_bigbluebuttonbn/serversettingschanged');
|
|
|
1011 |
}
|
|
|
1012 |
}
|