@@ -52,7 +52,7 @@ |
||
52 | 52 | $params .= '&' . $key . '=' . urlencode($value); |
53 | 53 | } |
54 | 54 | foreach ($metadata as $key => $value) { |
55 | - $params .= '&' . 'meta_' . $key.'=' . urlencode($value); |
|
55 | + $params .= '&' . 'meta_' . $key . '=' . urlencode($value); |
|
56 | 56 | } |
57 | 57 | return $baseurl . $params . '&checksum=' . sha1($action . $params . self::sanitized_secret()); |
58 | 58 | } |
@@ -437,26 +437,26 @@ discard block |
||
437 | 437 | return array( |
438 | 438 | 'status' => false, |
439 | 439 | 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn') |
440 | - ); |
|
440 | + ); |
|
441 | 441 | } |
442 | 442 | if ($realrecordings[$params['id']]['published'] !== 'true') { |
443 | 443 | return array( |
444 | 444 | 'status' => false, |
445 | 445 | 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn') |
446 | - ); |
|
446 | + ); |
|
447 | 447 | } |
448 | 448 | return array( |
449 | 449 | 'status' => bigbluebuttonbn_publish_recording_imported( |
450 | 450 | $recordings[$params['id']]['imported'], true |
451 | 451 | ) |
452 | - ); |
|
452 | + ); |
|
453 | 453 | } |
454 | 454 | // As the recordingid was not identified as imported recording link, execute actual publish. |
455 | 455 | return array( |
456 | 456 | 'status' => bigbluebuttonbn_publish_recordings( |
457 | 457 | $params['id'], 'true' |
458 | 458 | ) |
459 | - ); |
|
459 | + ); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | /** |
@@ -477,26 +477,26 @@ discard block |
||
477 | 477 | return array( |
478 | 478 | 'status' => false, |
479 | 479 | 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn') |
480 | - ); |
|
480 | + ); |
|
481 | 481 | } |
482 | 482 | if ($realrecordings[$params['id']]['protected'] === 'true') { |
483 | 483 | return array( |
484 | 484 | 'status' => false, |
485 | 485 | 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn') |
486 | - ); |
|
486 | + ); |
|
487 | 487 | } |
488 | 488 | return array( |
489 | 489 | 'status' => bigbluebuttonbn_protect_recording_imported( |
490 | 490 | $recordings[$params['id']]['imported'], false |
491 | 491 | ) |
492 | - ); |
|
492 | + ); |
|
493 | 493 | } |
494 | 494 | // As the recordingid was not identified as imported recording link, execute actual uprotect. |
495 | 495 | return array( |
496 | 496 | 'status' => bigbluebuttonbn_update_recordings( |
497 | 497 | $params['id'], array('protect' => 'false') |
498 | 498 | ) |
499 | - ); |
|
499 | + ); |
|
500 | 500 | } |
501 | 501 | |
502 | 502 | /** |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | 'status' => bigbluebuttonbn_publish_recording_imported( |
516 | 516 | $recordings[$params['id']]['imported'], false |
517 | 517 | ) |
518 | - ); |
|
518 | + ); |
|
519 | 519 | } |
520 | 520 | // As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
521 | 521 | // First: Unpublish imported links associated to the recording. |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | 'status' => bigbluebuttonbn_publish_recordings( |
534 | 534 | $params['id'], 'false' |
535 | 535 | ) |
536 | - ); |
|
536 | + ); |
|
537 | 537 | } |
538 | 538 | |
539 | 539 | /** |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | 'status' => bigbluebuttonbn_protect_recording_imported( |
553 | 553 | $recordings[$params['id']]['imported'], true |
554 | 554 | ) |
555 | - ); |
|
555 | + ); |
|
556 | 556 | } |
557 | 557 | // As the recordingid was not identified as imported recording link, execute protect on a real recording. |
558 | 558 | // First: Protect imported links associated to the recording. |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | 'status' => bigbluebuttonbn_update_recordings( |
571 | 571 | $params['id'], array('protect' => 'true') |
572 | 572 | ) |
573 | - ); |
|
573 | + ); |
|
574 | 574 | } |
575 | 575 | |
576 | 576 | /** |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | 'status' => bigbluebuttonbn_delete_recording_imported( |
590 | 590 | $recordings[$params['id']]['imported'] |
591 | 591 | ) |
592 | - ); |
|
592 | + ); |
|
593 | 593 | } |
594 | 594 | // As the recordingid was not identified as imported recording link, execute delete on a real recording. |
595 | 595 | // First: Delete imported links associated to the recording. |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | // Second: Execute the actual delete. |
604 | 604 | return array( |
605 | 605 | 'status' => bigbluebuttonbn_delete_recordings($params['id']) |
606 | - ); |
|
606 | + ); |
|
607 | 607 | } |
608 | 608 | |
609 | 609 | /** |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | 'status' => bigbluebuttonbn_update_recording_imported( |
622 | 622 | $recordings[$params['id']]['imported'], json_decode($params['meta'], true) |
623 | 623 | ) |
624 | - ); |
|
624 | + ); |
|
625 | 625 | } |
626 | 626 | |
627 | 627 | // As the recordingid was not identified as imported recording link, execute update on a real recording. |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | 'status' => bigbluebuttonbn_update_recordings( |
632 | 632 | $params['id'], json_decode($params['meta']) |
633 | 633 | ) |
634 | - ); |
|
634 | + ); |
|
635 | 635 | } |
636 | 636 | |
637 | 637 | /** |
@@ -802,10 +802,10 @@ discard block |
||
802 | 802 | $params['recording_import'] = ['id' => 'The recordingID must be specified.']; |
803 | 803 | $params['recording_ready'] = [ |
804 | 804 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
805 | - ]; |
|
805 | + ]; |
|
806 | 806 | $params['live_session_events'] = [ |
807 | 807 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
808 | - ]; |
|
808 | + ]; |
|
809 | 809 | return $params; |
810 | 810 | } |
811 | 811 |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
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 | use \Firebase\JWT\JWT; |
30 | 30 | |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | require_login(0, false); |
43 | 43 | |
44 | 44 | if (empty($params['action'])) { |
45 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
45 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | 49 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
50 | 50 | if (!empty($error)) { |
51 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
51 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn); |
133 | 133 | return; |
134 | 134 | } |
135 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
135 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
136 | 136 | return; |
137 | 137 | |
138 | 138 | } catch (Exception $e) { |
139 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
139 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
140 | 140 | return; |
141 | 141 | } |
142 | 142 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
322 | 322 | $callbackresponse['status'] = true; |
323 | 323 | $callbackresponse['found'] = true; |
324 | - $callbackresponse['published'] = (string) $recording['published']; |
|
324 | + $callbackresponse['published'] = (string)$recording['published']; |
|
325 | 325 | if (!isset($params['meta']) || empty($params['meta'])) { |
326 | 326 | return $callbackresponse; |
327 | 327 | } |
@@ -648,8 +648,8 @@ discard block |
||
648 | 648 | $decodedparameters = JWT::decode($params['signed_parameters'], |
649 | 649 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
650 | 650 | } catch (Exception $e) { |
651 | - $error = 'Caught exception: '.$e->getMessage(); |
|
652 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
651 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
652 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
653 | 653 | return; |
654 | 654 | } |
655 | 655 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -674,12 +674,12 @@ discard block |
||
674 | 674 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
675 | 675 | } |
676 | 676 | $overrides = array('meetingid' => $decodedparameters->meeting_id); |
677 | - $meta = '{"recordid":'.$decodedparameters->record_id.'}'; |
|
677 | + $meta = '{"recordid":' . $decodedparameters->record_id . '}'; |
|
678 | 678 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta); |
679 | 679 | header('HTTP/1.0 202 Accepted'); |
680 | 680 | } catch (Exception $e) { |
681 | - $error = 'Caught exception: '.$e->getMessage(); |
|
682 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
681 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
682 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
683 | 683 | } |
684 | 684 | } |
685 | 685 | |
@@ -700,13 +700,13 @@ discard block |
||
700 | 700 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
701 | 701 | if (!isset($importrecordings[$params['id']])) { |
702 | 702 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
703 | - header('HTTP/1.0 404 Not found. '.$error); |
|
703 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
704 | 704 | return; |
705 | 705 | } |
706 | 706 | $callbackresponse = array('status' => true); |
707 | 707 | $importrecordings[$params['id']]['imported'] = true; |
708 | 708 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
709 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
709 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
710 | 710 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
711 | 711 | // Moodle event logger: Create an event for recording imported. |
712 | 712 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -731,8 +731,8 @@ discard block |
||
731 | 731 | $decodedparameters = JWT::decode($params['signed_parameters'], |
732 | 732 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
733 | 733 | } catch (Exception $e) { |
734 | - $error = 'Caught exception: '.$e->getMessage(); |
|
735 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
734 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
735 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
736 | 736 | return; |
737 | 737 | } |
738 | 738 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | } |
774 | 774 | $action = strtolower($params['action']); |
775 | 775 | if (!array_key_exists($action, $requiredparams)) { |
776 | - return 'Action '.$params['action'].' can not be performed.'; |
|
776 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
777 | 777 | } |
778 | 778 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
779 | 779 | } |
@@ -205,7 +205,7 @@ |
||
205 | 205 | !isset($CFG->bigbluebuttonbn['recordings_imported_editable']) || |
206 | 206 | !isset($CFG->bigbluebuttonbn['recordings_preview_default']) || |
207 | 207 | !isset($CFG->bigbluebuttonbn['recordings_preview_editable']) |
208 | - ); |
|
208 | + ); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -28,7 +28,7 @@ |
||
28 | 28 | defined('MOODLE_INTERNAL') || die(); |
29 | 29 | |
30 | 30 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
31 | -require_once($CFG->libdir.'/adminlib.php'); |
|
31 | +require_once($CFG->libdir . '/adminlib.php'); |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Helper class for validating settings used HTML for settings.php. |
@@ -80,7 +80,7 @@ |
||
80 | 80 | 'objectid' => $this->objectid, |
81 | 81 | 'contextinstanceid' => $this->contextinstanceid, |
82 | 82 | 'other' => $this->other |
83 | - ); |
|
83 | + ); |
|
84 | 84 | $string = $this->description; |
85 | 85 | foreach ($vars as $key => $value) { |
86 | 86 | $string = str_replace("##" . $key, $value, $string); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | defined('MOODLE_INTERNAL') || die(); |
28 | 28 | |
29 | -require_once(dirname(dirname(__FILE__)).'/locallib.php'); |
|
29 | +require_once(dirname(dirname(__FILE__)) . '/locallib.php'); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Performs data migrations and updates on upgrade. |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * Helper function to retrieve imported recordings from the Moodle database. |
263 | 263 | * The references are stored as events in bigbluebuttonbn_logs. |
264 | 264 | * |
265 | - * @param string $courseid |
|
265 | + * @param integer $courseid |
|
266 | 266 | * @param string $bigbluebuttonbnid |
267 | 267 | * @param bool $subset |
268 | 268 | * |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | /** |
291 | 291 | * Helper function to retrive the default config.xml file. |
292 | 292 | * |
293 | - * @return string |
|
293 | + * @return null|SimpleXMLElement |
|
294 | 294 | */ |
295 | 295 | function bigbluebuttonbn_get_default_config_xml() { |
296 | 296 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | * @param object $a |
373 | 373 | * @param object $b |
374 | 374 | * |
375 | - * @return array |
|
375 | + * @return integer |
|
376 | 376 | */ |
377 | 377 | function bigbluebuttonbn_recording_build_sorter($a, $b) { |
378 | 378 | if ($a['startTime'] < $b['startTime']) { |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | * @param string $data |
499 | 499 | * @param string $contenttype |
500 | 500 | * |
501 | - * @return object |
|
501 | + * @return null|SimpleXMLElement |
|
502 | 502 | */ |
503 | 503 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
504 | 504 | if (extension_loaded('curl')) { |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | * @param string $data |
540 | 540 | * @param string $contenttype |
541 | 541 | * |
542 | - * @return object |
|
542 | + * @return string |
|
543 | 543 | */ |
544 | 544 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
545 | 545 | $c = new curl(); |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | * @param integer $instance |
905 | 905 | * @param integer $voicebridge |
906 | 906 | * |
907 | - * @return string |
|
907 | + * @return boolean |
|
908 | 908 | */ |
909 | 909 | function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) { |
910 | 910 | global $DB; |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | * @param string $meetingid |
1171 | 1171 | * @param string $configxml |
1172 | 1172 | * |
1173 | - * @return object |
|
1173 | + * @return null|SimpleXMLElement |
|
1174 | 1174 | */ |
1175 | 1175 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1176 | 1176 | $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | * @param array $recording |
1220 | 1220 | * @param array $tools |
1221 | 1221 | * |
1222 | - * @return array |
|
1222 | + * @return null|stdClass |
|
1223 | 1223 | */ |
1224 | 1224 | function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) { |
1225 | 1225 | if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
@@ -1723,7 +1723,7 @@ discard block |
||
1723 | 1723 | * |
1724 | 1724 | * @param array $bbbsession |
1725 | 1725 | * @param array $recording |
1726 | - * @param object $rowdata |
|
1726 | + * @param stdClass $rowdata |
|
1727 | 1727 | * |
1728 | 1728 | * @return object |
1729 | 1729 | */ |
@@ -1918,7 +1918,7 @@ discard block |
||
1918 | 1918 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
1919 | 1919 | * in the getRecordings request considering only those that belong to deleted activities. |
1920 | 1920 | * |
1921 | - * @param string $courseid |
|
1921 | + * @param integer $courseid |
|
1922 | 1922 | * @param string $bigbluebuttonbnid |
1923 | 1923 | * @param bool $subset |
1924 | 1924 | * |
@@ -1942,7 +1942,7 @@ discard block |
||
1942 | 1942 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
1943 | 1943 | * in the getRecordings request considering only those that belong to imported recordings. |
1944 | 1944 | * |
1945 | - * @param string $courseid |
|
1945 | + * @param integer $courseid |
|
1946 | 1946 | * @param string $bigbluebuttonbnid |
1947 | 1947 | * @param bool $subset |
1948 | 1948 | * |
@@ -1965,7 +1965,7 @@ discard block |
||
1965 | 1965 | /** |
1966 | 1966 | * Helper function to get recordings and imported recordings together. |
1967 | 1967 | * |
1968 | - * @param string $courseid |
|
1968 | + * @param integer $courseid |
|
1969 | 1969 | * @param string $bigbluebuttonbnid |
1970 | 1970 | * @param bool $subset |
1971 | 1971 | * @param bool $includedeleted |
@@ -1983,7 +1983,7 @@ discard block |
||
1983 | 1983 | * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events |
1984 | 1984 | * in bigbluebuttonbn_logs. |
1985 | 1985 | * |
1986 | - * @param string $courseid |
|
1986 | + * @param integer $courseid |
|
1987 | 1987 | * @param string $bigbluebuttonbnid |
1988 | 1988 | * @param bool $subset |
1989 | 1989 | * @param bool $includedeleted |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | global $CFG; |
30 | 30 | |
31 | -require_once(dirname(__FILE__).'/lib.php'); |
|
31 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
32 | 32 | |
33 | 33 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ |
34 | 34 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'logoutURL' => $logouturl, |
101 | 101 | ]; |
102 | 102 | // Choose between Adobe Flash or HTML5 Client. |
103 | - if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { |
|
103 | + if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) { |
|
104 | 104 | $data['joinViaHtml5'] = 'true'; |
105 | 105 | } |
106 | 106 | if (!is_null($configtoken)) { |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | $data = null; |
129 | 129 | if (!is_null($pname) && !is_null($purl)) { |
130 | 130 | $method = 'POST'; |
131 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
132 | - $purl."' /></module></modules>"; |
|
131 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
132 | + $purl . "' /></module></modules>"; |
|
133 | 133 | } |
134 | 134 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
135 | 135 | if ($xml) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | // Override imported flag with actual ID. |
291 | 291 | $recording['imported'] = $recordimported->id; |
292 | 292 | if (isset($recordimported->protected)) { |
293 | - $recording['protected'] = (string) $recordimported->protected; |
|
293 | + $recording['protected'] = (string)$recordimported->protected; |
|
294 | 294 | } |
295 | 295 | $recordsimportedarray[$recording['recordID']] = $recording; |
296 | 296 | } |
@@ -320,21 +320,21 @@ discard block |
||
320 | 320 | // Add formats. |
321 | 321 | $playbackarray = array(); |
322 | 322 | foreach ($recording->playback->format as $format) { |
323 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
324 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
323 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
324 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
325 | 325 | // Add preview per format when existing. |
326 | 326 | if ($format->preview) { |
327 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
327 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | // Add the metadata to the recordings array. |
331 | 331 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
332 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
333 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
334 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
335 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
332 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
333 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
334 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
335 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
336 | 336 | if (isset($recording->protected)) { |
337 | - $recordingarray['protected'] = (string) $recording->protected; |
|
337 | + $recordingarray['protected'] = (string)$recording->protected; |
|
338 | 338 | } |
339 | 339 | return $recordingarray + $metadataarray; |
340 | 340 | } |
@@ -349,9 +349,9 @@ discard block |
||
349 | 349 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
350 | 350 | $imagesarray = array(); |
351 | 351 | foreach ($preview->images->image as $image) { |
352 | - $imagearray = array('url' => trim((string) $image)); |
|
352 | + $imagearray = array('url' => trim((string)$image)); |
|
353 | 353 | foreach ($image->attributes() as $attkey => $attvalue) { |
354 | - $imagearray[$attkey] = (string) $attvalue; |
|
354 | + $imagearray[$attkey] = (string)$attvalue; |
|
355 | 355 | } |
356 | 356 | array_push($imagesarray, $imagearray); |
357 | 357 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | if (is_object($value)) { |
372 | 372 | $value = ''; |
373 | 373 | } |
374 | - $metadataarray['meta_'.$key] = $value; |
|
374 | + $metadataarray['meta_' . $key] = $value; |
|
375 | 375 | } |
376 | 376 | return $metadataarray; |
377 | 377 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $ids = explode(',', $recordids); |
444 | 444 | foreach ($ids as $id) { |
445 | 445 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
446 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
446 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
447 | 447 | ); |
448 | 448 | if ($xml && $xml->returncode != 'SUCCESS') { |
449 | 449 | return false; |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | return $xml; |
509 | 509 | } catch (Exception $e) { |
510 | 510 | libxml_use_internal_errors($previous); |
511 | - $error = 'Caught exception: '.$e->getMessage(); |
|
511 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
512 | 512 | debugging($error, DEBUG_DEVELOPER); |
513 | 513 | return null; |
514 | 514 | } |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
520 | 520 | return $response; |
521 | 521 | } catch (Exception $e) { |
522 | - $error = 'Caught exception: '.$e->getMessage(); |
|
522 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
523 | 523 | debugging($error, DEBUG_DEVELOPER); |
524 | 524 | libxml_use_internal_errors($previous); |
525 | 525 | return null; |
@@ -545,8 +545,8 @@ discard block |
||
545 | 545 | } |
546 | 546 | $options = array(); |
547 | 547 | $options['CURLOPT_HTTPHEADER'] = array( |
548 | - 'Content-Type: '.$contenttype, |
|
549 | - 'Content-Length: '.strlen($data), |
|
548 | + 'Content-Type: ' . $contenttype, |
|
549 | + 'Content-Length: ' . strlen($data), |
|
550 | 550 | 'Content-Language: en-US', |
551 | 551 | ); |
552 | 552 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * @return void |
568 | 568 | */ |
569 | 569 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
570 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
570 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
571 | 571 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
572 | 572 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
573 | 573 | } |
@@ -587,9 +587,9 @@ discard block |
||
587 | 587 | if ($userroles) { |
588 | 588 | $where = ''; |
589 | 589 | foreach ($userroles as $userrole) { |
590 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
590 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
591 | 591 | } |
592 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
592 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
593 | 593 | } |
594 | 594 | return $userroles; |
595 | 595 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | * @return array $users |
613 | 613 | */ |
614 | 614 | function bigbluebuttonbn_get_users(context $context = null) { |
615 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
615 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
616 | 616 | foreach ($users as $key => $value) { |
617 | 617 | $users[$key] = fullname($value); |
618 | 618 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | * @return array $users |
628 | 628 | */ |
629 | 629 | function bigbluebuttonbn_get_users_select(context $context = null) { |
630 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
630 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
631 | 631 | foreach ($users as $key => $value) { |
632 | 632 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
633 | 633 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | * @return array $roles |
643 | 643 | */ |
644 | 644 | function bigbluebuttonbn_get_roles(context $context = null) { |
645 | - $roles = (array) role_get_names($context); |
|
645 | + $roles = (array)role_get_names($context); |
|
646 | 646 | foreach ($roles as $key => $value) { |
647 | 647 | $roles[$key] = $value->localname; |
648 | 648 | } |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | * @return array $users |
658 | 658 | */ |
659 | 659 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
660 | - $roles = (array) role_get_names($context); |
|
660 | + $roles = (array)role_get_names($context); |
|
661 | 661 | foreach ($roles as $key => $value) { |
662 | 662 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
663 | 663 | } |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | * @return object $role |
673 | 673 | */ |
674 | 674 | function bigbluebuttonbn_get_role($id) { |
675 | - $roles = (array) role_get_names(); |
|
675 | + $roles = (array)role_get_names(); |
|
676 | 676 | if (is_numeric($id) && isset($roles[$id])) { |
677 | 677 | return (object)$roles[$id]; |
678 | 678 | } |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | if (!isguestuser()) { |
830 | 830 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid); |
831 | 831 | } |
832 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
832 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
833 | 833 | } |
834 | 834 | |
835 | 835 | /** |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | function bigbluebuttonbn_generate_nonce() { |
986 | 986 | $mt = microtime(); |
987 | 987 | $rand = mt_rand(); |
988 | - return md5($mt.$rand); |
|
988 | + return md5($mt . $rand); |
|
989 | 989 | } |
990 | 990 | |
991 | 991 | /** |
@@ -1075,10 +1075,10 @@ discard block |
||
1075 | 1075 | $now = time(); |
1076 | 1076 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1077 | 1077 | // Use the value in the cache. |
1078 | - return (array) json_decode($result['meeting_info']); |
|
1078 | + return (array)json_decode($result['meeting_info']); |
|
1079 | 1079 | } |
1080 | 1080 | // Ping again and refresh the cache. |
1081 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1081 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1082 | 1082 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1083 | 1083 | ); |
1084 | 1084 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | * @return object |
1190 | 1190 | */ |
1191 | 1191 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1192 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1192 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1193 | 1193 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1194 | 1194 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1195 | 1195 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1205,8 +1205,8 @@ discard block |
||
1205 | 1205 | * @return string |
1206 | 1206 | */ |
1207 | 1207 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1208 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1209 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1208 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1209 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1210 | 1210 | return $configxmlparams; |
1211 | 1211 | } |
1212 | 1212 | |
@@ -1220,7 +1220,7 @@ discard block |
||
1220 | 1220 | */ |
1221 | 1221 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1222 | 1222 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1223 | - $configxmlarray = (array) $configxml; |
|
1223 | + $configxmlarray = (array)$configxml; |
|
1224 | 1224 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1225 | 1225 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1226 | 1226 | return ''; |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | global $USER; |
1313 | 1313 | $starttime = $starttime - ($starttime % 1000); |
1314 | 1314 | // Set formatted date. |
1315 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1315 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1316 | 1316 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1317 | 1317 | } |
1318 | 1318 | |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | * @return string |
1429 | 1429 | */ |
1430 | 1430 | function bigbluebuttonbn_get_recording_data_row_preview($recording) { |
1431 | - $options = array('id' => 'preview-'.$recording['recordID']); |
|
1431 | + $options = array('id' => 'preview-' . $recording['recordID']); |
|
1432 | 1432 | if ($recording['published'] === 'false') { |
1433 | 1433 | $options['hidden'] = 'hidden'; |
1434 | 1434 | } |
@@ -1490,7 +1490,7 @@ discard block |
||
1490 | 1490 | if ($recording['published'] === 'false') { |
1491 | 1491 | $visibility = 'hidden '; |
1492 | 1492 | } |
1493 | - $id = 'playbacks-'.$recording['recordID']; |
|
1493 | + $id = 'playbacks-' . $recording['recordID']; |
|
1494 | 1494 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1495 | 1495 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1496 | 1496 | 'title' => $title, $visibility => $visibility)); |
@@ -1515,11 +1515,11 @@ discard block |
||
1515 | 1515 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
1516 | 1516 | return ''; |
1517 | 1517 | } |
1518 | - $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1518 | + $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1519 | 1519 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1520 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1520 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1521 | 1521 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1522 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1522 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1523 | 1523 | } |
1524 | 1524 | $linkattributes = array( |
1525 | 1525 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], |
@@ -1688,7 +1688,7 @@ discard block |
||
1688 | 1688 | $linkattributes['class'] = 'disabled'; |
1689 | 1689 | unset($linkattributes['onclick']); |
1690 | 1690 | } |
1691 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1691 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1692 | 1692 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1693 | 1693 | 'moodle', $iconattributes); |
1694 | 1694 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1805,7 +1805,7 @@ discard block |
||
1805 | 1805 | */ |
1806 | 1806 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
1807 | 1807 | $row = new html_table_row(); |
1808 | - $row->id = 'recording-tr-'.$recording['recordID']; |
|
1808 | + $row->id = 'recording-tr-' . $recording['recordID']; |
|
1809 | 1809 | $row->attributes['data-imported'] = 'false'; |
1810 | 1810 | $texthead = ''; |
1811 | 1811 | $texttail = ''; |
@@ -1865,9 +1865,9 @@ discard block |
||
1865 | 1865 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
1866 | 1866 | $sender = get_admin(); |
1867 | 1867 | // Prepare message. |
1868 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
1869 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
1870 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1868 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
1869 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
1870 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1871 | 1871 | $context = context_course::instance($bigbluebuttonbn->course); |
1872 | 1872 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
1873 | 1873 | } |
@@ -2089,7 +2089,7 @@ discard block |
||
2089 | 2089 | } |
2090 | 2090 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2091 | 2091 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2092 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2092 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2093 | 2093 | // Include only Create events and exclude those with record not true. |
2094 | 2094 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2095 | 2095 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2239,8 +2239,8 @@ discard block |
||
2239 | 2239 | function bigbluebuttonbn_format_activity_time($time) { |
2240 | 2240 | $activitytime = ''; |
2241 | 2241 | if ($time) { |
2242 | - $activitytime = calendar_day_representation($time).' '. |
|
2243 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2242 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2243 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2244 | 2244 | calendar_time_representation($time); |
2245 | 2245 | } |
2246 | 2246 | return $activitytime; |
@@ -2662,7 +2662,7 @@ discard block |
||
2662 | 2662 | * |
2663 | 2663 | * @return string |
2664 | 2664 | */ |
2665 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
2665 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
2666 | 2666 | global $OUTPUT; |
2667 | 2667 | $output = "\n"; |
2668 | 2668 | // Evaluates if config_warning is enabled. |
@@ -2701,11 +2701,11 @@ discard block |
||
2701 | 2701 | if ($class == '') { |
2702 | 2702 | $class = 'btn btn-secondary'; |
2703 | 2703 | } |
2704 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
2705 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
2706 | - $output .= ' title="' . $title . '"'."\n"; |
|
2707 | - $output .= ' >' . $text . '</button>'."\n"; |
|
2708 | - $output .= ' </form>'."\n"; |
|
2704 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
2705 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
2706 | + $output .= ' title="' . $title . '"' . "\n"; |
|
2707 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
2708 | + $output .= ' </form>' . "\n"; |
|
2709 | 2709 | return $output; |
2710 | 2710 | } |
2711 | 2711 | |
@@ -2870,7 +2870,7 @@ discard block |
||
2870 | 2870 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass; |
2871 | 2871 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; |
2872 | 2872 | // Database info related to the activity. |
2873 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
2873 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
2874 | 2874 | $bbbsession['bigbluebuttonbn']->id; |
2875 | 2875 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
2876 | 2876 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; |
@@ -2890,7 +2890,7 @@ discard block |
||
2890 | 2890 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
2891 | 2891 | } |
2892 | 2892 | if ($bbbsession['bigbluebuttonbn']->record) { |
2893 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
2893 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
2894 | 2894 | } |
2895 | 2895 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; |
2896 | 2896 | $bbbsession['closingtime'] = $bbbsession['bigbluebuttonbn']->closingtime; |
@@ -2903,7 +2903,7 @@ discard block |
||
2903 | 2903 | $bbbsession['originServerName'] = $parsedurl['host']; |
2904 | 2904 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
2905 | 2905 | $bbbsession['originServerCommonName'] = ''; |
2906 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
2906 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
2907 | 2907 | $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server(); |
2908 | 2908 | // Setting for clienttype, assign flash if not enabled, or default if not editable. |
2909 | 2909 | $bbbsession['clienttype'] = \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'); |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, |
96 | 96 | $userid = null, $clienttype = BIGBLUEBUTTON_CLIENTTYPE_FLASH) { |
97 | 97 | $data = ['meetingID' => $meetingid, |
98 | - 'fullName' => $username, |
|
99 | - 'password' => $pw, |
|
100 | - 'logoutURL' => $logouturl, |
|
98 | + 'fullName' => $username, |
|
99 | + 'password' => $pw, |
|
100 | + 'logoutURL' => $logouturl, |
|
101 | 101 | ]; |
102 | 102 | // Choose between Adobe Flash or HTML5 Client. |
103 | 103 | if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { |
@@ -153,23 +153,23 @@ discard block |
||
153 | 153 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
154 | 154 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
155 | 155 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
156 | - ); |
|
156 | + ); |
|
157 | 157 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
158 | 158 | // Meeting info was returned. |
159 | 159 | return array('returncode' => $xml->returncode, |
160 | - 'meetingID' => $xml->meetingID, |
|
161 | - 'moderatorPW' => $xml->moderatorPW, |
|
162 | - 'attendeePW' => $xml->attendeePW, |
|
163 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
164 | - 'running' => $xml->running, |
|
165 | - 'recording' => $xml->recording, |
|
166 | - 'startTime' => $xml->startTime, |
|
167 | - 'endTime' => $xml->endTime, |
|
168 | - 'participantCount' => $xml->participantCount, |
|
169 | - 'moderatorCount' => $xml->moderatorCount, |
|
170 | - 'attendees' => $xml->attendees, |
|
171 | - 'metadata' => $xml->metadata, |
|
172 | - ); |
|
160 | + 'meetingID' => $xml->meetingID, |
|
161 | + 'moderatorPW' => $xml->moderatorPW, |
|
162 | + 'attendeePW' => $xml->attendeePW, |
|
163 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
164 | + 'running' => $xml->running, |
|
165 | + 'recording' => $xml->recording, |
|
166 | + 'startTime' => $xml->startTime, |
|
167 | + 'endTime' => $xml->endTime, |
|
168 | + 'participantCount' => $xml->participantCount, |
|
169 | + 'moderatorCount' => $xml->moderatorCount, |
|
170 | + 'attendees' => $xml->attendees, |
|
171 | + 'metadata' => $xml->metadata, |
|
172 | + ); |
|
173 | 173 | } |
174 | 174 | if ($xml) { |
175 | 175 | // Either failure or success without meeting info. |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | function bigbluebuttonbn_get_default_config_xml() { |
306 | 306 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
307 | 307 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
308 | - ); |
|
308 | + ); |
|
309 | 309 | return $xml; |
310 | 310 | } |
311 | 311 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | foreach ($ids as $id) { |
407 | 407 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
408 | 408 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
409 | - ); |
|
409 | + ); |
|
410 | 410 | if ($xml && $xml->returncode != 'SUCCESS') { |
411 | 411 | return false; |
412 | 412 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | foreach ($ids as $id) { |
426 | 426 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
427 | 427 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
428 | - ); |
|
428 | + ); |
|
429 | 429 | if ($xml && $xml->returncode != 'SUCCESS') { |
430 | 430 | return false; |
431 | 431 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | foreach ($ids as $id) { |
445 | 445 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
446 | 446 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
447 | - ); |
|
447 | + ); |
|
448 | 448 | if ($xml && $xml->returncode != 'SUCCESS') { |
449 | 449 | return false; |
450 | 450 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
462 | 462 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
463 | 463 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
464 | - ); |
|
464 | + ); |
|
465 | 465 | if ($xml) { |
466 | 466 | // If the xml packet returned failure it displays the message to the user. |
467 | 467 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | function bigbluebuttonbn_get_server_version() { |
479 | 479 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
480 | 480 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
481 | - ); |
|
481 | + ); |
|
482 | 482 | if ($xml && $xml->returncode == 'SUCCESS') { |
483 | 483 | return $xml->version; |
484 | 484 | } |
@@ -545,10 +545,10 @@ discard block |
||
545 | 545 | } |
546 | 546 | $options = array(); |
547 | 547 | $options['CURLOPT_HTTPHEADER'] = array( |
548 | - 'Content-Type: '.$contenttype, |
|
549 | - 'Content-Length: '.strlen($data), |
|
550 | - 'Content-Language: en-US', |
|
551 | - ); |
|
548 | + 'Content-Type: '.$contenttype, |
|
549 | + 'Content-Length: '.strlen($data), |
|
550 | + 'Content-Language: en-US', |
|
551 | + ); |
|
552 | 552 | |
553 | 553 | return $c->post($url, $data, $options); |
554 | 554 | } |
@@ -695,16 +695,16 @@ discard block |
||
695 | 695 | 'all' => array( |
696 | 696 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
697 | 697 | 'children' => [] |
698 | - ) |
|
699 | - ); |
|
698 | + ) |
|
699 | + ); |
|
700 | 700 | $data['role'] = array( |
701 | 701 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
702 | 702 | 'children' => bigbluebuttonbn_get_roles_select($context) |
703 | - ); |
|
703 | + ); |
|
704 | 704 | $data['user'] = array( |
705 | 705 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
706 | 706 | 'children' => bigbluebuttonbn_get_users_select($context) |
707 | - ); |
|
707 | + ); |
|
708 | 708 | return $data; |
709 | 709 | } |
710 | 710 | |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | 'selectiontype' => 'all', |
748 | 748 | 'selectionid' => 'all', |
749 | 749 | 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER |
750 | - ); |
|
750 | + ); |
|
751 | 751 | $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default')); |
752 | 752 | foreach ($defaultrules as $defaultrule) { |
753 | 753 | if ($defaultrule == '0') { |
@@ -760,9 +760,9 @@ discard block |
||
760 | 760 | continue; |
761 | 761 | } |
762 | 762 | $participantlist[] = array( |
763 | - 'selectiontype' => 'role', |
|
764 | - 'selectionid' => $defaultrule, |
|
765 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
763 | + 'selectiontype' => 'role', |
|
764 | + 'selectionid' => $defaultrule, |
|
765 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
766 | 766 | } |
767 | 767 | return $participantlist; |
768 | 768 | } |
@@ -801,11 +801,11 @@ discard block |
||
801 | 801 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
802 | 802 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
803 | 803 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
804 | - ], |
|
804 | + ], |
|
805 | 805 | 'type_selected' => 'all', |
806 | 806 | 'options' => ['all' => '---------------'], |
807 | 807 | 'selected' => 'all', |
808 | - ]; |
|
808 | + ]; |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | /** |
@@ -1080,7 +1080,7 @@ discard block |
||
1080 | 1080 | // Ping again and refresh the cache. |
1081 | 1081 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
1082 | 1082 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1083 | - ); |
|
1083 | + ); |
|
1084 | 1084 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
1085 | 1085 | return $meetinginfo; |
1086 | 1086 | } |
@@ -1492,8 +1492,8 @@ discard block |
||
1492 | 1492 | } |
1493 | 1493 | $id = 'playbacks-'.$recording['recordID']; |
1494 | 1494 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1495 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1496 | - 'title' => $title, $visibility => $visibility)); |
|
1495 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1496 | + 'title' => $title, $visibility => $visibility)); |
|
1497 | 1497 | foreach ($recording['playbacks'] as $playback) { |
1498 | 1498 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback); |
1499 | 1499 | } |
@@ -1517,7 +1517,7 @@ discard block |
||
1517 | 1517 | } |
1518 | 1518 | $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1519 | 1519 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1520 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1520 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1521 | 1521 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1522 | 1522 | $href .= '&href='.urlencode(trim($playback['url'])); |
1523 | 1523 | } |
@@ -1528,7 +1528,7 @@ discard block |
||
1528 | 1528 | 'data-action' => 'play', |
1529 | 1529 | 'data-target' => $playback['type'], |
1530 | 1530 | 'data-href' => $href, |
1531 | - ); |
|
1531 | + ); |
|
1532 | 1532 | if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) { |
1533 | 1533 | $linkattributes['class'] = 'btn btn-sm btn-warning'; |
1534 | 1534 | $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn'); |
@@ -1678,10 +1678,10 @@ discard block |
||
1678 | 1678 | 'id' => $id, |
1679 | 1679 | 'onclick' => $onclick, |
1680 | 1680 | 'data-action' => $data['action'] |
1681 | - ); |
|
1681 | + ); |
|
1682 | 1682 | if (!isset($recording['imported'])) { |
1683 | 1683 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
1684 | - $recording['recordID']); |
|
1684 | + $recording['recordID']); |
|
1685 | 1685 | } |
1686 | 1686 | if (isset($data['disabled'])) { |
1687 | 1687 | $iconattributes['class'] .= ' fa-' . $data['disabled']; |
@@ -2167,17 +2167,17 @@ discard block |
||
2167 | 2167 | function bigbluebuttonbn_get_instance_type_profiles() { |
2168 | 2168 | $instanceprofiles = array( |
2169 | 2169 | BIGBLUEBUTTONBN_TYPE_ALL => array('id' => BIGBLUEBUTTONBN_TYPE_ALL, |
2170 | - 'name' => get_string('instance_type_default', 'bigbluebuttonbn'), |
|
2171 | - 'features' => array('all')), |
|
2170 | + 'name' => get_string('instance_type_default', 'bigbluebuttonbn'), |
|
2171 | + 'features' => array('all')), |
|
2172 | 2172 | BIGBLUEBUTTONBN_TYPE_ROOM_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_ROOM_ONLY, |
2173 | - 'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'), |
|
2174 | - 'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit', |
|
2175 | - 'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups', |
|
2176 | - 'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection', |
|
2177 | - 'clienttype')), |
|
2173 | + 'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'), |
|
2174 | + 'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit', |
|
2175 | + 'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups', |
|
2176 | + 'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection', |
|
2177 | + 'clienttype')), |
|
2178 | 2178 | BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY, |
2179 | - 'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'), |
|
2180 | - 'features' => array('showrecordings', 'importrecordings')) |
|
2179 | + 'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'), |
|
2180 | + 'features' => array('showrecordings', 'importrecordings')) |
|
2181 | 2181 | ); |
2182 | 2182 | return $instanceprofiles; |
2183 | 2183 | } |
@@ -2244,8 +2244,8 @@ discard block |
||
2244 | 2244 | $activitytime = ''; |
2245 | 2245 | if ($time) { |
2246 | 2246 | $activitytime = calendar_day_representation($time).' '. |
2247 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2248 | - calendar_time_representation($time); |
|
2247 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2248 | + calendar_time_representation($time); |
|
2249 | 2249 | } |
2250 | 2250 | return $activitytime; |
2251 | 2251 | } |
@@ -2545,7 +2545,7 @@ discard block |
||
2545 | 2545 | $renderer->render_group_element('participant_moderator_default', |
2546 | 2546 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
2547 | 2547 | array_keys($owner), array_merge($owner, $roles)) |
2548 | - ); |
|
2548 | + ); |
|
2549 | 2549 | } |
2550 | 2550 | } |
2551 | 2551 | |
@@ -2581,7 +2581,7 @@ discard block |
||
2581 | 2581 | // Web Client default. |
2582 | 2582 | $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default')); |
2583 | 2583 | $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
2584 | - BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
2584 | + BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
2585 | 2585 | $renderer->render_group_element('clienttype_default', |
2586 | 2586 | $renderer->render_group_element_configselect('clienttype_default', |
2587 | 2587 | $default, $choices)); |
@@ -2674,7 +2674,7 @@ discard block |
||
2674 | 2674 | return $output; |
2675 | 2675 | } |
2676 | 2676 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
2677 | - 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2677 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2678 | 2678 | $output .= ' ' . $message . "\n"; |
2679 | 2679 | $output .= ' <div class="singlebutton pull-right">' . "\n"; |
2680 | 2680 | if (!empty($href)) { |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * @author Fred Dixon (ffdixon [at] blindsidenetworks [dt] com) |
25 | 25 | */ |
26 | 26 | |
27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
29 | 29 | |
30 | 30 | $id = required_param('id', PARAM_INT); |
31 | 31 | $a = optional_param('a', 0, PARAM_INT); |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | if ($moderator || $administrator) { |
90 | 90 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_end'], $bigbluebuttonbn); |
91 | 91 | echo get_string('index_ending', 'bigbluebuttonbn'); |
92 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
92 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
93 | 93 | if ($g != '0') { |
94 | - $meetingid .= '['.$g.']'; |
|
94 | + $meetingid .= '[' . $g . ']'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
98 | - redirect('index.php?id='.$id); |
|
98 | + redirect('index.php?id=' . $id); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // Add a the data for the bigbluebuttonbn instance. |
111 | 111 | $groupobj = null; |
112 | 112 | if (groups_get_activity_groupmode($cm) > 0) { |
113 | - $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants')); |
|
113 | + $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants')); |
|
114 | 114 | } |
115 | 115 | $table->data[] = bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj); |
116 | 116 | // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any. |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | * @return array |
137 | 137 | */ |
138 | 138 | function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupobj = null) { |
139 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id; |
|
139 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id; |
|
140 | 140 | $paramgroup = ''; |
141 | 141 | $groupname = ''; |
142 | 142 | if ($groupobj) { |
143 | - $meetingid .= '['.$groupobj->id.']'; |
|
144 | - $paramgroup = '&group='.$groupobj->id; |
|
143 | + $meetingid .= '[' . $groupobj->id . ']'; |
|
144 | + $paramgroup = '&group=' . $groupobj->id; |
|
145 | 145 | $groupname = $groupobj->name; |
146 | 146 | } |
147 | 147 | $meetinginfo = bigbluebuttonbn_get_meeting_info_array($meetingid); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | return; |
157 | 157 | } |
158 | 158 | // Output Users in the meeting. |
159 | - $joinurl = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramgroup.'">'.format_string($bigbluebuttonbn->name).'</a>'; |
|
159 | + $joinurl = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramgroup . '">' . format_string($bigbluebuttonbn->name) . '</a>'; |
|
160 | 160 | $group = $groupname; |
161 | 161 | $users = ''; |
162 | 162 | $viewerlist = ''; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $attendeecount = 0; |
202 | 202 | foreach ($meetinginfo['attendees']->attendee as $attendee) { |
203 | 203 | if ($attendee->role == $role) { |
204 | - $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName; |
|
204 | + $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName; |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | } |
@@ -235,17 +235,17 @@ discard block |
||
235 | 235 | function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) { |
236 | 236 | $actions = ''; |
237 | 237 | if ($moderator) { |
238 | - $actions .= '<form name="form1" method="post" action="">'."\n"; |
|
239 | - $actions .= ' <INPUT type="hidden" name="id" value="'.$course->id.'">'."\n"; |
|
240 | - $actions .= ' <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'."\n"; |
|
238 | + $actions .= '<form name="form1" method="post" action="">' . "\n"; |
|
239 | + $actions .= ' <INPUT type="hidden" name="id" value="' . $course->id . '">' . "\n"; |
|
240 | + $actions .= ' <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . "\n"; |
|
241 | 241 | if ($groupobj != null) { |
242 | - $actions .= ' <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'."\n"; |
|
242 | + $actions .= ' <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . "\n"; |
|
243 | 243 | } |
244 | 244 | $actions .= ' <INPUT type="submit" name="submit" value="' . |
245 | 245 | get_string('view_conference_action_end', 'bigbluebuttonbn') . |
246 | 246 | '" class="btn btn-primary btn-sm" onclick="return confirm(\'' . |
247 | 247 | get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . "\n"; |
248 | - $actions .= '</form>'."\n"; |
|
248 | + $actions .= '</form>' . "\n"; |
|
249 | 249 | } |
250 | 250 | return $actions; |
251 | 251 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * Remove this block when restored |
62 | 62 | */ |
63 | 63 | |
64 | - /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
64 | + /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
65 | 65 | const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/'; |
66 | 66 | /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */ |
67 | 67 | const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6'; |
@@ -339,12 +339,12 @@ discard block |
||
339 | 339 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
340 | 340 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
341 | 341 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
342 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
342 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
343 | 343 | $str .= ' </div>'."\n"; |
344 | 344 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
345 | 345 | '</div>'."\n"; |
346 | 346 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
347 | - .'</div>'."\n"; |
|
347 | + .'</div>'."\n"; |
|
348 | 348 | $str .= '</div>'."\n"; |
349 | 349 | return $str; |
350 | 350 | } |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | $bigbluebuttonbn->coursemodule, |
530 | 530 | 'bigbluebuttonbn', |
531 | 531 | $bigbluebuttonbn->id, $bigbluebuttonbn->completionexpected |
532 | - ); |
|
532 | + ); |
|
533 | 533 | } |
534 | 534 | } |
535 | 535 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @uses FEATURE_GRADE_OUTCOMES |
103 | 103 | * @uses FEATURE_SHOW_DESCRIPTION |
104 | 104 | * @param string $feature |
105 | - * @return mixed True if yes (some features may use other values) |
|
105 | + * @return null|boolean True if yes (some features may use other values) |
|
106 | 106 | */ |
107 | 107 | function bigbluebuttonbn_supports($feature) { |
108 | 108 | if (!$feature) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * |
188 | 188 | * @param int $id Id of the module instance |
189 | 189 | * |
190 | - * @return bool Success/Failure |
|
190 | + * @return boolean|null Success/Failure |
|
191 | 191 | */ |
192 | 192 | function bigbluebuttonbn_delete_instance($id) { |
193 | 193 | global $DB; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * |
215 | 215 | * @param object $bigbluebuttonbn Id of the module instance |
216 | 216 | * |
217 | - * @return bool Success/Failure |
|
217 | + * @return boolean|null Success/Failure |
|
218 | 218 | */ |
219 | 219 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
220 | 220 | global $DB; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | * @param object $mod |
236 | 236 | * @param object $bigbluebuttonbn |
237 | 237 | * |
238 | - * @return bool |
|
238 | + * @return string |
|
239 | 239 | */ |
240 | 240 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
241 | 241 | global $DB; |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | * @param stdClass $context context object |
593 | 593 | * @param string $filearea file area |
594 | 594 | * |
595 | - * @return false|null false if file not valid |
|
595 | + * @return boolean false if file not valid |
|
596 | 596 | */ |
597 | 597 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
598 | 598 | if ($context->contextlevel != CONTEXT_MODULE) { |
@@ -28,29 +28,29 @@ discard block |
||
28 | 28 | |
29 | 29 | global $CFG; |
30 | 30 | |
31 | -require_once($CFG->dirroot.'/calendar/lib.php'); |
|
32 | -require_once($CFG->dirroot.'/message/lib.php'); |
|
33 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php'); |
|
34 | -require_once($CFG->dirroot.'/tag/lib.php'); |
|
35 | -require_once($CFG->libdir.'/accesslib.php'); |
|
36 | -require_once($CFG->libdir.'/completionlib.php'); |
|
37 | -require_once($CFG->libdir.'/datalib.php'); |
|
38 | -require_once($CFG->libdir.'/enrollib.php'); |
|
39 | -require_once($CFG->libdir.'/filelib.php'); |
|
40 | -require_once($CFG->libdir.'/formslib.php'); |
|
31 | +require_once($CFG->dirroot . '/calendar/lib.php'); |
|
32 | +require_once($CFG->dirroot . '/message/lib.php'); |
|
33 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php'); |
|
34 | +require_once($CFG->dirroot . '/tag/lib.php'); |
|
35 | +require_once($CFG->libdir . '/accesslib.php'); |
|
36 | +require_once($CFG->libdir . '/completionlib.php'); |
|
37 | +require_once($CFG->libdir . '/datalib.php'); |
|
38 | +require_once($CFG->libdir . '/enrollib.php'); |
|
39 | +require_once($CFG->libdir . '/filelib.php'); |
|
40 | +require_once($CFG->libdir . '/formslib.php'); |
|
41 | 41 | |
42 | 42 | |
43 | 43 | if (!class_exists('\Firebase\JWT\JWT') && |
44 | - file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
45 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'); |
|
44 | + file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { |
|
45 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | if (!isset($CFG->bigbluebuttonbn)) { |
49 | 49 | $CFG->bigbluebuttonbn = array(); |
50 | 50 | } |
51 | 51 | |
52 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
53 | - require_once(dirname(__FILE__).'/config.php'); |
|
52 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
53 | + require_once(dirname(__FILE__) . '/config.php'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /* |
@@ -103,18 +103,18 @@ discard block |
||
103 | 103 | return null; |
104 | 104 | } |
105 | 105 | $features = array( |
106 | - (string) FEATURE_IDNUMBER => true, |
|
107 | - (string) FEATURE_GROUPS => true, |
|
108 | - (string) FEATURE_GROUPINGS => true, |
|
109 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
110 | - (string) FEATURE_MOD_INTRO => true, |
|
111 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
112 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
113 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
114 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
115 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
106 | + (string)FEATURE_IDNUMBER => true, |
|
107 | + (string)FEATURE_GROUPS => true, |
|
108 | + (string)FEATURE_GROUPINGS => true, |
|
109 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
110 | + (string)FEATURE_MOD_INTRO => true, |
|
111 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
112 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
113 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
114 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
115 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
116 | 116 | ); |
117 | - if (isset($features[(string) $feature])) { |
|
117 | + if (isset($features[(string)$feature])) { |
|
118 | 118 | return $features[$feature]; |
119 | 119 | } |
120 | 120 | return null; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
214 | 214 | global $DB; |
215 | 215 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
216 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
216 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
217 | 217 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
218 | 218 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
219 | 219 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
237 | 237 | global $DB; |
238 | 238 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
239 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
239 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
240 | 240 | if ($completed > 0) { |
241 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
242 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
241 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
242 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
243 | 243 | get_string('view_message_times', 'bigbluebuttonbn'); |
244 | 244 | } |
245 | 245 | return ''; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
260 | 260 | global $DB; |
261 | 261 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
262 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
262 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
263 | 263 | '*', IGNORE_MULTIPLE); |
264 | 264 | return $completed > 0; |
265 | 265 | } |
@@ -345,16 +345,16 @@ discard block |
||
345 | 345 | if ($bigbluebuttonbn->visible) { |
346 | 346 | $classes = 'class="dimmed" '; |
347 | 347 | } |
348 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
349 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
350 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
351 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
352 | - $str .= ' </div>'."\n"; |
|
353 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
354 | - '</div>'."\n"; |
|
355 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
356 | - .'</div>'."\n"; |
|
357 | - $str .= '</div>'."\n"; |
|
348 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
349 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
350 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
351 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
352 | + $str .= ' </div>' . "\n"; |
|
353 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
354 | + '</div>' . "\n"; |
|
355 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
356 | + .'</div>' . "\n"; |
|
357 | + $str .= '</div>' . "\n"; |
|
358 | 358 | return $str; |
359 | 359 | } |
360 | 360 | |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | if (count($files) == 1) { |
574 | 574 | // Get the first (and only) file. |
575 | 575 | $file = reset($files); |
576 | - $filesrc = '/'.$file->get_filename(); |
|
576 | + $filesrc = '/' . $file->get_filename(); |
|
577 | 577 | } |
578 | 578 | return $filesrc; |
579 | 579 | } |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | if (!$filename) { |
642 | 642 | return false; |
643 | 643 | } |
644 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
644 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
645 | 645 | $fs = get_file_storage(); |
646 | 646 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
647 | 647 | if (!$file || $file->is_directory()) { |
@@ -212,7 +212,7 @@ |
||
212 | 212 | function($instanceid, $data) use ($user, $instanceidstocmids) { |
213 | 213 | $context = \context_module::instance($instanceidstocmids[$instanceid]); |
214 | 214 | $contextdata = helper::get_context_data($context, $user); |
215 | - $finaldata = (object) array_merge((array) $contextdata, ['logs' => $data]); |
|
215 | + $finaldata = (object)array_merge((array)$contextdata, ['logs' => $data]); |
|
216 | 216 | helper::export_context_files($context, $user); |
217 | 217 | writer::with_context($context)->export_data([], $finaldata); |
218 | 218 | } |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public static function _get_metadata(collection $collection) { |
63 | 63 | |
64 | - // The table bigbluebuttonbn stores only the room properties. |
|
65 | - // However, there is a chance that some personal information is stored as metadata. |
|
66 | - // This would be done in the column 'participants' where rules can be set to define BBB roles. |
|
67 | - // It is fair to say that only the userid is stored, which is useless if user is removed. |
|
68 | - // But if this is a concern a refactoring on the way the rules are stored will be required. |
|
64 | + // The table bigbluebuttonbn stores only the room properties. |
|
65 | + // However, there is a chance that some personal information is stored as metadata. |
|
66 | + // This would be done in the column 'participants' where rules can be set to define BBB roles. |
|
67 | + // It is fair to say that only the userid is stored, which is useless if user is removed. |
|
68 | + // But if this is a concern a refactoring on the way the rules are stored will be required. |
|
69 | 69 | $collection->add_database_table('bigbluebuttonbn', [ |
70 | 70 | 'participants' => 'privacy:metadata:bigbluebuttonbn:participants', |
71 | 71 | ], 'privacy:metadata:bigbluebuttonbn'); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | 'meetingid' => $record->meetingid, |
209 | 209 | 'log' => $record->log, |
210 | 210 | 'meta' => $record->meta, |
211 | - ]; |
|
211 | + ]; |
|
212 | 212 | return $carry; |
213 | 213 | }, |
214 | 214 | function($instanceid, $data) use ($user, $instanceidstocmids) { |