@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | * Helper function to retrieve imported recordings from the Moodle database. |
313 | 313 | * The references are stored as events in bigbluebuttonbn_logs. |
314 | 314 | * |
315 | - * @param string $courseid |
|
315 | + * @param integer $courseid |
|
316 | 316 | * @param string $bigbluebuttonbnid |
317 | 317 | * @param bool $subset |
318 | 318 | * |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | /** |
342 | 342 | * Helper function to retrive the default config.xml file. |
343 | 343 | * |
344 | - * @return string |
|
344 | + * @return null|SimpleXMLElement |
|
345 | 345 | */ |
346 | 346 | function bigbluebuttonbn_get_default_config_xml() |
347 | 347 | { |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | * @param object $a |
428 | 428 | * @param object $b |
429 | 429 | * |
430 | - * @return array |
|
430 | + * @return integer |
|
431 | 431 | */ |
432 | 432 | function bigbluebuttonbn_recording_build_sorter($a, $b) |
433 | 433 | { |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | * @param string $data |
548 | 548 | * @param string $contenttype |
549 | 549 | * |
550 | - * @return object |
|
550 | + * @return null|SimpleXMLElement |
|
551 | 551 | */ |
552 | 552 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') |
553 | 553 | { |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | * @param string $data |
590 | 590 | * @param string $contenttype |
591 | 591 | * |
592 | - * @return object |
|
592 | + * @return string |
|
593 | 593 | */ |
594 | 594 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') |
595 | 595 | { |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | * @param integer $instance |
981 | 981 | * @param integer $voicebridge |
982 | 982 | * |
983 | - * @return string |
|
983 | + * @return boolean |
|
984 | 984 | */ |
985 | 985 | function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) |
986 | 986 | { |
@@ -1342,7 +1342,7 @@ discard block |
||
1342 | 1342 | * @param string $meetingid |
1343 | 1343 | * @param string $configxml |
1344 | 1344 | * |
1345 | - * @return object |
|
1345 | + * @return null|SimpleXMLElement |
|
1346 | 1346 | */ |
1347 | 1347 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) |
1348 | 1348 | { |
@@ -1398,7 +1398,7 @@ discard block |
||
1398 | 1398 | * @param array $recording |
1399 | 1399 | * @param array $tools |
1400 | 1400 | * |
1401 | - * @return array |
|
1401 | + * @return null|stdClass |
|
1402 | 1402 | */ |
1403 | 1403 | function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) |
1404 | 1404 | { |
@@ -2045,7 +2045,7 @@ discard block |
||
2045 | 2045 | * |
2046 | 2046 | * @param array $bbbsession |
2047 | 2047 | * @param array $recording |
2048 | - * @param object $rowdata |
|
2048 | + * @param stdClass $rowdata |
|
2049 | 2049 | * |
2050 | 2050 | * @return object |
2051 | 2051 | */ |
@@ -2240,7 +2240,7 @@ discard block |
||
2240 | 2240 | * |
2241 | 2241 | * @param array $bbbsession |
2242 | 2242 | * @param array $recordings |
2243 | - * @param array $tools |
|
2243 | + * @param string[] $tools |
|
2244 | 2244 | * |
2245 | 2245 | * @return array |
2246 | 2246 | */ |
@@ -2321,7 +2321,7 @@ discard block |
||
2321 | 2321 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
2322 | 2322 | * in the getRecordings request considering only those that belong to deleted activities. |
2323 | 2323 | * |
2324 | - * @param string $courseid |
|
2324 | + * @param integer $courseid |
|
2325 | 2325 | * @param string $bigbluebuttonbnid |
2326 | 2326 | * @param bool $subset |
2327 | 2327 | * |
@@ -2345,7 +2345,7 @@ discard block |
||
2345 | 2345 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
2346 | 2346 | * in the getRecordings request considering only those that belong to imported recordings. |
2347 | 2347 | * |
2348 | - * @param string $courseid |
|
2348 | + * @param integer $courseid |
|
2349 | 2349 | * @param string $bigbluebuttonbnid |
2350 | 2350 | * @param bool $subset |
2351 | 2351 | * |
@@ -2368,7 +2368,7 @@ discard block |
||
2368 | 2368 | /** |
2369 | 2369 | * Helper function to get recordings and imported recordings together. |
2370 | 2370 | * |
2371 | - * @param string $courseid |
|
2371 | + * @param integer $courseid |
|
2372 | 2372 | * @param string $bigbluebuttonbnid |
2373 | 2373 | * @param bool $subset |
2374 | 2374 | * @param bool $includedeleted |
@@ -2386,7 +2386,7 @@ discard block |
||
2386 | 2386 | * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events |
2387 | 2387 | * in bigbluebuttonbn_logs. |
2388 | 2388 | * |
2389 | - * @param string $courseid |
|
2389 | + * @param integer $courseid |
|
2390 | 2390 | * @param string $bigbluebuttonbnid |
2391 | 2391 | * @param bool $subset |
2392 | 2392 | * @param bool $includedeleted |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | $clienttype = BIGBLUEBUTTON_CLIENTTYPE_FLASH |
112 | 112 | ) { |
113 | 113 | $data = ['meetingID' => $meetingid, |
114 | - 'fullName' => $username, |
|
115 | - 'password' => $pw, |
|
116 | - 'logoutURL' => $logouturl, |
|
114 | + 'fullName' => $username, |
|
115 | + 'password' => $pw, |
|
116 | + 'logoutURL' => $logouturl, |
|
117 | 117 | ]; |
118 | 118 | // Choose between Adobe Flash or HTML5 Client. |
119 | 119 | if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) { |
@@ -171,23 +171,23 @@ discard block |
||
171 | 171 | { |
172 | 172 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
173 | 173 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
174 | - ); |
|
174 | + ); |
|
175 | 175 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
176 | 176 | // Meeting info was returned. |
177 | 177 | return array('returncode' => $xml->returncode, |
178 | - 'meetingID' => $xml->meetingID, |
|
179 | - 'moderatorPW' => $xml->moderatorPW, |
|
180 | - 'attendeePW' => $xml->attendeePW, |
|
181 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
182 | - 'running' => $xml->running, |
|
183 | - 'recording' => $xml->recording, |
|
184 | - 'startTime' => $xml->startTime, |
|
185 | - 'endTime' => $xml->endTime, |
|
186 | - 'participantCount' => $xml->participantCount, |
|
187 | - 'moderatorCount' => $xml->moderatorCount, |
|
188 | - 'attendees' => $xml->attendees, |
|
189 | - 'metadata' => $xml->metadata, |
|
190 | - ); |
|
178 | + 'meetingID' => $xml->meetingID, |
|
179 | + 'moderatorPW' => $xml->moderatorPW, |
|
180 | + 'attendeePW' => $xml->attendeePW, |
|
181 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
182 | + 'running' => $xml->running, |
|
183 | + 'recording' => $xml->recording, |
|
184 | + 'startTime' => $xml->startTime, |
|
185 | + 'endTime' => $xml->endTime, |
|
186 | + 'participantCount' => $xml->participantCount, |
|
187 | + 'moderatorCount' => $xml->moderatorCount, |
|
188 | + 'attendees' => $xml->attendees, |
|
189 | + 'metadata' => $xml->metadata, |
|
190 | + ); |
|
191 | 191 | } |
192 | 192 | if ($xml) { |
193 | 193 | // Either failure or success without meeting info. |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | { |
348 | 348 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
349 | 349 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
350 | - ); |
|
350 | + ); |
|
351 | 351 | return $xml; |
352 | 352 | } |
353 | 353 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | foreach ($ids as $id) { |
457 | 457 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
458 | 458 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
459 | - ); |
|
459 | + ); |
|
460 | 460 | if ($xml && $xml->returncode != 'SUCCESS') { |
461 | 461 | return false; |
462 | 462 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | foreach ($ids as $id) { |
477 | 477 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
478 | 478 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
479 | - ); |
|
479 | + ); |
|
480 | 480 | if ($xml && $xml->returncode != 'SUCCESS') { |
481 | 481 | return false; |
482 | 482 | } |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | foreach ($ids as $id) { |
497 | 497 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
498 | 498 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
499 | - ); |
|
499 | + ); |
|
500 | 500 | if ($xml && $xml->returncode != 'SUCCESS') { |
501 | 501 | return false; |
502 | 502 | } |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | { |
515 | 515 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
516 | 516 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
517 | - ); |
|
517 | + ); |
|
518 | 518 | if ($xml) { |
519 | 519 | // If the xml packet returned failure it displays the message to the user. |
520 | 520 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | { |
533 | 533 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
534 | 534 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
535 | - ); |
|
535 | + ); |
|
536 | 536 | if ($xml && $xml->returncode == 'SUCCESS') { |
537 | 537 | return $xml->version; |
538 | 538 | } |
@@ -601,10 +601,10 @@ discard block |
||
601 | 601 | } |
602 | 602 | $options = array(); |
603 | 603 | $options['CURLOPT_HTTPHEADER'] = array( |
604 | - 'Content-Type: '.$contenttype, |
|
605 | - 'Content-Length: '.strlen($data), |
|
606 | - 'Content-Language: en-US', |
|
607 | - ); |
|
604 | + 'Content-Type: '.$contenttype, |
|
605 | + 'Content-Length: '.strlen($data), |
|
606 | + 'Content-Language: en-US', |
|
607 | + ); |
|
608 | 608 | |
609 | 609 | return $c->post($url, $data, $options); |
610 | 610 | } |
@@ -760,16 +760,16 @@ discard block |
||
760 | 760 | 'all' => array( |
761 | 761 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
762 | 762 | 'children' => [] |
763 | - ) |
|
764 | - ); |
|
763 | + ) |
|
764 | + ); |
|
765 | 765 | $data['role'] = array( |
766 | 766 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
767 | 767 | 'children' => bigbluebuttonbn_get_roles_select($context) |
768 | - ); |
|
768 | + ); |
|
769 | 769 | $data['user'] = array( |
770 | 770 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
771 | 771 | 'children' => bigbluebuttonbn_get_users_select($context) |
772 | - ); |
|
772 | + ); |
|
773 | 773 | return $data; |
774 | 774 | } |
775 | 775 | |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | 'selectiontype' => 'all', |
815 | 815 | 'selectionid' => 'all', |
816 | 816 | 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER |
817 | - ); |
|
817 | + ); |
|
818 | 818 | $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default')); |
819 | 819 | foreach ($defaultrules as $defaultrule) { |
820 | 820 | if ($defaultrule == '0') { |
@@ -827,9 +827,9 @@ discard block |
||
827 | 827 | continue; |
828 | 828 | } |
829 | 829 | $participantlist[] = array( |
830 | - 'selectiontype' => 'role', |
|
831 | - 'selectionid' => $defaultrule, |
|
832 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
830 | + 'selectiontype' => 'role', |
|
831 | + 'selectionid' => $defaultrule, |
|
832 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
833 | 833 | } |
834 | 834 | return $participantlist; |
835 | 835 | } |
@@ -870,11 +870,11 @@ discard block |
||
870 | 870 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
871 | 871 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
872 | 872 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
873 | - ], |
|
873 | + ], |
|
874 | 874 | 'type_selected' => 'all', |
875 | 875 | 'options' => ['all' => '---------------'], |
876 | 876 | 'selected' => 'all', |
877 | - ]; |
|
877 | + ]; |
|
878 | 878 | } |
879 | 879 | |
880 | 880 | /** |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | // Ping again and refresh the cache. |
1232 | 1232 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
1233 | 1233 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1234 | - ); |
|
1234 | + ); |
|
1235 | 1235 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
1236 | 1236 | return $meetinginfo; |
1237 | 1237 | } |
@@ -1674,8 +1674,8 @@ discard block |
||
1674 | 1674 | } |
1675 | 1675 | $id = 'playbacks-'.$recording['recordID']; |
1676 | 1676 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1677 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1678 | - 'title' => $title, $visibility => $visibility)); |
|
1677 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1678 | + 'title' => $title, $visibility => $visibility)); |
|
1679 | 1679 | foreach ($recording['playbacks'] as $playback) { |
1680 | 1680 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback); |
1681 | 1681 | } |
@@ -1699,7 +1699,7 @@ discard block |
||
1699 | 1699 | } |
1700 | 1700 | $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1701 | 1701 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1702 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1702 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1703 | 1703 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1704 | 1704 | $href .= '&href='.urlencode(trim($playback['url'])); |
1705 | 1705 | } |
@@ -1710,7 +1710,7 @@ discard block |
||
1710 | 1710 | 'data-action' => 'play', |
1711 | 1711 | 'data-target' => $playback['type'], |
1712 | 1712 | 'data-href' => $href, |
1713 | - ); |
|
1713 | + ); |
|
1714 | 1714 | if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) { |
1715 | 1715 | $linkattributes['class'] = 'btn btn-sm btn-warning'; |
1716 | 1716 | $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn'); |
@@ -1875,7 +1875,7 @@ discard block |
||
1875 | 1875 | 'id' => $id, |
1876 | 1876 | 'onclick' => $onclick, |
1877 | 1877 | 'data-action' => $data['action'] |
1878 | - ); |
|
1878 | + ); |
|
1879 | 1879 | if (!isset($recording['imported'])) { |
1880 | 1880 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
1881 | 1881 | $recording['recordID'] |
@@ -2509,17 +2509,17 @@ discard block |
||
2509 | 2509 | function bigbluebuttonbn_get_instance_type_profiles() { |
2510 | 2510 | $instanceprofiles = array( |
2511 | 2511 | BIGBLUEBUTTONBN_TYPE_ALL => array('id' => BIGBLUEBUTTONBN_TYPE_ALL, |
2512 | - 'name' => get_string('instance_type_default', 'bigbluebuttonbn'), |
|
2513 | - 'features' => array('all')), |
|
2512 | + 'name' => get_string('instance_type_default', 'bigbluebuttonbn'), |
|
2513 | + 'features' => array('all')), |
|
2514 | 2514 | BIGBLUEBUTTONBN_TYPE_ROOM_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_ROOM_ONLY, |
2515 | - 'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'), |
|
2516 | - 'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit', |
|
2517 | - 'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups', |
|
2518 | - 'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection', |
|
2519 | - 'clienttype', 'completionattendance', 'completionengagement')), |
|
2515 | + 'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'), |
|
2516 | + 'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit', |
|
2517 | + 'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups', |
|
2518 | + 'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection', |
|
2519 | + 'clienttype', 'completionattendance', 'completionengagement')), |
|
2520 | 2520 | BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY, |
2521 | - 'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'), |
|
2522 | - 'features' => array('showrecordings', 'importrecordings')) |
|
2521 | + 'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'), |
|
2522 | + 'features' => array('showrecordings', 'importrecordings')) |
|
2523 | 2523 | ); |
2524 | 2524 | return $instanceprofiles; |
2525 | 2525 | } |
@@ -2606,8 +2606,8 @@ discard block |
||
2606 | 2606 | $activitytime = ''; |
2607 | 2607 | if ($time) { |
2608 | 2608 | $activitytime = calendar_day_representation($time).' '. |
2609 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2610 | - calendar_time_representation($time); |
|
2609 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2610 | + calendar_time_representation($time); |
|
2611 | 2611 | } |
2612 | 2612 | return $activitytime; |
2613 | 2613 | } |
@@ -2992,7 +2992,7 @@ discard block |
||
2992 | 2992 | array_keys($owner), |
2993 | 2993 | array_merge($owner, $roles) |
2994 | 2994 | ) |
2995 | - ); |
|
2995 | + ); |
|
2996 | 2996 | } |
2997 | 2997 | } |
2998 | 2998 | |
@@ -3032,7 +3032,7 @@ discard block |
||
3032 | 3032 | // Web Client default. |
3033 | 3033 | $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default')); |
3034 | 3034 | $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
3035 | - BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
3035 | + BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
3036 | 3036 | $renderer->render_group_element( |
3037 | 3037 | 'clienttype_default', |
3038 | 3038 | $renderer->render_group_element_configselect( |
@@ -3519,8 +3519,8 @@ discard block |
||
3519 | 3519 | array( |
3520 | 3520 | 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'), |
3521 | 3521 | 'context' => $bbbsession['bigbluebuttonbnURL'] |
3522 | - ) |
|
3523 | - ); |
|
3522 | + ) |
|
3523 | + ); |
|
3524 | 3524 | } |
3525 | 3525 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) { |
3526 | 3526 | $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL']; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | global $CFG; |
33 | 33 | |
34 | -require_once(__DIR__.'/lib.php'); |
|
34 | +require_once(__DIR__ . '/lib.php'); |
|
35 | 35 | |
36 | 36 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ |
37 | 37 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | $data = null; |
146 | 146 | if (!is_null($pname) && !is_null($purl)) { |
147 | 147 | $method = 'POST'; |
148 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
149 | - $purl."' /></module></modules>"; |
|
148 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
149 | + $purl . "' /></module></modules>"; |
|
150 | 150 | } |
151 | 151 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
152 | 152 | if ($xml) { |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | foreach ($recordingxml->breakoutRooms->breakoutRoom as $breakoutroom) { |
274 | 274 | $url = \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url( |
275 | 275 | 'getRecordings', |
276 | - ['recordID' => implode(',', (array) $breakoutroom)] |
|
276 | + ['recordID' => implode(',', (array)$breakoutroom)] |
|
277 | 277 | ); |
278 | 278 | $xml = bigbluebuttonbn_wrap_xml_load_file($url); |
279 | 279 | if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | // Override imported flag with actual ID. |
332 | 332 | $recording['imported'] = $recordimported->id; |
333 | 333 | if (isset($recordimported->protected)) { |
334 | - $recording['protected'] = (string) $recordimported->protected; |
|
334 | + $recording['protected'] = (string)$recordimported->protected; |
|
335 | 335 | } |
336 | 336 | $recordsimportedarray[$recording['recordID']] = $recording; |
337 | 337 | } |
@@ -363,21 +363,21 @@ discard block |
||
363 | 363 | // Add formats. |
364 | 364 | $playbackarray = array(); |
365 | 365 | foreach ($recording->playback->format as $format) { |
366 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
367 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
366 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
367 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
368 | 368 | // Add preview per format when existing. |
369 | 369 | if ($format->preview) { |
370 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
370 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | // Add the metadata to the recordings array. |
374 | 374 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
375 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
376 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
377 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
378 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
375 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
376 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
377 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
378 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
379 | 379 | if (isset($recording->protected)) { |
380 | - $recordingarray['protected'] = (string) $recording->protected; |
|
380 | + $recordingarray['protected'] = (string)$recording->protected; |
|
381 | 381 | } |
382 | 382 | return $recordingarray + $metadataarray; |
383 | 383 | } |
@@ -393,9 +393,9 @@ discard block |
||
393 | 393 | { |
394 | 394 | $imagesarray = array(); |
395 | 395 | foreach ($preview->images->image as $image) { |
396 | - $imagearray = array('url' => trim((string) $image)); |
|
396 | + $imagearray = array('url' => trim((string)$image)); |
|
397 | 397 | foreach ($image->attributes() as $attkey => $attvalue) { |
398 | - $imagearray[$attkey] = (string) $attvalue; |
|
398 | + $imagearray[$attkey] = (string)$attvalue; |
|
399 | 399 | } |
400 | 400 | array_push($imagesarray, $imagearray); |
401 | 401 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | if (is_object($value)) { |
417 | 417 | $value = ''; |
418 | 418 | } |
419 | - $metadataarray['meta_'.$key] = $value; |
|
419 | + $metadataarray['meta_' . $key] = $value; |
|
420 | 420 | } |
421 | 421 | return $metadataarray; |
422 | 422 | } |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | $ids = explode(',', $recordids); |
496 | 496 | foreach ($ids as $id) { |
497 | 497 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
498 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
498 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
499 | 499 | ); |
500 | 500 | if ($xml && $xml->returncode != 'SUCCESS') { |
501 | 501 | return false; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | return $xml; |
564 | 564 | } catch (Exception $e) { |
565 | 565 | libxml_use_internal_errors($previous); |
566 | - $error = 'Caught exception: '.$e->getMessage(); |
|
566 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
567 | 567 | debugging($error, DEBUG_DEVELOPER); |
568 | 568 | return null; |
569 | 569 | } |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
575 | 575 | return $response; |
576 | 576 | } catch (Exception $e) { |
577 | - $error = 'Caught exception: '.$e->getMessage(); |
|
577 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
578 | 578 | debugging($error, DEBUG_DEVELOPER); |
579 | 579 | libxml_use_internal_errors($previous); |
580 | 580 | return null; |
@@ -601,8 +601,8 @@ discard block |
||
601 | 601 | } |
602 | 602 | $options = array(); |
603 | 603 | $options['CURLOPT_HTTPHEADER'] = array( |
604 | - 'Content-Type: '.$contenttype, |
|
605 | - 'Content-Length: '.strlen($data), |
|
604 | + 'Content-Type: ' . $contenttype, |
|
605 | + 'Content-Length: ' . strlen($data), |
|
606 | 606 | 'Content-Language: en-US', |
607 | 607 | ); |
608 | 608 | |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | */ |
625 | 625 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) |
626 | 626 | { |
627 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
627 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
628 | 628 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
629 | 629 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
630 | 630 | } |
@@ -645,9 +645,9 @@ discard block |
||
645 | 645 | if ($userroles) { |
646 | 646 | $where = ''; |
647 | 647 | foreach ($userroles as $userrole) { |
648 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
648 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
649 | 649 | } |
650 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
650 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
651 | 651 | } |
652 | 652 | return $userroles; |
653 | 653 | } |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | */ |
673 | 673 | function bigbluebuttonbn_get_users(context $context = null) |
674 | 674 | { |
675 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
675 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
676 | 676 | foreach ($users as $key => $value) { |
677 | 677 | $users[$key] = fullname($value); |
678 | 678 | } |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | */ |
689 | 689 | function bigbluebuttonbn_get_users_select(context $context = null) |
690 | 690 | { |
691 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
691 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
692 | 692 | foreach ($users as $key => $value) { |
693 | 693 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
694 | 694 | } |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | */ |
705 | 705 | function bigbluebuttonbn_get_roles(context $context = null) |
706 | 706 | { |
707 | - $roles = (array) role_get_names($context); |
|
707 | + $roles = (array)role_get_names($context); |
|
708 | 708 | foreach ($roles as $key => $value) { |
709 | 709 | $roles[$key] = $value->localname; |
710 | 710 | } |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | */ |
721 | 721 | function bigbluebuttonbn_get_roles_select(context $context = null) |
722 | 722 | { |
723 | - $roles = (array) role_get_names($context); |
|
723 | + $roles = (array)role_get_names($context); |
|
724 | 724 | foreach ($roles as $key => $value) { |
725 | 725 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
726 | 726 | } |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | */ |
737 | 737 | function bigbluebuttonbn_get_role($id) |
738 | 738 | { |
739 | - $roles = (array) role_get_names(); |
|
739 | + $roles = (array)role_get_names(); |
|
740 | 740 | if (is_numeric($id) && isset($roles[$id])) { |
741 | 741 | return (object)$roles[$id]; |
742 | 742 | } |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | { |
1131 | 1131 | $mt = microtime(); |
1132 | 1132 | $rand = mt_rand(); |
1133 | - return md5($mt.$rand); |
|
1133 | + return md5($mt . $rand); |
|
1134 | 1134 | } |
1135 | 1135 | |
1136 | 1136 | /** |
@@ -1226,10 +1226,10 @@ discard block |
||
1226 | 1226 | $now = time(); |
1227 | 1227 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1228 | 1228 | // Use the value in the cache. |
1229 | - return (array) json_decode($result['meeting_info']); |
|
1229 | + return (array)json_decode($result['meeting_info']); |
|
1230 | 1230 | } |
1231 | 1231 | // Ping again and refresh the cache. |
1232 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1232 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1233 | 1233 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1234 | 1234 | ); |
1235 | 1235 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1346,7 +1346,7 @@ discard block |
||
1346 | 1346 | */ |
1347 | 1347 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) |
1348 | 1348 | { |
1349 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1349 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1350 | 1350 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1351 | 1351 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
1352 | 1352 | $urldefaultconfig, |
@@ -1367,8 +1367,8 @@ discard block |
||
1367 | 1367 | */ |
1368 | 1368 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) |
1369 | 1369 | { |
1370 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1371 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1370 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1371 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1372 | 1372 | return $configxmlparams; |
1373 | 1373 | } |
1374 | 1374 | |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) |
1384 | 1384 | { |
1385 | 1385 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1386 | - $configxmlarray = (array) $configxml; |
|
1386 | + $configxmlarray = (array)$configxml; |
|
1387 | 1387 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1388 | 1388 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1389 | 1389 | return ''; |
@@ -1482,7 +1482,7 @@ discard block |
||
1482 | 1482 | global $USER; |
1483 | 1483 | $starttime = $starttime - ($starttime % 1000); |
1484 | 1484 | // Set formatted date. |
1485 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1485 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1486 | 1486 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1487 | 1487 | } |
1488 | 1488 | |
@@ -1604,7 +1604,7 @@ discard block |
||
1604 | 1604 | */ |
1605 | 1605 | function bigbluebuttonbn_get_recording_data_row_preview($recording) |
1606 | 1606 | { |
1607 | - $options = array('id' => 'preview-'.$recording['recordID']); |
|
1607 | + $options = array('id' => 'preview-' . $recording['recordID']); |
|
1608 | 1608 | if ($recording['published'] === 'false') { |
1609 | 1609 | $options['hidden'] = 'hidden'; |
1610 | 1610 | } |
@@ -1672,7 +1672,7 @@ discard block |
||
1672 | 1672 | if ($recording['published'] === 'false') { |
1673 | 1673 | $visibility = 'hidden '; |
1674 | 1674 | } |
1675 | - $id = 'playbacks-'.$recording['recordID']; |
|
1675 | + $id = 'playbacks-' . $recording['recordID']; |
|
1676 | 1676 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1677 | 1677 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1678 | 1678 | 'title' => $title, $visibility => $visibility)); |
@@ -1697,11 +1697,11 @@ discard block |
||
1697 | 1697 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
1698 | 1698 | return ''; |
1699 | 1699 | } |
1700 | - $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1700 | + $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1701 | 1701 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1702 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1702 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1703 | 1703 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1704 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1704 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1705 | 1705 | } |
1706 | 1706 | $linkattributes = array( |
1707 | 1707 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], |
@@ -1887,7 +1887,7 @@ discard block |
||
1887 | 1887 | unset($linkattributes['onclick']); |
1888 | 1888 | } |
1889 | 1889 | $icon = new pix_icon( |
1890 | - 'i/'.$data['tag'], |
|
1890 | + 'i/' . $data['tag'], |
|
1891 | 1891 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1892 | 1892 | 'moodle', |
1893 | 1893 | $iconattributes |
@@ -2051,7 +2051,7 @@ discard block |
||
2051 | 2051 | */ |
2052 | 2052 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
2053 | 2053 | $row = new html_table_row(); |
2054 | - $row->id = 'recording-tr-'.$recording['recordID']; |
|
2054 | + $row->id = 'recording-tr-' . $recording['recordID']; |
|
2055 | 2055 | $row->attributes['data-imported'] = 'false'; |
2056 | 2056 | $texthead = ''; |
2057 | 2057 | $texttail = ''; |
@@ -2421,7 +2421,7 @@ discard block |
||
2421 | 2421 | } |
2422 | 2422 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2423 | 2423 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2424 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2424 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2425 | 2425 | // Include only Create events and exclude those with record not true. |
2426 | 2426 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2427 | 2427 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2605,8 +2605,8 @@ discard block |
||
2605 | 2605 | function bigbluebuttonbn_format_activity_time($time) { |
2606 | 2606 | $activitytime = ''; |
2607 | 2607 | if ($time) { |
2608 | - $activitytime = calendar_day_representation($time).' '. |
|
2609 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2608 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2609 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2610 | 2610 | calendar_time_representation($time); |
2611 | 2611 | } |
2612 | 2612 | return $activitytime; |
@@ -3148,7 +3148,7 @@ discard block |
||
3148 | 3148 | * |
3149 | 3149 | * @return string |
3150 | 3150 | */ |
3151 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
3151 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
3152 | 3152 | global $OUTPUT; |
3153 | 3153 | $output = "\n"; |
3154 | 3154 | // Evaluates if config_warning is enabled. |
@@ -3189,11 +3189,11 @@ discard block |
||
3189 | 3189 | if ($class == '') { |
3190 | 3190 | $class = 'btn btn-secondary'; |
3191 | 3191 | } |
3192 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
3193 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
3194 | - $output .= ' title="' . $title . '"'."\n"; |
|
3195 | - $output .= ' >' . $text . '</button>'."\n"; |
|
3196 | - $output .= ' </form>'."\n"; |
|
3192 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
3193 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
3194 | + $output .= ' title="' . $title . '"' . "\n"; |
|
3195 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
3196 | + $output .= ' </form>' . "\n"; |
|
3197 | 3197 | return $output; |
3198 | 3198 | } |
3199 | 3199 | |
@@ -3358,7 +3358,7 @@ discard block |
||
3358 | 3358 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass; |
3359 | 3359 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; |
3360 | 3360 | // Database info related to the activity. |
3361 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
3361 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
3362 | 3362 | $bbbsession['bigbluebuttonbn']->id; |
3363 | 3363 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
3364 | 3364 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; |
@@ -3390,12 +3390,12 @@ discard block |
||
3390 | 3390 | if ($bbbsession['bigbluebuttonbn']->record) { |
3391 | 3391 | // Check if is enable record all from start. |
3392 | 3392 | if ($bbbsession['recordallfromstart']) { |
3393 | - $bbbsession['welcome'] .= '<br><br>'.get_string( |
|
3393 | + $bbbsession['welcome'] .= '<br><br>' . get_string( |
|
3394 | 3394 | 'bbbrecordallfromstartwarning', |
3395 | 3395 | 'bigbluebuttonbn' |
3396 | 3396 | ); |
3397 | 3397 | } else { |
3398 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
3398 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
3399 | 3399 | } |
3400 | 3400 | } |
3401 | 3401 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; |
@@ -3410,7 +3410,7 @@ discard block |
||
3410 | 3410 | $bbbsession['originServerName'] = $parsedurl['host']; |
3411 | 3411 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
3412 | 3412 | $bbbsession['originServerCommonName'] = ''; |
3413 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
3413 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
3414 | 3414 | $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server(); |
3415 | 3415 | // Setting for clienttype, assign flash if not enabled, or default if not editable. |
3416 | 3416 | $bbbsession['clienttype'] = BIGBLUEBUTTON_CLIENTTYPE_FLASH; |
@@ -3473,7 +3473,7 @@ discard block |
||
3473 | 3473 | ); |
3474 | 3474 | |
3475 | 3475 | // Check status and set extra values. |
3476 | - $activitystatus = bigbluebuttonbn_view_get_activity_status($bbbsession); // In locallib. |
|
3476 | + $activitystatus = bigbluebuttonbn_view_get_activity_status($bbbsession); // In locallib. |
|
3477 | 3477 | if ($activitystatus == 'ended') { |
3478 | 3478 | $bbbsession['presentation'] = bigbluebuttonbn_get_presentation_array( |
3479 | 3479 | $bbbsession['context'], |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * Remove this block when restored |
65 | 65 | */ |
66 | 66 | |
67 | - /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
67 | + /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
68 | 68 | const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/'; |
69 | 69 | /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */ |
70 | 70 | const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6'; |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $sql = "SELECT COUNT(*) FROM {bigbluebuttonbn_logs} "; |
376 | 376 | $sql .= "WHERE courseid = ? AND bigbluebuttonbnid = ? AND userid = ? AND (log = ? OR log = ?)"; |
377 | 377 | $result = $DB->count_records_sql($sql, array($course->id, $bigbluebuttonbn->id, $user->id, |
378 | - BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED)); |
|
378 | + BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED)); |
|
379 | 379 | return $result; |
380 | 380 | } |
381 | 381 | |
@@ -620,12 +620,12 @@ discard block |
||
620 | 620 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
621 | 621 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
622 | 622 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
623 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
623 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
624 | 624 | $str .= ' </div>'."\n"; |
625 | 625 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
626 | 626 | '</div>'."\n"; |
627 | 627 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
628 | - .'</div>'."\n"; |
|
628 | + .'</div>'."\n"; |
|
629 | 629 | $str .= '</div>'."\n"; |
630 | 630 | return $str; |
631 | 631 | } |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | 'bigbluebuttonbn', |
878 | 878 | $bigbluebuttonbn->id, |
879 | 879 | $bigbluebuttonbn->completionexpected |
880 | - ); |
|
880 | + ); |
|
881 | 881 | } |
882 | 882 | } |
883 | 883 |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
209 | 209 | $callbackresponse['status'] = true; |
210 | 210 | $callbackresponse['found'] = true; |
211 | - $callbackresponse['published'] = (string) $recording['published']; |
|
211 | + $callbackresponse['published'] = (string)$recording['published']; |
|
212 | 212 | if (!isset($params['meta']) || empty($params['meta'])) { |
213 | 213 | return $callbackresponse; |
214 | 214 | } |
@@ -559,8 +559,8 @@ discard block |
||
559 | 559 | array('HS256') |
560 | 560 | ); |
561 | 561 | } catch (Exception $e) { |
562 | - $error = 'Caught exception: '.$e->getMessage(); |
|
563 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
562 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
563 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
564 | 564 | return; |
565 | 565 | } |
566 | 566 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -590,8 +590,8 @@ discard block |
||
590 | 590 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, json_encode($meta)); |
591 | 591 | header('HTTP/1.0 202 Accepted'); |
592 | 592 | } catch (Exception $e) { |
593 | - $error = 'Caught exception: '.$e->getMessage(); |
|
594 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
593 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
594 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
595 | 595 | } |
596 | 596 | } |
597 | 597 | |
@@ -612,13 +612,13 @@ discard block |
||
612 | 612 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
613 | 613 | if (!isset($importrecordings[$params['id']])) { |
614 | 614 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
615 | - header('HTTP/1.0 404 Not found. '.$error); |
|
615 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
616 | 616 | return; |
617 | 617 | } |
618 | 618 | $callbackresponse = array('status' => true); |
619 | 619 | $importrecordings[$params['id']]['imported'] = true; |
620 | 620 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
621 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
621 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
622 | 622 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
623 | 623 | // Moodle event logger: Create an event for recording imported. |
624 | 624 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | $action = strtolower($params['action']); |
713 | 713 | $requiredparams = bigbluebuttonbn_broker_required_parameters(); |
714 | 714 | if (!array_key_exists($action, $requiredparams)) { |
715 | - return 'Action '.$params['action'].' can not be performed.'; |
|
715 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
716 | 716 | } |
717 | 717 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
718 | 718 | } |
@@ -111,7 +111,7 @@ |
||
111 | 111 | * |
112 | 112 | * @param object $bigbluebuttonbn |
113 | 113 | * |
114 | - * @return void |
|
114 | + * @return string |
|
115 | 115 | */ |
116 | 116 | public static function htmlmsg_recording_ready($bigbluebuttonbn) { |
117 | 117 | return '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
@@ -44,29 +44,29 @@ discard block |
||
44 | 44 | * @return string |
45 | 45 | */ |
46 | 46 | public static function htmlmsg_instance_updated($msg) { |
47 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
|
48 | - get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
49 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '. |
|
50 | - get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
51 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
52 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
53 | - get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
54 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n"; |
|
55 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
56 | - get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
57 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n"; |
|
58 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
59 | - get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
60 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
61 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
62 | - get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
63 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
64 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '. |
|
65 | - get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
66 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
67 | - $messagetext .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. |
|
68 | - $msg->user_name.'('.$msg->user_email.') '; |
|
69 | - $messagetext .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
47 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
48 | + get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
49 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' . |
|
50 | + get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
51 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
52 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
53 | + get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
54 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n"; |
|
55 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
56 | + get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
57 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n"; |
|
58 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
59 | + get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
60 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
61 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
62 | + get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
63 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
64 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . |
|
65 | + get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
66 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
67 | + $messagetext .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . |
|
68 | + $msg->user_name . '(' . $msg->user_email . ') '; |
|
69 | + $messagetext .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
70 | 70 | return $messagetext; |
71 | 71 | } |
72 | 72 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $course = $coursemodinfo->get_course($bigbluebuttonbn->course); |
84 | 84 | $sender = $USER; |
85 | 85 | // Prepare message. |
86 | - $msg = (object) array(); |
|
86 | + $msg = (object)array(); |
|
87 | 87 | // Build the message_body. |
88 | 88 | $msg->action = $action; |
89 | 89 | $msg->activity_type = ''; |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | * @return void |
115 | 115 | */ |
116 | 116 | public static function htmlmsg_recording_ready($bigbluebuttonbn) { |
117 | - return '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
118 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
119 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
117 | + return '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
118 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
119 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |