@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | protected function init() { |
36 | 36 | parent::init(); |
37 | - $this->description = "The user with id '$this->userid' has deleted a recording with id ". |
|
37 | + $this->description = "The user with id '$this->userid' has deleted a recording with id " . |
|
38 | 38 | "'$this->other' from the course id '$this->contextinstanceid'."; |
39 | 39 | } |
40 | 40 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | protected function init() { |
36 | 36 | parent::init(); |
37 | - $this->description = "The user with id '$this->userid' has viewed a recording with id ". |
|
37 | + $this->description = "The user with id '$this->userid' has viewed a recording with id " . |
|
38 | 38 | "'$this->other' from the course id '$this->contextinstanceid'."; |
39 | 39 | } |
40 | 40 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | protected function init() { |
36 | 36 | parent::init(); |
37 | - $this->description = "The user with id '$this->userid' has protected a recording with id ". |
|
37 | + $this->description = "The user with id '$this->userid' has protected a recording with id " . |
|
38 | 38 | "'$this->other' in the course id '$this->contextinstanceid'."; |
39 | 39 | } |
40 | 40 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | protected function init() { |
36 | 36 | parent::init(); |
37 | - $this->description = "The user with id '$this->userid' has edited a recording with id ". |
|
37 | + $this->description = "The user with id '$this->userid' has edited a recording with id " . |
|
38 | 38 | "'$this->other' in the course id '$this->contextinstanceid'."; |
39 | 39 | } |
40 | 40 |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | defined('MOODLE_INTERNAL') || die(); |
28 | 28 | |
29 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
30 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
29 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
30 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
31 | 31 | |
32 | 32 | class mod_bigbluebuttonbn_mod_form extends moodleform_mod { |
33 | 33 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $serverversion = bigbluebuttonbn_get_server_version(); |
39 | 39 | if (is_null($serverversion)) { |
40 | 40 | print_error('general_error_unable_connect', 'bigbluebuttonbn', |
41 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
41 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $bigbluebuttonbn = null; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ); |
130 | 130 | $defaultvalues['presentation'] = $draftitemid; |
131 | 131 | } catch (Exception $e) { |
132 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
132 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
133 | 133 | return null; |
134 | 134 | } |
135 | 135 | } |
@@ -309,10 +309,10 @@ discard block |
||
309 | 309 | html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type', |
310 | 310 | $participantselection['type_selected'], array(), |
311 | 311 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
312 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).' '. |
|
312 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')) . ' ' . |
|
313 | 313 | html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
314 | 314 | $participantselection['selected'], array(), |
315 | - array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).' '. |
|
315 | + array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')) . ' ' . |
|
316 | 316 | html_writer::tag('input', '', array('id' => 'id_addselectionid', 'type' => 'button', 'class' => 'btn btn-secondary', |
317 | 317 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
318 | 318 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participant_add(); return 0;' |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | // Render elements for participant list. |
333 | 333 | $htmllist = html_writer::tag('div', |
334 | 334 | html_writer::label(get_string('mod_form_field_participant_list', 'bigbluebuttonbn'), |
335 | - 'bigbluebuttonbn_participant_list'). |
|
335 | + 'bigbluebuttonbn_participant_list') . |
|
336 | 336 | html_writer::table($table) |
337 | 337 | ); |
338 | 338 | |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | } |
366 | 366 | |
367 | 367 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
368 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
368 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
369 | 369 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
370 | 370 | } |
371 | 371 | if (!empty($rule)) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 'alt' => get_string('delete'), |
112 | 112 | 'title' => get_string('delete'), |
113 | 113 | 'src' => $jsvars['pix_icon_delete'] |
114 | - ); |
|
114 | + ); |
|
115 | 115 | |
116 | 116 | $jsvars['pix_icon_delete'] = html_writer::tag('img', $options); |
117 | 117 | } |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
212 | 212 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
213 | 213 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
214 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
215 | - ); |
|
214 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
215 | + ); |
|
216 | 216 | } else { |
217 | 217 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
218 | 218 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | private function bigbluebuttonbn_mform_add_block_room_recordings($mform, $cfg) { |
248 | 248 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
249 | - 'description_key' => null]; |
|
249 | + 'description_key' => null]; |
|
250 | 250 | if ($cfg['recordings_html_editable']) { |
251 | 251 | $field['type'] = 'checkbox'; |
252 | 252 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $field['description_key'], $cfg['recordings_html_default']); |
256 | 256 | |
257 | 257 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
258 | - 'description_key' => null]; |
|
258 | + 'description_key' => null]; |
|
259 | 259 | if ($cfg['recordings_deleted_editable']) { |
260 | 260 | $field['type'] = 'checkbox'; |
261 | 261 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $field['description_key'], $cfg['recordings_deleted_default']); |
265 | 265 | |
266 | 266 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
267 | - 'description_key' => null]; |
|
267 | + 'description_key' => null]; |
|
268 | 268 | if ($cfg['recordings_imported_editable']) { |
269 | 269 | $field['type'] = 'checkbox'; |
270 | 270 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type', |
320 | 320 | $participantselection['type_selected'], array(), |
321 | 321 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
322 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).' '. |
|
322 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).' '. |
|
323 | 323 | html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
324 | 324 | $participantselection['selected'], array(), |
325 | 325 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).' '. |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * recordings from a different activity even from a different course. |
95 | 95 | **/ |
96 | 96 | |
97 | - /* |
|
97 | + /* |
|
98 | 98 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
99 | 99 | * activities will have the 'import recordings' capability enabled. |
100 | 100 | */ |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * 'Join session' button enabled |
116 | 116 | **/ |
117 | 117 | |
118 | - /* |
|
118 | + /* |
|
119 | 119 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
120 | 120 | * activities will have the 'wait for moderator' capability enabled by |
121 | 121 | * default. |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * 5. CONFIGURATION FOR "STATIC VOICE BRIDGE" FEATURE |
150 | 150 | * |
151 | 151 | **/ |
152 | - /* |
|
152 | + /* |
|
153 | 153 | * A conference voice bridge number can be permanently assigned to a room |
154 | 154 | * or activity. |
155 | 155 | */ |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * 6. CONFIGURATION FOR "PRE-UPLOAD PRESENTATION" FEATURE |
160 | 160 | * |
161 | 161 | **/ |
162 | - /* |
|
162 | + /* |
|
163 | 163 | * Since version 0.8, BigBluebutton has an implementation for allowing |
164 | 164 | * preuploading presentation. When this feature is enabled, users creating or |
165 | 165 | * editing a room or activity can upload a PDF or Office document to the |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * applied to each room or activity, or globally. |
177 | 177 | **/ |
178 | 178 | |
179 | - /* |
|
179 | + /* |
|
180 | 180 | * The number of users allowed in a session by default when a new room or |
181 | 181 | * conference is added. If the number is set to 0, no limit is established. |
182 | 182 | * $CFG->bigbluebuttonbn['userlimit_default'] = 0; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * By default only the owner is assigned. |
198 | 198 | **/ |
199 | 199 | |
200 | - /* |
|
200 | + /* |
|
201 | 201 | * The values for this parameter can be 'owner' and/or any of the roles defined in |
202 | 202 | * Moodle (including the custom parameters). The value used will be the key for the role. |
203 | 203 | * [owner|manager|coursecreator|editingteacher|teacher|student|guest|user|frontpage|ANY_CUSTOM_ROLE] |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * 9. CONFIGURATION FOR "NOTIFICATION SENDING" FEATURE |
209 | 209 | * |
210 | 210 | **/ |
211 | - /* |
|
211 | + /* |
|
212 | 212 | * When the value is set to 1 (checked) the 'notification sending' |
213 | 213 | * capability can be used by the user creating or editing the room or |
214 | 214 | * activity. |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * 10. CONFIGURATION FOR "RECORDING READY" FEATURE |
223 | 223 | * |
224 | 224 | **/ |
225 | - /* |
|
225 | + /* |
|
226 | 226 | * When the value is set to 1 (checked) the 'notify users when recording ready' |
227 | 227 | * capability is enabled, meaning that a message will be sent to all enrolled |
228 | 228 | * users in a course when a recording is ready |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * 12. GENERAL CONFIGURATION FOR RECORDINGS UI |
247 | 247 | * |
248 | 248 | **/ |
249 | - /* |
|
249 | + /* |
|
250 | 250 | * When the value is set to 1 (checked) the bigbluebuttonbn resources |
251 | 251 | * will show the recodings in an html table by default. |
252 | 252 | * $CFG->bigbluebuttonbn['recordings_html_default'] = 0; |
@@ -270,13 +270,13 @@ discard block |
||
270 | 270 | * $CFG->bigbluebuttonbn['recordings_deleted_editable'] = 0; |
271 | 271 | */ |
272 | 272 | |
273 | - /* |
|
273 | + /* |
|
274 | 274 | * When the value is set to 1 (checked) the bigbluebuttonbn resources for recordings |
275 | 275 | * will show only the imported links as part of the list. |
276 | 276 | * $CFG->bigbluebuttonbn['recordings_imported_default'] = 0; |
277 | 277 | */ |
278 | 278 | |
279 | - /* |
|
279 | + /* |
|
280 | 280 | * When the value is set to 1 (checked) the 'show only imported links' |
281 | 281 | * capability can be enabled/disabled by the user creating or editing the resource for recordings. |
282 | 282 | * $CFG->bigbluebuttonbn['recordings_imported_editable'] = 1; |
@@ -371,19 +371,19 @@ discard block |
||
371 | 371 | return array( |
372 | 372 | 'status' => false, |
373 | 373 | 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn') |
374 | - ); |
|
374 | + ); |
|
375 | 375 | } |
376 | 376 | if ($realrecordings[$params['id']]['published'] !== 'true') { |
377 | 377 | return array( |
378 | 378 | 'status' => false, |
379 | 379 | 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn') |
380 | - ); |
|
380 | + ); |
|
381 | 381 | } |
382 | 382 | return array( |
383 | 383 | 'status' => bigbluebuttonbn_publish_recording_imported( |
384 | 384 | $recordings[$params['id']]['imported'], true |
385 | 385 | ) |
386 | - ); |
|
386 | + ); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | // As the recordingid was not identified as imported recording link, execute actual publish. |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | 'status' => bigbluebuttonbn_publish_recordings( |
392 | 392 | $params['id'], 'true' |
393 | 393 | ) |
394 | - ); |
|
394 | + ); |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | function bigbluebuttonbn_broker_recording_action_unprotect($params, $recordings) { |
@@ -404,19 +404,19 @@ discard block |
||
404 | 404 | return array( |
405 | 405 | 'status' => false, |
406 | 406 | 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn') |
407 | - ); |
|
407 | + ); |
|
408 | 408 | } |
409 | 409 | if ($realrecordings[$params['id']]['protected'] === 'true') { |
410 | 410 | return array( |
411 | 411 | 'status' => false, |
412 | 412 | 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn') |
413 | - ); |
|
413 | + ); |
|
414 | 414 | } |
415 | 415 | return array( |
416 | 416 | 'status' => bigbluebuttonbn_protect_recording_imported( |
417 | 417 | $recordings[$params['id']]['imported'], false |
418 | 418 | ) |
419 | - ); |
|
419 | + ); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | // As the recordingid was not identified as imported recording link, execute actual uprotect. |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | 'status' => bigbluebuttonbn_update_recordings( |
425 | 425 | $params['id'], array('protect' => 'false') |
426 | 426 | ) |
427 | - ); |
|
427 | + ); |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | function bigbluebuttonbn_broker_recording_action_unpublish($params, $recordings) { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | 'status' => bigbluebuttonbn_publish_recording_imported( |
437 | 437 | $recordings[$params['id']]['imported'], false |
438 | 438 | ) |
439 | - ); |
|
439 | + ); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | // As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | 'status' => bigbluebuttonbn_publish_recordings( |
457 | 457 | $params['id'], 'false' |
458 | 458 | ) |
459 | - ); |
|
459 | + ); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | function bigbluebuttonbn_broker_recording_action_protect($params, $recordings) { |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | 'status' => bigbluebuttonbn_protect_recording_imported( |
469 | 469 | $recordings[$params['id']]['imported'], true |
470 | 470 | ) |
471 | - ); |
|
471 | + ); |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | // As the recordingid was not identified as imported recording link, execute protect on a real recording. |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | 'status' => bigbluebuttonbn_update_recordings( |
489 | 489 | $params['id'], array('protect' => 'true') |
490 | 490 | ) |
491 | - ); |
|
491 | + ); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | function bigbluebuttonbn_broker_recording_action_delete($params, $recordings) { |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | 'status' => bigbluebuttonbn_delete_recording_imported( |
501 | 501 | $recordings[$params['id']]['imported'] |
502 | 502 | ) |
503 | - ); |
|
503 | + ); |
|
504 | 504 | } |
505 | 505 | |
506 | 506 | // As the recordingid was not identified as imported recording link, execute delete on a real recording. |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | 'status' => bigbluebuttonbn_delete_recordings( |
519 | 519 | $params['id'] |
520 | 520 | ) |
521 | - ); |
|
521 | + ); |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | function bigbluebuttonbn_broker_recording_action_edit($params, $recordings) { |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | 'status' => bigbluebuttonbn_update_recording_imported( |
529 | 529 | $recordings[$params['id']]['imported'], json_decode($params['meta'], true) |
530 | 530 | ) |
531 | - ); |
|
531 | + ); |
|
532 | 532 | } |
533 | 533 | |
534 | 534 | // As the recordingid was not identified as imported recording link, execute update on a real recording. |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | 'status' => bigbluebuttonbn_update_recordings( |
539 | 539 | $params['id'], json_decode($params['meta']) |
540 | 540 | ) |
541 | - ); |
|
541 | + ); |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | function bigbluebuttonbn_broker_recording_ready($params, $bigbluebuttonbn) { |
@@ -679,10 +679,10 @@ discard block |
||
679 | 679 | $params['recording_import'] = ['id' => 'The recordingID must be specified.']; |
680 | 680 | $params['recording_ready'] = [ |
681 | 681 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
682 | - ]; |
|
682 | + ]; |
|
683 | 683 | $params['live_session_events'] = [ |
684 | 684 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
685 | - ]; |
|
685 | + ]; |
|
686 | 686 | return $params; |
687 | 687 | } |
688 | 688 |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
23 | 23 | */ |
24 | 24 | |
25 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
26 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
25 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
26 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
27 | 27 | |
28 | 28 | use \Firebase\JWT\JWT; |
29 | 29 | |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
40 | 40 | |
41 | 41 | if (empty($params['action'])) { |
42 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
42 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
43 | 43 | return; |
44 | 44 | } |
45 | 45 | |
46 | 46 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
47 | 47 | if (!empty($error)) { |
48 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
48 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
49 | 49 | return; |
50 | 50 | } |
51 | 51 | |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | return; |
140 | 140 | } |
141 | 141 | |
142 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
142 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
143 | 143 | return; |
144 | 144 | |
145 | 145 | } catch (Exception $e) { |
146 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
146 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
147 | 147 | return; |
148 | 148 | } |
149 | 149 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
284 | 284 | $callbackresponse['status'] = true; |
285 | 285 | $callbackresponse['found'] = true; |
286 | - $callbackresponse['published'] = (string) $recording['published']; |
|
286 | + $callbackresponse['published'] = (string)$recording['published']; |
|
287 | 287 | if (!isset($params['meta'])) { |
288 | 288 | return $callbackresponse; |
289 | 289 | } |
@@ -548,8 +548,8 @@ discard block |
||
548 | 548 | $decodedparameters = JWT::decode($params['signed_parameters'], \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), |
549 | 549 | array('HS256')); |
550 | 550 | } catch (Exception $e) { |
551 | - $error = 'Caught exception: '.$e->getMessage(); |
|
552 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
551 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
552 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
553 | 553 | return; |
554 | 554 | } |
555 | 555 | |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
568 | 568 | header('HTTP/1.0 202 Accepted'); |
569 | 569 | } catch (Exception $e) { |
570 | - $error = 'Caught exception: '.$e->getMessage(); |
|
571 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
570 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
571 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
584 | 584 | if (!isset($importrecordings[$params['id']])) { |
585 | 585 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
586 | - header('HTTP/1.0 404 Not found. '.$error); |
|
586 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
587 | 587 | return; |
588 | 588 | } |
589 | 589 | |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | |
592 | 592 | $importrecordings[$params['id']]['imported'] = true; |
593 | 593 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
594 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
594 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
595 | 595 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
596 | 596 | // Moodle event logger: Create an event for recording imported. |
597 | 597 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -609,8 +609,8 @@ discard block |
||
609 | 609 | $decodedparameters = JWT::decode($params['signed_parameters'], \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), |
610 | 610 | array('HS256')); |
611 | 611 | } catch (Exception $e) { |
612 | - $error = 'Caught exception: '.$e->getMessage(); |
|
613 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
612 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
613 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
614 | 614 | return; |
615 | 615 | } |
616 | 616 | |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | |
649 | 649 | $action = strtolower($params['action']); |
650 | 650 | if (!array_key_exists($action, $requiredparams)) { |
651 | - return 'Action '.$params['action'].' can not be performed.'; |
|
651 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
652 | 652 | } |
653 | 653 | |
654 | 654 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | |
272 | 272 | echo $OUTPUT->box_start('generalbox boxaligncenter'); |
273 | 273 | echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn'). |
274 | - '</div>'; |
|
274 | + '</div>'; |
|
275 | 275 | echo $OUTPUT->box_end(); |
276 | 276 | |
277 | 277 | groups_print_activity_menu( |
278 | - $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
278 | + $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
279 | 279 | echo '<br><br>'; |
280 | 280 | } |
281 | 281 | |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | $recordings = bigbluebuttonbn_get_recordings( |
381 | 381 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
382 | 382 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
383 | - ); |
|
383 | + ); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | // Get recording links. |
387 | 387 | $recordingsimported = bigbluebuttonbn_get_recordings_imported_array( |
388 | 388 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom |
389 | - ); |
|
389 | + ); |
|
390 | 390 | |
391 | 391 | /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent |
392 | 392 | * recordings are not included. */ |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | // JavaScript variables for recordings. |
403 | 403 | $jsvars += array( |
404 | 404 | 'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1', |
405 | - ); |
|
405 | + ); |
|
406 | 406 | |
407 | 407 | // If there are meetings with recordings load the data to the table. |
408 | 408 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $jsvars += array( |
415 | 415 | 'columns' => bigbluebuttonbn_get_recording_columns($bbbsession), |
416 | 416 | 'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings), |
417 | - ); |
|
417 | + ); |
|
418 | 418 | |
419 | 419 | // Render a YUI table. |
420 | 420 | return html_writer::div('', '', array('id' => 'bigbluebuttonbn_yui_table')); |
@@ -425,10 +425,10 @@ discard block |
||
425 | 425 | |
426 | 426 | $button = html_writer::tag('input', '', |
427 | 427 | array('type' => 'button', |
428 | - 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
429 | - 'class' => 'btn btn-secondary', |
|
430 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
431 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
428 | + 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
429 | + 'class' => 'btn btn-secondary', |
|
430 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
431 | + $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
432 | 432 | $output = html_writer::start_tag('br'); |
433 | 433 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
434 | 434 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
447 | 447 | ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
448 | 448 | ''.$OUTPUT->action_link($bbbsession['presentation']['url'], |
449 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
449 | + $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | return ''; |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
24 | 24 | */ |
25 | 25 | |
26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
28 | 28 | |
29 | 29 | $id = required_param('id', PARAM_INT); |
30 | 30 | $bn = optional_param('n', 0, PARAM_INT); |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | if (is_null($serverversion)) { |
57 | 57 | if ($bbbsession['administrator']) { |
58 | 58 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
59 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
59 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
60 | 60 | exit; |
61 | 61 | } |
62 | 62 | |
63 | 63 | if ($bbbsession['moderator']) { |
64 | 64 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
65 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
65 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
66 | 66 | exit; |
67 | 67 | } |
68 | 68 | |
69 | 69 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
70 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
70 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
71 | 71 | exit; |
72 | 72 | } |
73 | -$bbbsession['serverversion'] = (string) $serverversion; |
|
73 | +$bbbsession['serverversion'] = (string)$serverversion; |
|
74 | 74 | |
75 | 75 | // Mark viewed by user (if required). |
76 | 76 | $completion = new completion_info($course); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | // Print the page header. |
80 | 80 | $PAGE->set_context($context); |
81 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
81 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
82 | 82 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
83 | 83 | $PAGE->set_cacheable(false); |
84 | 84 | $PAGE->set_heading($course->fullname); |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
89 | 89 | echo $OUTPUT->header(); |
90 | 90 | if (isguestuser()) { |
91 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
92 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
91 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
92 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
93 | 93 | } else { |
94 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
95 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
94 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
95 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
96 | 96 | } |
97 | 97 | echo $OUTPUT->footer(); |
98 | 98 | exit; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // Operation URLs. |
102 | 102 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
103 | -$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id . |
|
103 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . |
|
104 | 104 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
105 | 105 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
106 | 106 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | echo $OUTPUT->footer(); |
121 | 121 | |
122 | 122 | // Shows version as a comment. |
123 | -echo '<!-- '.$bbbsession['originTag'].' -->'."\n"; |
|
123 | +echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n"; |
|
124 | 124 | |
125 | 125 | // Initialize session variable used across views. |
126 | 126 | $SESSION->bigbluebuttonbn_bbbsession = $bbbsession; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass; |
152 | 152 | |
153 | 153 | // Database info related to the activity. |
154 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
154 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
155 | 155 | $bbbsession['bigbluebuttonbn']->id; |
156 | 156 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
157 | 157 | $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
173 | 173 | } |
174 | 174 | if ($bigbluebuttonbn->record) { |
175 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
175 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $bbbsession['originServerName'] = $parsedurl['host']; |
189 | 189 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
190 | 190 | $bbbsession['originServerCommonName'] = ''; |
191 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
191 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | function bigbluebuttonbn_view_bbbsession_roles($context, $userid) { |
@@ -245,10 +245,10 @@ discard block |
||
245 | 245 | $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true); |
246 | 246 | |
247 | 247 | // Assign group default values. |
248 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
249 | - $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
248 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
249 | + $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
250 | 250 | $groupname = get_string('allparticipants'); |
251 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')'; |
|
251 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')'; |
|
252 | 252 | |
253 | 253 | if (count($groups) == 0) { |
254 | 254 | // Only the All participants group exists. |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | $bbbsession['group'] = array_values($groups)[0]->id; |
260 | 260 | } |
261 | 261 | |
262 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
263 | - $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
262 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
263 | + $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
264 | 264 | $groupname = groups_get_group_name($bbbsession['group']); |
265 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')'; |
|
265 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')'; |
|
266 | 266 | |
267 | 267 | if (count($groups) == 1) { |
268 | 268 | // There only one group and the user has access to. |
@@ -270,12 +270,12 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | echo $OUTPUT->box_start('generalbox boxaligncenter'); |
273 | - echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn'). |
|
273 | + echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') . |
|
274 | 274 | '</div>'; |
275 | 275 | echo $OUTPUT->box_end(); |
276 | 276 | |
277 | 277 | groups_print_activity_menu( |
278 | - $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
278 | + $bbbsession['cm'], $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id); |
|
279 | 279 | echo '<br><br>'; |
280 | 280 | } |
281 | 281 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | 'M.mod_bigbluebuttonbn.recordings.init', array($jsvars)); |
318 | 318 | } |
319 | 319 | |
320 | - echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); |
|
320 | + echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); |
|
321 | 321 | |
322 | 322 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars)); |
323 | 323 | } |
@@ -328,12 +328,12 @@ discard block |
||
328 | 328 | // JavaScript variables for room. |
329 | 329 | $openingtime = ''; |
330 | 330 | if ($bbbsession['openingtime']) { |
331 | - $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '. |
|
331 | + $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . |
|
332 | 332 | userdate($bbbsession['openingtime']); |
333 | 333 | } |
334 | 334 | $closingtime = ''; |
335 | 335 | if ($bbbsession['closingtime']) { |
336 | - $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '. |
|
336 | + $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . |
|
337 | 337 | userdate($bbbsession['closingtime']); |
338 | 338 | } |
339 | 339 | $jsvars += array( |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $output .= $OUTPUT->box_end(); |
351 | 351 | |
352 | 352 | $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
353 | - $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n"; |
|
353 | + $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n"; |
|
354 | 354 | $output .= $OUTPUT->box_end(); |
355 | 355 | |
356 | 356 | if ($activity == 'ended') { |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | |
377 | 377 | // Get recordings. |
378 | 378 | $recordings = array(); |
379 | - if ( bigbluebuttonbn_view_include_recordings($bbbsession) ) { |
|
379 | + if (bigbluebuttonbn_view_include_recordings($bbbsession)) { |
|
380 | 380 | $recordings = bigbluebuttonbn_get_recordings( |
381 | 381 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
382 | 382 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | // If there are meetings with recordings load the data to the table. |
408 | 408 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
409 | 409 | // Render a plain html table. |
410 | - return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n"; |
|
410 | + return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n"; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | // JavaScript variables for recordings with YUI. |
@@ -427,8 +427,8 @@ discard block |
||
427 | 427 | array('type' => 'button', |
428 | 428 | 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
429 | 429 | 'class' => 'btn btn-secondary', |
430 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
431 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
430 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . |
|
431 | + $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
432 | 432 | $output = html_writer::start_tag('br'); |
433 | 433 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
434 | 434 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -443,10 +443,10 @@ discard block |
||
443 | 443 | $attributes = array('title' => $bbbsession['presentation']['name']); |
444 | 444 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
445 | 445 | |
446 | - return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
447 | - ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
|
448 | - ''.$OUTPUT->action_link($bbbsession['presentation']['url'], |
|
449 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
446 | + return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
447 | + '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' . |
|
448 | + '' . $OUTPUT->action_link($bbbsession['presentation']['url'], |
|
449 | + $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | return ''; |
@@ -196,10 +196,10 @@ discard block |
||
196 | 196 | |
197 | 197 | function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession, $bigbluebuttonbn) { |
198 | 198 | $data = ['meetingID' => $bbbsession['meetingid'], |
199 | - 'name' => $bbbsession['meetingname'], |
|
200 | - 'attendeePW' => $bbbsession['viewerPW'], |
|
201 | - 'moderatorPW' => $bbbsession['modPW'], |
|
202 | - 'logoutURL' => $bbbsession['logoutURL'], |
|
199 | + 'name' => $bbbsession['meetingname'], |
|
200 | + 'attendeePW' => $bbbsession['viewerPW'], |
|
201 | + 'moderatorPW' => $bbbsession['modPW'], |
|
202 | + 'logoutURL' => $bbbsession['logoutURL'], |
|
203 | 203 | ]; |
204 | 204 | |
205 | 205 | $data['record'] = 'false'; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | '%duration%', |
225 | 225 | (string) $durationtime, |
226 | 226 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
227 | - ); |
|
227 | + ); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | $voicebridge = intval($bbbsession['voicebridge']); |
@@ -244,14 +244,14 @@ discard block |
||
244 | 244 | global $USER; |
245 | 245 | |
246 | 246 | $metadata = ['bbb-origin' => $bbbsession['origin'], |
247 | - 'bbb-origin-version' => $bbbsession['originVersion'], |
|
248 | - 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
249 | - 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
250 | - 'bbb-origin-tag' => $bbbsession['originTag'], |
|
251 | - 'bbb-context' => $bbbsession['course']->fullname, |
|
252 | - 'bbb-recording-name' => $bbbsession['meetingname'], |
|
253 | - 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
254 | - 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
247 | + 'bbb-origin-version' => $bbbsession['originVersion'], |
|
248 | + 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
249 | + 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
250 | + 'bbb-origin-tag' => $bbbsession['originTag'], |
|
251 | + 'bbb-context' => $bbbsession['course']->fullname, |
|
252 | + 'bbb-recording-name' => $bbbsession['meetingname'], |
|
253 | + 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
254 | + 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
255 | 255 | ]; |
256 | 256 | |
257 | 257 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) { |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | array( |
260 | 260 | 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'), |
261 | 261 | 'context' => $bbbsession['bigbluebuttonbnURL'] |
262 | - ) |
|
263 | - ); |
|
262 | + ) |
|
263 | + ); |
|
264 | 264 | } |
265 | 265 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) { |
266 | 266 | $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL']; |
@@ -61,108 +61,108 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | switch (strtolower($action)) { |
64 | - case 'logout': |
|
65 | - if (isset($errors) && $errors != '') { |
|
66 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
67 | - break; |
|
68 | - } |
|
69 | - |
|
70 | - if (is_null($bbbsession)) { |
|
71 | - bigbluebutton_bbb_view_close_window_manually(); |
|
72 | - break; |
|
73 | - } |
|
64 | + case 'logout': |
|
65 | + if (isset($errors) && $errors != '') { |
|
66 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
67 | + break; |
|
68 | + } |
|
74 | 69 | |
75 | - // Moodle event logger: Create an event for meeting left. |
|
76 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
70 | + if (is_null($bbbsession)) { |
|
71 | + bigbluebutton_bbb_view_close_window_manually(); |
|
72 | + break; |
|
73 | + } |
|
77 | 74 | |
78 | - // Update the cache. |
|
79 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
75 | + // Moodle event logger: Create an event for meeting left. |
|
76 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
80 | 77 | |
81 | - // Close the tab or window where BBB was opened. |
|
82 | - bigbluebutton_bbb_view_close_window(); |
|
83 | - break; |
|
84 | - case 'join': |
|
85 | - if (is_null($bbbsession)) { |
|
86 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
87 | - break; |
|
88 | - } |
|
78 | + // Update the cache. |
|
79 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
89 | 80 | |
90 | - // See if the session is in progress. |
|
91 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
92 | - // Since the meeting is already running, we just join the session. |
|
93 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
81 | + // Close the tab or window where BBB was opened. |
|
82 | + bigbluebutton_bbb_view_close_window(); |
|
94 | 83 | break; |
95 | - } |
|
84 | + case 'join': |
|
85 | + if (is_null($bbbsession)) { |
|
86 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
87 | + break; |
|
88 | + } |
|
96 | 89 | |
97 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
98 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
99 | - header('Location: '.$bbbsession['logoutURL']); |
|
100 | - break; |
|
101 | - } |
|
90 | + // See if the session is in progress. |
|
91 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
92 | + // Since the meeting is already running, we just join the session. |
|
93 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
94 | + break; |
|
95 | + } |
|
102 | 96 | |
103 | - // As the meeting doesn't exist, try to create it. |
|
104 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
105 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn), |
|
106 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
107 | - $bbbsession['presentation']['name'], |
|
108 | - $bbbsession['presentation']['url'] |
|
109 | - ); |
|
110 | - |
|
111 | - if (!$response) { |
|
112 | - // The server is unreachable. |
|
113 | - if ($bbbsession['administrator']) { |
|
114 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
115 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
97 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
98 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
99 | + header('Location: '.$bbbsession['logoutURL']); |
|
116 | 100 | break; |
117 | 101 | } |
118 | - if ($bbbsession['moderator']) { |
|
119 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
102 | + |
|
103 | + // As the meeting doesn't exist, try to create it. |
|
104 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
105 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn), |
|
106 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
107 | + $bbbsession['presentation']['name'], |
|
108 | + $bbbsession['presentation']['url'] |
|
109 | + ); |
|
110 | + |
|
111 | + if (!$response) { |
|
112 | + // The server is unreachable. |
|
113 | + if ($bbbsession['administrator']) { |
|
114 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
115 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
116 | + break; |
|
117 | + } |
|
118 | + if ($bbbsession['moderator']) { |
|
119 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
120 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
121 | + break; |
|
122 | + } |
|
123 | + |
|
124 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
120 | 125 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
121 | 126 | break; |
122 | 127 | } |
123 | 128 | |
124 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
125 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
126 | - break; |
|
127 | - } |
|
129 | + if ($response['returncode'] == 'FAILED') { |
|
130 | + // The meeting was not created. |
|
131 | + if (!$printerrorkey) { |
|
132 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
133 | + break; |
|
134 | + } |
|
135 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
136 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
137 | + break; |
|
138 | + } |
|
128 | 139 | |
129 | - if ($response['returncode'] == 'FAILED') { |
|
130 | - // The meeting was not created. |
|
131 | - if (!$printerrorkey) { |
|
132 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
140 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
141 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
133 | 142 | break; |
134 | 143 | } |
135 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
136 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
137 | - break; |
|
138 | - } |
|
139 | 144 | |
140 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
141 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
145 | + // Moodle event logger: Create an event for meeting created. |
|
146 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
147 | + // Internal logger: Insert a record with the meeting created. |
|
148 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
149 | + // Since the meeting is already running, we just join the session. |
|
150 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
142 | 151 | break; |
143 | - } |
|
152 | + case 'playback': |
|
153 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
154 | + if ($href == '') { |
|
155 | + bigbluebutton_bbb_view_close_window(); |
|
156 | + return; |
|
157 | + } |
|
144 | 158 | |
145 | - // Moodle event logger: Create an event for meeting created. |
|
146 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
147 | - // Internal logger: Insert a record with the meeting created. |
|
148 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
149 | - // Since the meeting is already running, we just join the session. |
|
150 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
151 | - break; |
|
152 | - case 'playback': |
|
153 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
154 | - if ($href == '') { |
|
159 | + // Moodle event logger: Create an event for meeting left. |
|
160 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
161 | + // Execute the redirect. |
|
162 | + header('Location: '.urldecode($href)); |
|
163 | + break; |
|
164 | + default: |
|
155 | 165 | bigbluebutton_bbb_view_close_window(); |
156 | - return; |
|
157 | - } |
|
158 | - |
|
159 | - // Moodle event logger: Create an event for meeting left. |
|
160 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
161 | - // Execute the redirect. |
|
162 | - header('Location: '.urldecode($href)); |
|
163 | - break; |
|
164 | - default: |
|
165 | - bigbluebutton_bbb_view_close_window(); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | function bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype) { |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
23 | 23 | */ |
24 | 24 | |
25 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
26 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
25 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
26 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
27 | 27 | |
28 | 28 | $action = required_param('action', PARAM_TEXT); |
29 | 29 | $id = optional_param('id', 0, PARAM_INT); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
98 | 98 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
99 | - header('Location: '.$bbbsession['logoutURL']); |
|
99 | + header('Location: ' . $bbbsession['logoutURL']); |
|
100 | 100 | break; |
101 | 101 | } |
102 | 102 | |
@@ -112,17 +112,17 @@ discard block |
||
112 | 112 | // The server is unreachable. |
113 | 113 | if ($bbbsession['administrator']) { |
114 | 114 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
115 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
115 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
116 | 116 | break; |
117 | 117 | } |
118 | 118 | if ($bbbsession['moderator']) { |
119 | 119 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
120 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
120 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
121 | 121 | break; |
122 | 122 | } |
123 | 123 | |
124 | 124 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
125 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
125 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
126 | 126 | break; |
127 | 127 | } |
128 | 128 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | // Moodle event logger: Create an event for meeting left. |
160 | 160 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
161 | 161 | // Execute the redirect. |
162 | - header('Location: '.urldecode($href)); |
|
162 | + header('Location: ' . urldecode($href)); |
|
163 | 163 | break; |
164 | 164 | default: |
165 | 165 | bigbluebutton_bbb_view_close_window(); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $data['welcome'] .= '<br><br>'; |
223 | 223 | $data['welcome'] .= str_replace( |
224 | 224 | '%duration%', |
225 | - (string) $durationtime, |
|
225 | + (string)$durationtime, |
|
226 | 226 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
227 | 227 | ); |
228 | 228 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | |
279 | 279 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
280 | 280 | // No more users allowed to join. |
281 | - header('Location: '.$bbbsession['logoutURL']); |
|
281 | + header('Location: ' . $bbbsession['logoutURL']); |
|
282 | 282 | return; |
283 | 283 | } |
284 | 284 | |
@@ -297,20 +297,20 @@ discard block |
||
297 | 297 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
298 | 298 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
299 | 299 | // Execute the redirect. |
300 | - header('Location: '.$joinurl); |
|
300 | + header('Location: ' . $joinurl); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
304 | 304 | global $CFG, $OUTPUT; |
305 | 305 | |
306 | - $errors = (array) json_decode(urldecode($serrors)); |
|
306 | + $errors = (array)json_decode(urldecode($serrors)); |
|
307 | 307 | $msgerrors = ''; |
308 | 308 | foreach ($errors as $error) { |
309 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
309 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | echo $OUTPUT->header(); |
313 | 313 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
314 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
314 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
315 | 315 | echo $OUTPUT->footer(); |
316 | 316 | } |