@@ -28,7 +28,7 @@ discard block |
||
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 rendering HTML for settings.php. |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $itemname = get_string('config_' . $name, 'bigbluebuttonbn'); |
67 | 67 | } |
68 | 68 | if ($itemdescription === null) { |
69 | - $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn'); |
|
69 | + $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn'); |
|
70 | 70 | } |
71 | 71 | $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription); |
72 | 72 | $this->settings->add($item); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | public function render_warning_message($name, $message, $type = 'warning', $closable = true) { |
149 | 149 | global $OUTPUT; |
150 | 150 | $output = $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
151 | - 'bigbluebuttonbn_' . $name)."\n"; |
|
151 | + 'bigbluebuttonbn_' . $name) . "\n"; |
|
152 | 152 | if ($closable) { |
153 | 153 | $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>' . "\n"; |
154 | 154 | } |
@@ -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, $cm); |
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. |
@@ -665,8 +665,8 @@ discard block |
||
665 | 665 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
666 | 666 | header('HTTP/1.0 202 Accepted'); |
667 | 667 | } catch (Exception $e) { |
668 | - $error = 'Caught exception: '.$e->getMessage(); |
|
669 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
668 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
669 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
670 | 670 | } |
671 | 671 | } |
672 | 672 | |
@@ -687,13 +687,13 @@ discard block |
||
687 | 687 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
688 | 688 | if (!isset($importrecordings[$params['id']])) { |
689 | 689 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
690 | - header('HTTP/1.0 404 Not found. '.$error); |
|
690 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
691 | 691 | return; |
692 | 692 | } |
693 | 693 | $callbackresponse = array('status' => true); |
694 | 694 | $importrecordings[$params['id']]['imported'] = true; |
695 | 695 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
696 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
696 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
697 | 697 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
698 | 698 | // Moodle event logger: Create an event for recording imported. |
699 | 699 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -719,8 +719,8 @@ discard block |
||
719 | 719 | $decodedparameters = JWT::decode($params['signed_parameters'], |
720 | 720 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
721 | 721 | } catch (Exception $e) { |
722 | - $error = 'Caught exception: '.$e->getMessage(); |
|
723 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
722 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
723 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
724 | 724 | return; |
725 | 725 | } |
726 | 726 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | } |
762 | 762 | $action = strtolower($params['action']); |
763 | 763 | if (!array_key_exists($action, $requiredparams)) { |
764 | - return 'Action '.$params['action'].' can not be performed.'; |
|
764 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
765 | 765 | } |
766 | 766 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
767 | 767 | } |
@@ -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. |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | protected function init() { |
42 | 42 | parent::init(); |
43 | - $this->description = "The user with id '##userid' viewed the bigbluebuttonbn activity management page for ". |
|
43 | + $this->description = "The user with id '##userid' viewed the bigbluebuttonbn activity management page for " . |
|
44 | 44 | "the course module id '##contextinstanceid'."; |
45 | 45 | } |
46 | 46 |
@@ -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); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | */ |
66 | 66 | protected function init($crud = 'r', $edulevel = self::LEVEL_PARTICIPATING) { |
67 | 67 | protected function init() { |
68 | - $this->data['crud'] = $crud; $this->data['crud'] = 'r'; |
|
68 | + $this->data['crud'] = $crud; $this->data['crud'] = 'r'; |
|
69 | 69 | $this->data['edulevel'] = $edulevel; |
70 | 70 | $this->data['objecttable'] = 'bigbluebuttonbn'; |
71 | 71 | } |
@@ -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 |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | */ |
90 | 90 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
91 | 91 | $data = ['meetingID' => $meetingid, |
92 | - 'fullName' => $username, |
|
93 | - 'password' => $pw, |
|
94 | - 'logoutURL' => $logouturl, |
|
92 | + 'fullName' => $username, |
|
93 | + 'password' => $pw, |
|
94 | + 'logoutURL' => $logouturl, |
|
95 | 95 | ]; |
96 | 96 | if (!is_null($configtoken)) { |
97 | 97 | $data['configToken'] = $configtoken; |
@@ -143,23 +143,23 @@ discard block |
||
143 | 143 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
144 | 144 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
145 | 145 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
146 | - ); |
|
146 | + ); |
|
147 | 147 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
148 | 148 | // Meeting info was returned. |
149 | 149 | return array('returncode' => $xml->returncode, |
150 | - 'meetingID' => $xml->meetingID, |
|
151 | - 'moderatorPW' => $xml->moderatorPW, |
|
152 | - 'attendeePW' => $xml->attendeePW, |
|
153 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
154 | - 'running' => $xml->running, |
|
155 | - 'recording' => $xml->recording, |
|
156 | - 'startTime' => $xml->startTime, |
|
157 | - 'endTime' => $xml->endTime, |
|
158 | - 'participantCount' => $xml->participantCount, |
|
159 | - 'moderatorCount' => $xml->moderatorCount, |
|
160 | - 'attendees' => $xml->attendees, |
|
161 | - 'metadata' => $xml->metadata, |
|
162 | - ); |
|
150 | + 'meetingID' => $xml->meetingID, |
|
151 | + 'moderatorPW' => $xml->moderatorPW, |
|
152 | + 'attendeePW' => $xml->attendeePW, |
|
153 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
154 | + 'running' => $xml->running, |
|
155 | + 'recording' => $xml->recording, |
|
156 | + 'startTime' => $xml->startTime, |
|
157 | + 'endTime' => $xml->endTime, |
|
158 | + 'participantCount' => $xml->participantCount, |
|
159 | + 'moderatorCount' => $xml->moderatorCount, |
|
160 | + 'attendees' => $xml->attendees, |
|
161 | + 'metadata' => $xml->metadata, |
|
162 | + ); |
|
163 | 163 | } |
164 | 164 | if ($xml) { |
165 | 165 | // Either failure or success without meeting info. |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | function bigbluebuttonbn_get_default_config_xml() { |
296 | 296 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
297 | 297 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
298 | - ); |
|
298 | + ); |
|
299 | 299 | return $xml; |
300 | 300 | } |
301 | 301 | |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | foreach ($ids as $id) { |
397 | 397 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
398 | 398 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
399 | - ); |
|
399 | + ); |
|
400 | 400 | if ($xml && $xml->returncode != 'SUCCESS') { |
401 | 401 | return false; |
402 | 402 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | foreach ($ids as $id) { |
416 | 416 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
417 | 417 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
418 | - ); |
|
418 | + ); |
|
419 | 419 | if ($xml && $xml->returncode != 'SUCCESS') { |
420 | 420 | return false; |
421 | 421 | } |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | foreach ($ids as $id) { |
435 | 435 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
436 | 436 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
437 | - ); |
|
437 | + ); |
|
438 | 438 | if ($xml && $xml->returncode != 'SUCCESS') { |
439 | 439 | return false; |
440 | 440 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
452 | 452 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
453 | 453 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
454 | - ); |
|
454 | + ); |
|
455 | 455 | if ($xml) { |
456 | 456 | // If the xml packet returned failure it displays the message to the user. |
457 | 457 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | function bigbluebuttonbn_get_server_version() { |
469 | 469 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
470 | 470 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
471 | - ); |
|
471 | + ); |
|
472 | 472 | if ($xml && $xml->returncode == 'SUCCESS') { |
473 | 473 | return $xml->version; |
474 | 474 | } |
@@ -535,10 +535,10 @@ discard block |
||
535 | 535 | } |
536 | 536 | $options = array(); |
537 | 537 | $options['CURLOPT_HTTPHEADER'] = array( |
538 | - 'Content-Type: '.$contenttype, |
|
539 | - 'Content-Length: '.strlen($data), |
|
540 | - 'Content-Language: en-US', |
|
541 | - ); |
|
538 | + 'Content-Type: '.$contenttype, |
|
539 | + 'Content-Length: '.strlen($data), |
|
540 | + 'Content-Language: en-US', |
|
541 | + ); |
|
542 | 542 | |
543 | 543 | return $c->post($url, $data, $options); |
544 | 544 | } |
@@ -685,16 +685,16 @@ discard block |
||
685 | 685 | 'all' => array( |
686 | 686 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
687 | 687 | 'children' => [] |
688 | - ) |
|
689 | - ); |
|
688 | + ) |
|
689 | + ); |
|
690 | 690 | $data['role'] = array( |
691 | 691 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
692 | 692 | 'children' => bigbluebuttonbn_get_roles_select($context) |
693 | - ); |
|
693 | + ); |
|
694 | 694 | $data['user'] = array( |
695 | 695 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
696 | 696 | 'children' => bigbluebuttonbn_get_users_select($context) |
697 | - ); |
|
697 | + ); |
|
698 | 698 | return $data; |
699 | 699 | } |
700 | 700 | |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | 'selectiontype' => 'all', |
738 | 738 | 'selectionid' => 'all', |
739 | 739 | 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER |
740 | - ); |
|
740 | + ); |
|
741 | 741 | $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default')); |
742 | 742 | foreach ($defaultrules as $defaultrule) { |
743 | 743 | if ($defaultrule == '0') { |
@@ -750,9 +750,9 @@ discard block |
||
750 | 750 | continue; |
751 | 751 | } |
752 | 752 | $participantlist[] = array( |
753 | - 'selectiontype' => 'role', |
|
754 | - 'selectionid' => $defaultrule, |
|
755 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
753 | + 'selectiontype' => 'role', |
|
754 | + 'selectionid' => $defaultrule, |
|
755 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
756 | 756 | } |
757 | 757 | return $participantlist; |
758 | 758 | } |
@@ -791,11 +791,11 @@ discard block |
||
791 | 791 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
792 | 792 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
793 | 793 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
794 | - ], |
|
794 | + ], |
|
795 | 795 | 'type_selected' => 'all', |
796 | 796 | 'options' => ['all' => '---------------'], |
797 | 797 | 'selected' => 'all', |
798 | - ]; |
|
798 | + ]; |
|
799 | 799 | } |
800 | 800 | |
801 | 801 | /** |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | // Ping again and refresh the cache. |
1071 | 1071 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
1072 | 1072 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1073 | - ); |
|
1073 | + ); |
|
1074 | 1074 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
1075 | 1075 | return $meetinginfo; |
1076 | 1076 | } |
@@ -1482,8 +1482,8 @@ discard block |
||
1482 | 1482 | } |
1483 | 1483 | $id = 'playbacks-'.$recording['recordID']; |
1484 | 1484 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1485 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1486 | - 'title' => $title, $visibility => $visibility)); |
|
1485 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1486 | + 'title' => $title, $visibility => $visibility)); |
|
1487 | 1487 | foreach ($recording['playbacks'] as $playback) { |
1488 | 1488 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback); |
1489 | 1489 | } |
@@ -1507,7 +1507,7 @@ discard block |
||
1507 | 1507 | } |
1508 | 1508 | $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1509 | 1509 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1510 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1510 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1511 | 1511 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1512 | 1512 | $href .= '&href='.urlencode(trim($playback['url'])); |
1513 | 1513 | } |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | 'data-action' => 'play', |
1519 | 1519 | 'data-target' => $playback['type'], |
1520 | 1520 | 'data-href' => $href, |
1521 | - ); |
|
1521 | + ); |
|
1522 | 1522 | if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) { |
1523 | 1523 | $linkattributes['class'] = 'btn btn-sm btn-warning'; |
1524 | 1524 | $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn'); |
@@ -1668,10 +1668,10 @@ discard block |
||
1668 | 1668 | 'id' => $id, |
1669 | 1669 | 'onclick' => $onclick, |
1670 | 1670 | 'data-action' => $data['action'] |
1671 | - ); |
|
1671 | + ); |
|
1672 | 1672 | if (!isset($recording['imported'])) { |
1673 | 1673 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
1674 | - $recording['recordID']); |
|
1674 | + $recording['recordID']); |
|
1675 | 1675 | } |
1676 | 1676 | if (isset($data['disabled'])) { |
1677 | 1677 | $iconattributes['class'] .= ' fa-' . $data['disabled']; |
@@ -2212,8 +2212,8 @@ discard block |
||
2212 | 2212 | $activitytime = ''; |
2213 | 2213 | if ($time) { |
2214 | 2214 | $activitytime = calendar_day_representation($time).' '. |
2215 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2216 | - calendar_time_representation($time); |
|
2215 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2216 | + calendar_time_representation($time); |
|
2217 | 2217 | } |
2218 | 2218 | return $activitytime; |
2219 | 2219 | } |
@@ -2513,7 +2513,7 @@ discard block |
||
2513 | 2513 | $renderer->render_group_element('participant_moderator_default', |
2514 | 2514 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
2515 | 2515 | array_keys($owner), array_merge($owner, $roles)) |
2516 | - ); |
|
2516 | + ); |
|
2517 | 2517 | } |
2518 | 2518 | } |
2519 | 2519 | |
@@ -2617,7 +2617,7 @@ discard block |
||
2617 | 2617 | return $output; |
2618 | 2618 | } |
2619 | 2619 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
2620 | - 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2620 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2621 | 2621 | $output .= ' ' . $message . "\n"; |
2622 | 2622 | $output .= ' <div class="singlebutton pull-right">' . "\n"; |
2623 | 2623 | if (!empty($href)) { |
@@ -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; |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | $data = null; |
119 | 119 | if (!is_null($pname) && !is_null($purl)) { |
120 | 120 | $method = 'POST'; |
121 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
122 | - $purl."' /></module></modules>"; |
|
121 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
122 | + $purl . "' /></module></modules>"; |
|
123 | 123 | } |
124 | 124 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
125 | 125 | if ($xml) { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | // Override imported flag with actual ID. |
281 | 281 | $recording['imported'] = $recordimported->id; |
282 | 282 | if (isset($recordimported->protected)) { |
283 | - $recording['protected'] = (string) $recordimported->protected; |
|
283 | + $recording['protected'] = (string)$recordimported->protected; |
|
284 | 284 | } |
285 | 285 | $recordsimportedarray[$recording['recordID']] = $recording; |
286 | 286 | } |
@@ -310,21 +310,21 @@ discard block |
||
310 | 310 | // Add formats. |
311 | 311 | $playbackarray = array(); |
312 | 312 | foreach ($recording->playback->format as $format) { |
313 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
314 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
313 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
314 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
315 | 315 | // Add preview per format when existing. |
316 | 316 | if ($format->preview) { |
317 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
317 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | // Add the metadata to the recordings array. |
321 | 321 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
322 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
323 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
324 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
325 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
322 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
323 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
324 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
325 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
326 | 326 | if (isset($recording->protected)) { |
327 | - $recordingarray['protected'] = (string) $recording->protected; |
|
327 | + $recordingarray['protected'] = (string)$recording->protected; |
|
328 | 328 | } |
329 | 329 | return $recordingarray + $metadataarray; |
330 | 330 | } |
@@ -339,9 +339,9 @@ discard block |
||
339 | 339 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
340 | 340 | $imagesarray = array(); |
341 | 341 | foreach ($preview->images->image as $image) { |
342 | - $imagearray = array('url' => trim((string) $image)); |
|
342 | + $imagearray = array('url' => trim((string)$image)); |
|
343 | 343 | foreach ($image->attributes() as $attkey => $attvalue) { |
344 | - $imagearray[$attkey] = (string) $attvalue; |
|
344 | + $imagearray[$attkey] = (string)$attvalue; |
|
345 | 345 | } |
346 | 346 | array_push($imagesarray, $imagearray); |
347 | 347 | } |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | if (is_object($value)) { |
362 | 362 | $value = ''; |
363 | 363 | } |
364 | - $metadataarray['meta_'.$key] = $value; |
|
364 | + $metadataarray['meta_' . $key] = $value; |
|
365 | 365 | } |
366 | 366 | return $metadataarray; |
367 | 367 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $ids = explode(',', $recordids); |
434 | 434 | foreach ($ids as $id) { |
435 | 435 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
436 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
436 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
437 | 437 | ); |
438 | 438 | if ($xml && $xml->returncode != 'SUCCESS') { |
439 | 439 | return false; |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | return $xml; |
499 | 499 | } catch (Exception $e) { |
500 | 500 | libxml_use_internal_errors($previous); |
501 | - $error = 'Caught exception: '.$e->getMessage(); |
|
501 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
502 | 502 | debugging($error, DEBUG_DEVELOPER); |
503 | 503 | return null; |
504 | 504 | } |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
510 | 510 | return $response; |
511 | 511 | } catch (Exception $e) { |
512 | - $error = 'Caught exception: '.$e->getMessage(); |
|
512 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
513 | 513 | debugging($error, DEBUG_DEVELOPER); |
514 | 514 | libxml_use_internal_errors($previous); |
515 | 515 | return null; |
@@ -535,8 +535,8 @@ discard block |
||
535 | 535 | } |
536 | 536 | $options = array(); |
537 | 537 | $options['CURLOPT_HTTPHEADER'] = array( |
538 | - 'Content-Type: '.$contenttype, |
|
539 | - 'Content-Length: '.strlen($data), |
|
538 | + 'Content-Type: ' . $contenttype, |
|
539 | + 'Content-Length: ' . strlen($data), |
|
540 | 540 | 'Content-Language: en-US', |
541 | 541 | ); |
542 | 542 | |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | * @return void |
558 | 558 | */ |
559 | 559 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
560 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
560 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
561 | 561 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
562 | 562 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
563 | 563 | } |
@@ -577,9 +577,9 @@ discard block |
||
577 | 577 | if ($userroles) { |
578 | 578 | $where = ''; |
579 | 579 | foreach ($userroles as $userrole) { |
580 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
580 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
581 | 581 | } |
582 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
582 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
583 | 583 | } |
584 | 584 | return $userroles; |
585 | 585 | } |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | * @return array $users |
603 | 603 | */ |
604 | 604 | function bigbluebuttonbn_get_users(context $context = null) { |
605 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
605 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
606 | 606 | foreach ($users as $key => $value) { |
607 | 607 | $users[$key] = fullname($value); |
608 | 608 | } |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | * @return array $users |
618 | 618 | */ |
619 | 619 | function bigbluebuttonbn_get_users_select(context $context = null) { |
620 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
620 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
621 | 621 | foreach ($users as $key => $value) { |
622 | 622 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
623 | 623 | } |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | * @return array $roles |
633 | 633 | */ |
634 | 634 | function bigbluebuttonbn_get_roles(context $context = null) { |
635 | - $roles = (array) role_get_names($context); |
|
635 | + $roles = (array)role_get_names($context); |
|
636 | 636 | foreach ($roles as $key => $value) { |
637 | 637 | $roles[$key] = $value->localname; |
638 | 638 | } |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | * @return array $users |
648 | 648 | */ |
649 | 649 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
650 | - $roles = (array) role_get_names($context); |
|
650 | + $roles = (array)role_get_names($context); |
|
651 | 651 | foreach ($roles as $key => $value) { |
652 | 652 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
653 | 653 | } |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | * @return object $role |
663 | 663 | */ |
664 | 664 | function bigbluebuttonbn_get_role($id) { |
665 | - $roles = (array) role_get_names(); |
|
665 | + $roles = (array)role_get_names(); |
|
666 | 666 | if (is_numeric($id) && isset($roles[$id])) { |
667 | 667 | return (object)$roles[$id]; |
668 | 668 | } |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | if (!isguestuser()) { |
820 | 820 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid); |
821 | 821 | } |
822 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
822 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
823 | 823 | } |
824 | 824 | |
825 | 825 | /** |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | function bigbluebuttonbn_generate_nonce() { |
976 | 976 | $mt = microtime(); |
977 | 977 | $rand = mt_rand(); |
978 | - return md5($mt.$rand); |
|
978 | + return md5($mt . $rand); |
|
979 | 979 | } |
980 | 980 | |
981 | 981 | /** |
@@ -1065,10 +1065,10 @@ discard block |
||
1065 | 1065 | $now = time(); |
1066 | 1066 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1067 | 1067 | // Use the value in the cache. |
1068 | - return (array) json_decode($result['meeting_info']); |
|
1068 | + return (array)json_decode($result['meeting_info']); |
|
1069 | 1069 | } |
1070 | 1070 | // Ping again and refresh the cache. |
1071 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1071 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1072 | 1072 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1073 | 1073 | ); |
1074 | 1074 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | * @return object |
1180 | 1180 | */ |
1181 | 1181 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1182 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1182 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1183 | 1183 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1184 | 1184 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1185 | 1185 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1195,8 +1195,8 @@ discard block |
||
1195 | 1195 | * @return string |
1196 | 1196 | */ |
1197 | 1197 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1198 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1199 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1198 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1199 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1200 | 1200 | return $configxmlparams; |
1201 | 1201 | } |
1202 | 1202 | |
@@ -1210,7 +1210,7 @@ discard block |
||
1210 | 1210 | */ |
1211 | 1211 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1212 | 1212 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1213 | - $configxmlarray = (array) $configxml; |
|
1213 | + $configxmlarray = (array)$configxml; |
|
1214 | 1214 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1215 | 1215 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1216 | 1216 | return ''; |
@@ -1302,7 +1302,7 @@ discard block |
||
1302 | 1302 | global $USER; |
1303 | 1303 | $starttime = $starttime - ($starttime % 1000); |
1304 | 1304 | // Set formatted date. |
1305 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1305 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1306 | 1306 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1307 | 1307 | } |
1308 | 1308 | |
@@ -1418,7 +1418,7 @@ discard block |
||
1418 | 1418 | * @return string |
1419 | 1419 | */ |
1420 | 1420 | function bigbluebuttonbn_get_recording_data_row_preview($recording) { |
1421 | - $options = array('id' => 'preview-'.$recording['recordID']); |
|
1421 | + $options = array('id' => 'preview-' . $recording['recordID']); |
|
1422 | 1422 | if ($recording['published'] === 'false') { |
1423 | 1423 | $options['hidden'] = 'hidden'; |
1424 | 1424 | } |
@@ -1480,7 +1480,7 @@ discard block |
||
1480 | 1480 | if ($recording['published'] === 'false') { |
1481 | 1481 | $visibility = 'hidden '; |
1482 | 1482 | } |
1483 | - $id = 'playbacks-'.$recording['recordID']; |
|
1483 | + $id = 'playbacks-' . $recording['recordID']; |
|
1484 | 1484 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1485 | 1485 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1486 | 1486 | 'title' => $title, $visibility => $visibility)); |
@@ -1505,11 +1505,11 @@ discard block |
||
1505 | 1505 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
1506 | 1506 | return ''; |
1507 | 1507 | } |
1508 | - $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1508 | + $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1509 | 1509 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1510 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1510 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1511 | 1511 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1512 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1512 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1513 | 1513 | } |
1514 | 1514 | $linkattributes = array( |
1515 | 1515 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | $linkattributes['class'] = 'disabled'; |
1679 | 1679 | unset($linkattributes['onclick']); |
1680 | 1680 | } |
1681 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1681 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1682 | 1682 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1683 | 1683 | 'moodle', $iconattributes); |
1684 | 1684 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1795,7 +1795,7 @@ discard block |
||
1795 | 1795 | */ |
1796 | 1796 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
1797 | 1797 | $row = new html_table_row(); |
1798 | - $row->id = 'recording-tr-'.$recording['recordID']; |
|
1798 | + $row->id = 'recording-tr-' . $recording['recordID']; |
|
1799 | 1799 | $row->attributes['data-imported'] = 'false'; |
1800 | 1800 | $texthead = ''; |
1801 | 1801 | $texttail = ''; |
@@ -1855,9 +1855,9 @@ discard block |
||
1855 | 1855 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
1856 | 1856 | $sender = get_admin(); |
1857 | 1857 | // Prepare message. |
1858 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
1859 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
1860 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1858 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
1859 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
1860 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1861 | 1861 | $context = context_course::instance($bigbluebuttonbn->course); |
1862 | 1862 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
1863 | 1863 | } |
@@ -2079,7 +2079,7 @@ discard block |
||
2079 | 2079 | } |
2080 | 2080 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2081 | 2081 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2082 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2082 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2083 | 2083 | // Include only Create events and exclude those with record not true. |
2084 | 2084 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2085 | 2085 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2211,8 +2211,8 @@ discard block |
||
2211 | 2211 | function bigbluebuttonbn_format_activity_time($time) { |
2212 | 2212 | $activitytime = ''; |
2213 | 2213 | if ($time) { |
2214 | - $activitytime = calendar_day_representation($time).' '. |
|
2215 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2214 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2215 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2216 | 2216 | calendar_time_representation($time); |
2217 | 2217 | } |
2218 | 2218 | return $activitytime; |
@@ -2609,7 +2609,7 @@ discard block |
||
2609 | 2609 | * |
2610 | 2610 | * @return string |
2611 | 2611 | */ |
2612 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
2612 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
2613 | 2613 | global $OUTPUT; |
2614 | 2614 | $output = "\n"; |
2615 | 2615 | // Evaluates if config_warning is enabled. |
@@ -2648,11 +2648,11 @@ discard block |
||
2648 | 2648 | if ($class == '') { |
2649 | 2649 | $class = 'btn btn-secondary'; |
2650 | 2650 | } |
2651 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
2652 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
2653 | - $output .= ' title="' . $title . '"'."\n"; |
|
2654 | - $output .= ' >' . $text . '</button>'."\n"; |
|
2655 | - $output .= ' </form>'."\n"; |
|
2651 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
2652 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
2653 | + $output .= ' title="' . $title . '"' . "\n"; |
|
2654 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
2655 | + $output .= ' </form>' . "\n"; |
|
2656 | 2656 | return $output; |
2657 | 2657 | } |
2658 | 2658 |
@@ -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 | } |