@@ -181,6 +181,9 @@ discard block |
||
181 | 181 | return "{$params['callback']}({$callbackresponsedata});"; |
182 | 182 | } |
183 | 183 | |
184 | +/** |
|
185 | + * @param boolean $running |
|
186 | + */ |
|
184 | 187 | function bigbluebuttonbn_broker_meeting_info_can_join($bbbsession, $running, $participantcount) { |
185 | 188 | $status = array("can_join" => false); |
186 | 189 | if ($running) { |
@@ -201,6 +204,9 @@ discard block |
||
201 | 204 | return $status; |
202 | 205 | } |
203 | 206 | |
207 | +/** |
|
208 | + * @param boolean $running |
|
209 | + */ |
|
204 | 210 | function bigbluebuttonbn_broker_meeting_info_can_end($bbbsession, $running) { |
205 | 211 | $status = array("can_end" => false); |
206 | 212 | if ($running && ($bbbsession['administrator'] || $bbbsession['moderator'])) { |
@@ -348,6 +354,9 @@ discard block |
||
348 | 354 | return "{$params['callback']}({$callbackresponsedata});"; |
349 | 355 | } |
350 | 356 | |
357 | +/** |
|
358 | + * @param string $action |
|
359 | + */ |
|
351 | 360 | function bigbluebuttonbn_broker_recording_action_perform($action, $bbbsession, $params, $recordings) { |
352 | 361 | if ($action == 'recording_publish') { |
353 | 362 | return bigbluebuttonbn_broker_recording_action_publish($bbbsession, $params, $recordings); |
@@ -377,6 +386,9 @@ discard block |
||
377 | 386 | return bigbluebuttonbn_broker_recording_action_publishunprotect($bbbsession, $params, $recordings, 'unprotect'); |
378 | 387 | } |
379 | 388 | |
389 | +/** |
|
390 | + * @param string $action |
|
391 | + */ |
|
380 | 392 | function bigbluebuttonbn_broker_recording_action_publishunprotect($bbbsession, $params, $recordings, $action) { |
381 | 393 | $status = true; |
382 | 394 | if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) { |
@@ -408,6 +420,9 @@ discard block |
||
408 | 420 | return bigbluebuttonbn_broker_recording_action_unpublishprotect($bbbsession, $params, $recordings, 'protect'); |
409 | 421 | } |
410 | 422 | |
423 | +/** |
|
424 | + * @param string $action |
|
425 | + */ |
|
411 | 426 | function bigbluebuttonbn_broker_recording_action_unpublishprotect($bbbsession, $params, $recordings, $action) { |
412 | 427 | global $DB; |
413 | 428 |
@@ -414,10 +414,10 @@ discard block |
||
414 | 414 | if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) { |
415 | 415 | // Execute unpublish or protect on imported recording link. |
416 | 416 | return array( |
417 | - 'status' => bigbluebuttonbn_publish_recording_imported( |
|
418 | - $params['id'], $bbbsession['bigbluebuttonbn']->id, false |
|
417 | + 'status' => bigbluebuttonbn_publish_recording_imported( |
|
418 | + $params['id'], $bbbsession['bigbluebuttonbn']->id, false |
|
419 | 419 | ) |
420 | - ); |
|
420 | + ); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | // As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
@@ -437,26 +437,26 @@ discard block |
||
437 | 437 | } |
438 | 438 | // Second: Execute the real unpublish. |
439 | 439 | return array( |
440 | - 'status' => bigbluebuttonbn_publish_recordings($params['id'], 'false') |
|
441 | - ); |
|
440 | + 'status' => bigbluebuttonbn_publish_recordings($params['id'], 'false') |
|
441 | + ); |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | function bigbluebuttonbn_broker_recording_action_edit($bbbsession, $params, $recordings) { |
445 | 445 | if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) { |
446 | 446 | // Execute update on imported recording link. |
447 | 447 | return array( |
448 | - 'status' => bigbluebuttonbn_update_recording_imported( |
|
449 | - $params['id'], $bbbsession['bigbluebuttonbn']->id, json_decode($params['meta'], true) |
|
448 | + 'status' => bigbluebuttonbn_update_recording_imported( |
|
449 | + $params['id'], $bbbsession['bigbluebuttonbn']->id, json_decode($params['meta'], true) |
|
450 | 450 | ) |
451 | - ); |
|
451 | + ); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | // As the recordingid was not identified as imported recording link, execute update on a real recording. |
455 | 455 | // (No need to update imported links as the update only affects the actual recording). |
456 | 456 | // Execute update on actual recording. |
457 | 457 | return array( |
458 | - 'status' => bigbluebuttonbn_update_recordings($params['id'], json_decode($params['meta'])) |
|
459 | - ); |
|
458 | + 'status' => bigbluebuttonbn_update_recordings($params['id'], json_decode($params['meta'])) |
|
459 | + ); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | function bigbluebuttonbn_broker_recording_action_delete($bbbsession, $params, $recordings) { |
@@ -465,10 +465,10 @@ discard block |
||
465 | 465 | if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) { |
466 | 466 | // Execute delete on imported recording link. |
467 | 467 | return array( |
468 | - 'status' => bigbluebuttonbn_delete_recording_imported( |
|
469 | - $recordings[$params['id']]['imported'] |
|
468 | + 'status' => bigbluebuttonbn_delete_recording_imported( |
|
469 | + $recordings[$params['id']]['imported'] |
|
470 | 470 | ) |
471 | - ); |
|
471 | + ); |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | // As the recordingid was not identified as imported recording link, execute delete on a real recording. |
@@ -483,8 +483,8 @@ discard block |
||
483 | 483 | } |
484 | 484 | // Execute the actual delete. |
485 | 485 | return array( |
486 | - 'status' => bigbluebuttonbn_delete_recordings($params['id']) |
|
487 | - ); |
|
486 | + 'status' => bigbluebuttonbn_delete_recordings($params['id']) |
|
487 | + ); |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | function bigbluebuttonbn_broker_recording_ready($params, $bigbluebuttonbn) { |
@@ -625,10 +625,10 @@ discard block |
||
625 | 625 | $params['recording_import'] = ['id' => 'The recordingID must be specified.']; |
626 | 626 | $params['recording_ready'] = [ |
627 | 627 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
628 | - ]; |
|
628 | + ]; |
|
629 | 629 | $params['live_session_events'] = [ |
630 | 630 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
631 | - ]; |
|
631 | + ]; |
|
632 | 632 | return $params; |
633 | 633 | } |
634 | 634 |
@@ -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 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
291 | 291 | $callbackresponse['status'] = true; |
292 | 292 | $callbackresponse['found'] = true; |
293 | - $callbackresponse['published'] = (string) $recording['published']; |
|
293 | + $callbackresponse['published'] = (string)$recording['published']; |
|
294 | 294 | if (!isset($params['meta'])) { |
295 | 295 | return $callbackresponse; |
296 | 296 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | // Execute publish or unprotect on imported recording link, if the real recording is published. |
384 | 384 | $realrecordings = bigbluebuttonbn_get_recordings_array( |
385 | 385 | $recordings[$params['id']]['meetingID'], $recordings[$params['id']]['recordID']); |
386 | - $status = ($realrecordings[$params['id']][$action.'ed'] === 'true'); |
|
386 | + $status = ($realrecordings[$params['id']][$action . 'ed'] === 'true'); |
|
387 | 387 | if ($status) { |
388 | 388 | // Only if the physical recording is published, execute publish on imported recording link. |
389 | 389 | bigbluebuttonbn_publish_recording_imported($params['id'], $bbbsession['bigbluebuttonbn']->id, true); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | $response = array('status' => $status); |
397 | 397 | if (!$status) { |
398 | - $response['message'] = get_string('view_recording_'.$action.'_link_error', 'bigbluebuttonbn'); |
|
398 | + $response['message'] = get_string('view_recording_' . $action . '_link_error', 'bigbluebuttonbn'); |
|
399 | 399 | } |
400 | 400 | return $response; |
401 | 401 | } |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | foreach ($importedall as $key => $record) { |
429 | 429 | $meta = json_decode($record->meta, true); |
430 | 430 | // Prepare data for the update. |
431 | - $meta['recording'][$action.'ed'] = 'false'; |
|
431 | + $meta['recording'][$action . 'ed'] = 'false'; |
|
432 | 432 | $importedall[$key]->meta = json_encode($meta); |
433 | 433 | |
434 | 434 | // Proceed with the update. |
@@ -494,8 +494,8 @@ discard block |
||
494 | 494 | $decodedparameters = JWT::decode($params['signed_parameters'], \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), |
495 | 495 | array('HS256')); |
496 | 496 | } catch (Exception $e) { |
497 | - $error = 'Caught exception: '.$e->getMessage(); |
|
498 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
497 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
498 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
499 | 499 | return; |
500 | 500 | } |
501 | 501 | |
@@ -513,8 +513,8 @@ discard block |
||
513 | 513 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
514 | 514 | header('HTTP/1.0 202 Accepted'); |
515 | 515 | } catch (Exception $e) { |
516 | - $error = 'Caught exception: '.$e->getMessage(); |
|
517 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
516 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
517 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
530 | 530 | if (!isset($importrecordings[$params['id']])) { |
531 | 531 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
532 | - header('HTTP/1.0 404 Not found. '.$error); |
|
532 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
533 | 533 | return; |
534 | 534 | } |
535 | 535 | |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | |
538 | 538 | $importrecordings[$params['id']]['imported'] = true; |
539 | 539 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
540 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
540 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
541 | 541 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
542 | 542 | // Moodle event logger: Create an event for recording imported. |
543 | 543 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -555,8 +555,8 @@ discard block |
||
555 | 555 | $decodedparameters = JWT::decode($params['signed_parameters'], \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), |
556 | 556 | array('HS256')); |
557 | 557 | } catch (Exception $e) { |
558 | - $error = 'Caught exception: '.$e->getMessage(); |
|
559 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
558 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
559 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
560 | 560 | return; |
561 | 561 | } |
562 | 562 | |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | |
595 | 595 | $action = strtolower($params['action']); |
596 | 596 | if (!array_key_exists($action, $requiredparams)) { |
597 | - return 'Action '.$params['action'].' can not be performed.'; |
|
597 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
598 | 598 | } |
599 | 599 | |
600 | 600 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
@@ -56,6 +56,9 @@ discard block |
||
56 | 56 | const BIGBLUEBUTTON_EVENT_RECORDING_EDITED = 'recording_edited'; |
57 | 57 | const BIGBLUEBUTTON_EVENT_RECORDING_VIEWED = 'recording_viewed'; |
58 | 58 | |
59 | +/** |
|
60 | + * @param string $meta |
|
61 | + */ |
|
59 | 62 | function bigbluebuttonbn_logs(array $bbbsession, $event, array $overrides = [], $meta = null) { |
60 | 63 | global $DB; |
61 | 64 | |
@@ -585,6 +588,12 @@ discard block |
||
585 | 588 | } |
586 | 589 | } |
587 | 590 | |
591 | +/** |
|
592 | + * @param string $url |
|
593 | + * @param string $data |
|
594 | + * |
|
595 | + * @return string |
|
596 | + */ |
|
588 | 597 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = BIGBLUEBUTTONBN_METHOD_GET, |
589 | 598 | $data = null, $contenttype = 'text/xml') { |
590 | 599 | $c = new curl(); |
@@ -760,6 +769,9 @@ discard block |
||
760 | 769 | ]; |
761 | 770 | } |
762 | 771 | |
772 | +/** |
|
773 | + * @param string $participants |
|
774 | + */ |
|
763 | 775 | function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) { |
764 | 776 | global $USER; |
765 | 777 | if (empty($userid)) { |
@@ -1023,8 +1035,6 @@ discard block |
||
1023 | 1035 | } |
1024 | 1036 | |
1025 | 1037 | /** |
1026 | - * @param string $recordingid |
|
1027 | - * @param string $bigbluebuttonbnid |
|
1028 | 1038 | */ |
1029 | 1039 | function bigbluebuttonbn_delete_recording_imported($id) { |
1030 | 1040 | global $DB; |
@@ -1475,6 +1485,9 @@ discard block |
||
1475 | 1485 | return html_writer::div(html_writer::table($table), '', array('id' => 'bigbluebuttonbn_html_table')); |
1476 | 1486 | } |
1477 | 1487 | |
1488 | +/** |
|
1489 | + * @param integer $len |
|
1490 | + */ |
|
1478 | 1491 | function bigbluebuttonbn_html2text($html, $len) { |
1479 | 1492 | $text = strip_tags($html); |
1480 | 1493 | $text = str_replace(' ', ' ', $text); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | global $CFG; |
29 | 29 | |
30 | -require_once(dirname(__FILE__).'/lib.php'); |
|
30 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
31 | 31 | |
32 | 32 | const BIGBLUEBUTTONBN_FORCED = true; |
33 | 33 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if (isset($meta)) { |
77 | 77 | $log->meta = $meta; |
78 | 78 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
79 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
79 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | |
122 | 122 | if (!is_null($pname) && !is_null($purl)) { |
123 | 123 | $method = BIGBLUEBUTTONBN_METHOD_POST; |
124 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='". |
|
125 | - $purl."' /></module></modules>"; |
|
124 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='" . |
|
125 | + $purl . "' /></module></modules>"; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | 'moderatorPW' => $meeting->moderatorPW, |
168 | 168 | 'attendeePW' => $meeting->attendeePW, |
169 | 169 | 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, |
170 | - 'running' => $meeting->running, ); |
|
170 | + 'running' => $meeting->running,); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | return $meetings; |
@@ -345,37 +345,37 @@ discard block |
||
345 | 345 | function bigbluebuttonbn_get_default_config_xml_array() { |
346 | 346 | $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML(); |
347 | 347 | |
348 | - return (array) $defaultconfigxml; |
|
348 | + return (array)$defaultconfigxml; |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | function bigbluebuttonbn_get_recording_array_value($recording) { |
352 | 352 | // Add formats. |
353 | 353 | $playbackarray = array(); |
354 | 354 | foreach ($recording->playback->format as $format) { |
355 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
356 | - 'url' => (string) $format->url, 'length' => (string) $format->length); |
|
355 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
356 | + 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
357 | 357 | // Add preview per format when existing. |
358 | 358 | if ($format->preview) { |
359 | 359 | $imagesarray = array(); |
360 | 360 | foreach ($format->preview->images->image as $image) { |
361 | - $imagearray = array('url' => (string) $image); |
|
361 | + $imagearray = array('url' => (string)$image); |
|
362 | 362 | foreach ($image->attributes() as $attkey => $attvalue) { |
363 | - $imagearray[$attkey] = (string) $attvalue; |
|
363 | + $imagearray[$attkey] = (string)$attvalue; |
|
364 | 364 | } |
365 | 365 | array_push($imagesarray, $imagearray); |
366 | 366 | } |
367 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
367 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
368 | 368 | } |
369 | 369 | } |
370 | 370 | |
371 | 371 | // Add the metadata to the recordings array. |
372 | 372 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
373 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
374 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
375 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
376 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
373 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
374 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
375 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
376 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
377 | 377 | if (isset($recording->protected)) { |
378 | - $recordingarray['protected'] = (string) $recording->protected; |
|
378 | + $recordingarray['protected'] = (string)$recording->protected; |
|
379 | 379 | } |
380 | 380 | // Force protected. |
381 | 381 | $recordingarray['protected'] = 'false'; |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | if (is_object($value)) { |
389 | 389 | $value = ''; |
390 | 390 | } |
391 | - $metadataarray['meta_'.$key] = $value; |
|
391 | + $metadataarray['meta_' . $key] = $value; |
|
392 | 392 | } |
393 | 393 | return $metadataarray; |
394 | 394 | } |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $ids = explode(',', $recordids); |
447 | 447 | foreach ($ids as $id) { |
448 | 448 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
449 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
449 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
450 | 450 | ); |
451 | 451 | if ($xml && $xml->returncode != 'SUCCESS') { |
452 | 452 | return false; |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | return $xml; |
567 | 567 | } catch (Exception $e) { |
568 | 568 | libxml_use_internal_errors($previous); |
569 | - $error = 'Caught exception: '.$e->getMessage(); |
|
569 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
570 | 570 | debugging($error, DEBUG_DEVELOPER); |
571 | 571 | return null; |
572 | 572 | } |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
579 | 579 | return $response; |
580 | 580 | } catch (Exception $e) { |
581 | - $error = 'Caught exception: '.$e->getMessage(); |
|
581 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
582 | 582 | debugging($error, DEBUG_DEVELOPER); |
583 | 583 | libxml_use_internal_errors($previous); |
584 | 584 | return null; |
@@ -596,8 +596,8 @@ discard block |
||
596 | 596 | |
597 | 597 | $options = array(); |
598 | 598 | $options['CURLOPT_HTTPHEADER'] = array( |
599 | - 'Content-Type: '.$contenttype, |
|
600 | - 'Content-Length: '.strlen($data), |
|
599 | + 'Content-Type: ' . $contenttype, |
|
600 | + 'Content-Length: ' . strlen($data), |
|
601 | 601 | 'Content-Language: en-US', |
602 | 602 | ); |
603 | 603 | |
@@ -614,9 +614,9 @@ discard block |
||
614 | 614 | if ($userroles) { |
615 | 615 | $where = ''; |
616 | 616 | foreach ($userroles as $value) { |
617 | - $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid; |
|
617 | + $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid; |
|
618 | 618 | } |
619 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
619 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
620 | 620 | } |
621 | 621 | |
622 | 622 | return $userroles; |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | } |
630 | 630 | |
631 | 631 | function bigbluebuttonbn_get_users(context $context = null) { |
632 | - $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true); |
|
632 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
633 | 633 | foreach ($users as $key => $value) { |
634 | 634 | $users[$key] = fullname($value); |
635 | 635 | } |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | } |
638 | 638 | |
639 | 639 | function bigbluebuttonbn_get_users_select(context $context = null) { |
640 | - $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true); |
|
640 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
641 | 641 | foreach ($users as $key => $value) { |
642 | 642 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
643 | 643 | } |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | } |
646 | 646 | |
647 | 647 | function bigbluebuttonbn_get_roles(context $context = null) { |
648 | - $roles = (array) role_get_names($context); |
|
648 | + $roles = (array)role_get_names($context); |
|
649 | 649 | foreach ($roles as $key => $value) { |
650 | 650 | $roles[$key] = $value->localname; |
651 | 651 | } |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | } |
654 | 654 | |
655 | 655 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
656 | - $roles = (array) role_get_names($context); |
|
656 | + $roles = (array)role_get_names($context); |
|
657 | 657 | foreach ($roles as $key => $value) { |
658 | 658 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
659 | 659 | } |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | } |
662 | 662 | |
663 | 663 | function bigbluebuttonbn_get_role($id) { |
664 | - $roles = (array) role_get_names(); |
|
664 | + $roles = (array)role_get_names(); |
|
665 | 665 | if (is_numeric($id)) { |
666 | 666 | return (object)$roles[$id]; |
667 | 667 | } |
@@ -707,11 +707,11 @@ discard block |
||
707 | 707 | return array(); |
708 | 708 | } |
709 | 709 | foreach ($rules as $key => $rule) { |
710 | - if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) { |
|
710 | + if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) { |
|
711 | 711 | continue; |
712 | 712 | } |
713 | 713 | $role = bigbluebuttonbn_get_role($rule['selectionid']); |
714 | - if ( $role == null ) { |
|
714 | + if ($role == null) { |
|
715 | 715 | unset($rules[$key]); |
716 | 716 | continue; |
717 | 717 | } |
@@ -820,9 +820,9 @@ discard block |
||
820 | 820 | $isunique = true; |
821 | 821 | if ($voicebridge != 0) { |
822 | 822 | $table = 'bigbluebuttonbn'; |
823 | - $select = 'voicebridge = '.$voicebridge; |
|
823 | + $select = 'voicebridge = ' . $voicebridge; |
|
824 | 824 | if ($id) { |
825 | - $select .= ' AND id <> '.$id; |
|
825 | + $select .= ' AND id <> ' . $id; |
|
826 | 826 | } |
827 | 827 | if ($DB->get_records_select($table, $select)) { |
828 | 828 | $isunique = false; |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | function bigbluebuttonbn_generate_nonce() { |
884 | 884 | $mt = microtime(); |
885 | 885 | $rand = mt_rand(); |
886 | - return md5($mt.$rand); |
|
886 | + return md5($mt . $rand); |
|
887 | 887 | } |
888 | 888 | |
889 | 889 | function bigbluebuttonbn_random_password($length = 8) { |
@@ -894,41 +894,41 @@ discard block |
||
894 | 894 | |
895 | 895 | function bigbluebuttonbn_events() { |
896 | 896 | return array( |
897 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
898 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
899 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
900 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
901 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
902 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
903 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
904 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
905 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
906 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
907 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
908 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
909 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
910 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
911 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
897 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
898 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
899 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
900 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
901 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
902 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
903 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
904 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
905 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
906 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
907 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
908 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
909 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
910 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
911 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
912 | 912 | ); |
913 | 913 | } |
914 | 914 | |
915 | 915 | function bigbluebuttonbn_events_action() { |
916 | 916 | return array( |
917 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
918 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
919 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
920 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
921 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
922 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
923 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
924 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
925 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
926 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
927 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
928 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
929 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
930 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
931 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
917 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
918 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
919 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
920 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
921 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
922 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
923 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
924 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
925 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
926 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
927 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
928 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
929 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
930 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
931 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
932 | 932 | ); |
933 | 933 | } |
934 | 934 | |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | if (array_key_exists('other', $options)) { |
950 | 950 | $eventproperties['other'] = $options['other']; |
951 | 951 | } |
952 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
952 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
953 | 953 | array($eventproperties)); |
954 | 954 | $event->trigger(); |
955 | 955 | } |
@@ -990,10 +990,10 @@ discard block |
||
990 | 990 | $now = time(); |
991 | 991 | if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
992 | 992 | // Use the value in the cache. |
993 | - return (array) json_decode($result['meeting_info']); |
|
993 | + return (array)json_decode($result['meeting_info']); |
|
994 | 994 | } |
995 | 995 | // Ping again and refresh the cache. |
996 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
996 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
997 | 997 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
998 | 998 | ); |
999 | 999 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1038,8 +1038,8 @@ discard block |
||
1038 | 1038 | * @param string $configxml |
1039 | 1039 | */ |
1040 | 1040 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1041 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1042 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1041 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1042 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1043 | 1043 | return $configxmlparams; |
1044 | 1044 | } |
1045 | 1045 | |
@@ -1048,7 +1048,7 @@ discard block |
||
1048 | 1048 | * @param string $configxml |
1049 | 1049 | */ |
1050 | 1050 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1051 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1051 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1052 | 1052 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1053 | 1053 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
1054 | 1054 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | */ |
1062 | 1062 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1063 | 1063 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1064 | - $configxmlarray = (array) $configxml; |
|
1064 | + $configxmlarray = (array)$configxml; |
|
1065 | 1065 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1066 | 1066 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1067 | 1067 | return ''; |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | $row->date = $starttime; |
1091 | 1091 | $starttime = $starttime - ($starttime % 1000); |
1092 | 1092 | // Set formatted date. |
1093 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1093 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1094 | 1094 | $row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1095 | 1095 | // Set formatted duration. |
1096 | 1096 | $firstplayback = array_values($recording['playbacks'])[0]; |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | $visibility = 'hidden '; |
1153 | 1153 | } |
1154 | 1154 | $recordingpreview = html_writer::start_tag('div', |
1155 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
1155 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
1156 | 1156 | foreach ($recording['playbacks'] as $playback) { |
1157 | 1157 | if (isset($playback['preview'])) { |
1158 | 1158 | foreach ($playback['preview'] as $image) { |
@@ -1181,19 +1181,19 @@ discard block |
||
1181 | 1181 | if ($recording['published'] === 'false') { |
1182 | 1182 | $visibility = 'hidden '; |
1183 | 1183 | } |
1184 | - $id = 'playbacks-'.$recording['recordID']; |
|
1184 | + $id = 'playbacks-' . $recording['recordID']; |
|
1185 | 1185 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1186 | 1186 | 'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'], |
1187 | 1187 | 'title' => $title, $visibility => $visibility)); |
1188 | 1188 | foreach ($recording['playbacks'] as $playback) { |
1189 | 1189 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);'; |
1190 | - $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid. |
|
1191 | - '&href='.urlencode($playback['url']).'&rid='.$recording['recordID']; |
|
1192 | - $linkattributes = array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), |
|
1190 | + $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn=' . $bigbluebuttonbnid . |
|
1191 | + '&href=' . urlencode($playback['url']) . '&rid=' . $recording['recordID']; |
|
1192 | + $linkattributes = array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), |
|
1193 | 1193 | 'class' => 'btn btn-sm btn-default', 'onclick' => $onclick, |
1194 | 1194 | 'data-action' => 'play', 'data-href' => $href); |
1195 | - $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_'.$playback['type'], |
|
1196 | - 'bigbluebuttonbn'), null, $linkattributes).' '; |
|
1195 | + $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_' . $playback['type'], |
|
1196 | + 'bigbluebuttonbn'), null, $linkattributes) . ' '; |
|
1197 | 1197 | } |
1198 | 1198 | $recordingtypes .= html_writer::end_tag('div'); |
1199 | 1199 | return $recordingtypes; |
@@ -1277,11 +1277,11 @@ discard block |
||
1277 | 1277 | $target .= '-' . $data['target']; |
1278 | 1278 | } |
1279 | 1279 | $id = 'recording-' . $target . '-' . $recording['recordID']; |
1280 | - $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);'; |
|
1280 | + $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);'; |
|
1281 | 1281 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) { |
1282 | 1282 | // With icon for $manageaction. |
1283 | 1283 | $iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
1284 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1284 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1285 | 1285 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1286 | 1286 | 'moodle', $iconattributes); |
1287 | 1287 | $linkattributes = array( |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { |
1372 | 1372 | // There are recordings for this meeting. |
1373 | 1373 | foreach ($recordings as $recording) { |
1374 | - if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) { |
|
1374 | + if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
|
1375 | 1375 | continue; |
1376 | 1376 | } |
1377 | 1377 | bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table); |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | |
1384 | 1384 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, &$table) { |
1385 | 1385 | $row = new html_table_row(); |
1386 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1386 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1387 | 1387 | $row->attributes['data-imported'] = 'false'; |
1388 | 1388 | $texthead = ''; |
1389 | 1389 | $texttail = ''; |
@@ -1397,9 +1397,9 @@ discard block |
||
1397 | 1397 | $rowdata = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
1398 | 1398 | if ($rowdata != null) { |
1399 | 1399 | $rowdata->date_formatted = str_replace(' ', ' ', $rowdata->date_formatted); |
1400 | - $row->cells = array($texthead.$rowdata->recording.$texttail, |
|
1401 | - $texthead.$rowdata->activity.$texttail, $texthead.$rowdata->description.$texttail, |
|
1402 | - $rowdata->preview, $texthead.$rowdata->date_formatted.$texttail, |
|
1400 | + $row->cells = array($texthead . $rowdata->recording . $texttail, |
|
1401 | + $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail, |
|
1402 | + $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail, |
|
1403 | 1403 | $rowdata->duration_formatted); |
1404 | 1404 | if ($bbbsession['managerecordings']) { |
1405 | 1405 | $row->cells[] = $rowdata->actionbar; |
@@ -1409,7 +1409,7 @@ discard block |
||
1409 | 1409 | } |
1410 | 1410 | |
1411 | 1411 | function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) { |
1412 | - return !( !isset($recording['imported']) && isset($bbbsession['group']) && $recording['meetingID'] != $bbbsession['meetingid'] ); |
|
1412 | + return !(!isset($recording['imported']) && isset($bbbsession['group']) && $recording['meetingID'] != $bbbsession['meetingid']); |
|
1413 | 1413 | } |
1414 | 1414 | |
1415 | 1415 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
@@ -1421,9 +1421,9 @@ discard block |
||
1421 | 1421 | // Build the message_body. |
1422 | 1422 | $msg->activity_type = ''; |
1423 | 1423 | $msg->activity_title = $bigbluebuttonbn->name; |
1424 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
1425 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
1426 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1424 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
1425 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
1426 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1427 | 1427 | |
1428 | 1428 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext); |
1429 | 1429 | } |
@@ -1516,15 +1516,15 @@ discard block |
||
1516 | 1516 | |
1517 | 1517 | // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'. |
1518 | 1518 | $select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'"; |
1519 | - $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
1520 | - BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1519 | + $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
1520 | + BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1521 | 1521 | if ($bigbluebuttonbnid === null) { |
1522 | 1522 | $select = "course = '{$courseid}'"; |
1523 | - $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1523 | + $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1524 | 1524 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1525 | 1525 | } else if ($subset) { |
1526 | 1526 | $select = "id = '{$bigbluebuttonbnid}'"; |
1527 | - $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1527 | + $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1528 | 1528 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1529 | 1529 | } |
1530 | 1530 | $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid'); |
@@ -1546,7 +1546,7 @@ discard block |
||
1546 | 1546 | if (!empty($bigbluebuttonbns)) { |
1547 | 1547 | // Prepare select for loading records based on existent bigbluebuttonbns. |
1548 | 1548 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
1549 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
1549 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
1550 | 1550 | // Include only Create events and exclude those with record not true. |
1551 | 1551 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
1552 | 1552 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -1638,8 +1638,8 @@ discard block |
||
1638 | 1638 | function bigbluebuttonbn_format_activity_time($time) { |
1639 | 1639 | $activitytime = ''; |
1640 | 1640 | if ($time) { |
1641 | - $activitytime = calendar_day_representation($time).' '. |
|
1642 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1641 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
1642 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
1643 | 1643 | calendar_time_representation($time); |
1644 | 1644 | } |
1645 | 1645 |
@@ -273,11 +273,11 @@ discard block |
||
273 | 273 | |
274 | 274 | echo $OUTPUT->box_start('generalbox boxaligncenter'); |
275 | 275 | echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn'). |
276 | - '</div>'; |
|
276 | + '</div>'; |
|
277 | 277 | echo $OUTPUT->box_end(); |
278 | 278 | |
279 | 279 | groups_print_activity_menu( |
280 | - $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
280 | + $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id); |
|
281 | 281 | echo '<br><br>'; |
282 | 282 | } |
283 | 283 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | $recordings = bigbluebuttonbn_get_recordings( |
373 | 373 | $bbbsession['course']->id, $bigbluebuttonbnid, $showroom, |
374 | 374 | $bbbsession['bigbluebuttonbn']->recordings_deleted_activities |
375 | - ); |
|
375 | + ); |
|
376 | 376 | |
377 | 377 | if (empty($recordings) || array_key_exists('messageKey', $recordings)) { |
378 | 378 | // There are no recordings to be shown. |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | // JavaScript variables for recordings. |
385 | 385 | $jsvars += array( |
386 | 386 | 'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1', |
387 | - ); |
|
387 | + ); |
|
388 | 388 | |
389 | 389 | // If there are meetings with recordings load the data to the table. |
390 | 390 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $jsvars += array( |
397 | 397 | 'columns' => bigbluebuttonbn_get_recording_columns($bbbsession), |
398 | 398 | 'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings), |
399 | - ); |
|
399 | + ); |
|
400 | 400 | |
401 | 401 | // Render a YUI table. |
402 | 402 | return html_writer::div('', '', array('id' => 'bigbluebuttonbn_yui_table')); |
@@ -407,10 +407,10 @@ discard block |
||
407 | 407 | |
408 | 408 | $button = html_writer::tag('input', '', |
409 | 409 | array('type' => 'button', |
410 | - 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
411 | - 'class' => 'btn btn-secondary', |
|
412 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
413 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
410 | + 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
411 | + 'class' => 'btn btn-secondary', |
|
412 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
413 | + $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
414 | 414 | $output = html_writer::start_tag('br'); |
415 | 415 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
416 | 416 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
429 | 429 | ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''. |
430 | 430 | ''.$OUTPUT->action_link($bbbsession['presentation']['url'], |
431 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
431 | + $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | return ''; |