@@ -55,6 +55,9 @@ discard block |
||
| 55 | 55 | const BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED = 'recording_unpublished'; |
| 56 | 56 | const BIGBLUEBUTTON_EVENT_RECORDING_EDITED = 'recording_edited'; |
| 57 | 57 | |
| 58 | +/** |
|
| 59 | + * @param string $meta |
|
| 60 | + */ |
|
| 58 | 61 | function bigbluebuttonbn_logs(array $bbbsession, $event, array $overrides = [], $meta = null) { |
| 59 | 62 | global $DB; |
| 60 | 63 | |
@@ -571,6 +574,12 @@ discard block |
||
| 571 | 574 | } |
| 572 | 575 | } |
| 573 | 576 | |
| 577 | +/** |
|
| 578 | + * @param string $url |
|
| 579 | + * @param string $data |
|
| 580 | + * |
|
| 581 | + * @return string |
|
| 582 | + */ |
|
| 574 | 583 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = BIGBLUEBUTTONBN_METHOD_GET, |
| 575 | 584 | $data = null, $contenttype = 'text/xml') { |
| 576 | 585 | $c = new curl(); |
@@ -1977,6 +1986,9 @@ discard block |
||
| 1977 | 1986 | return html_writer::div(html_writer::table($table), '', array('id' => 'bigbluebuttonbn_html_table')); |
| 1978 | 1987 | } |
| 1979 | 1988 | |
| 1989 | +/** |
|
| 1990 | + * @param integer $len |
|
| 1991 | + */ |
|
| 1980 | 1992 | function bigbluebuttonbn_html2text($html, $len) { |
| 1981 | 1993 | $text = strip_tags($html); |
| 1982 | 1994 | $text = str_replace(' ', ' ', $text); |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | // BigBlueButton API Calls. |
| 85 | 85 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
| 86 | 86 | $data = ['meetingID' => $meetingid, |
| 87 | - 'fullName' => $username, |
|
| 88 | - 'password' => $pw, |
|
| 89 | - 'logoutURL' => $logouturl, |
|
| 87 | + 'fullName' => $username, |
|
| 88 | + 'password' => $pw, |
|
| 89 | + 'logoutURL' => $logouturl, |
|
| 90 | 90 | ]; |
| 91 | 91 | |
| 92 | 92 | if (!is_null($configtoken)) { |
@@ -201,24 +201,24 @@ discard block |
||
| 201 | 201 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
| 202 | 202 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 203 | 203 | bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 204 | - ); |
|
| 204 | + ); |
|
| 205 | 205 | |
| 206 | 206 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
| 207 | 207 | // Meeting info was returned. |
| 208 | 208 | return array('returncode' => $xml->returncode, |
| 209 | - 'meetingID' => $xml->meetingID, |
|
| 210 | - 'moderatorPW' => $xml->moderatorPW, |
|
| 211 | - 'attendeePW' => $xml->attendeePW, |
|
| 212 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
| 213 | - 'running' => $xml->running, |
|
| 214 | - 'recording' => $xml->recording, |
|
| 215 | - 'startTime' => $xml->startTime, |
|
| 216 | - 'endTime' => $xml->endTime, |
|
| 217 | - 'participantCount' => $xml->participantCount, |
|
| 218 | - 'moderatorCount' => $xml->moderatorCount, |
|
| 219 | - 'attendees' => $xml->attendees, |
|
| 220 | - 'metadata' => $xml->metadata, |
|
| 221 | - ); |
|
| 209 | + 'meetingID' => $xml->meetingID, |
|
| 210 | + 'moderatorPW' => $xml->moderatorPW, |
|
| 211 | + 'attendeePW' => $xml->attendeePW, |
|
| 212 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
| 213 | + 'running' => $xml->running, |
|
| 214 | + 'recording' => $xml->recording, |
|
| 215 | + 'startTime' => $xml->startTime, |
|
| 216 | + 'endTime' => $xml->endTime, |
|
| 217 | + 'participantCount' => $xml->participantCount, |
|
| 218 | + 'moderatorCount' => $xml->moderatorCount, |
|
| 219 | + 'attendees' => $xml->attendees, |
|
| 220 | + 'metadata' => $xml->metadata, |
|
| 221 | + ); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | if ($xml) { |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | // Do getRecordings is executed using a method GET (supported by all versions of BBB). |
| 285 | 285 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 286 | 286 | bigbluebuttonbn_bigbluebutton_action_url('getRecordings', ['meetingID' => implode(',', $mids)]) |
| 287 | - ); |
|
| 287 | + ); |
|
| 288 | 288 | if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { |
| 289 | 289 | // If there were meetings already created. |
| 290 | 290 | foreach ($xml->recordings->recording as $recording) { |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | function bigbluebuttonbn_get_default_config_xml() { |
| 356 | 356 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 357 | 357 | bigbluebuttonbn_bigbluebutton_action_url('getDefaultConfigXML') |
| 358 | - ); |
|
| 358 | + ); |
|
| 359 | 359 | |
| 360 | 360 | return $xml; |
| 361 | 361 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | foreach ($ids as $id) { |
| 424 | 424 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 425 | 425 | bigbluebuttonbn_bigbluebutton_action_url('deleteRecordings', ['recordID' => $id]) |
| 426 | - ); |
|
| 426 | + ); |
|
| 427 | 427 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 428 | 428 | return false; |
| 429 | 429 | } |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | foreach ($ids as $id) { |
| 442 | 442 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 443 | 443 | bigbluebuttonbn_bigbluebutton_action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
| 444 | - ); |
|
| 444 | + ); |
|
| 445 | 445 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 446 | 446 | return false; |
| 447 | 447 | } |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | foreach ($ids as $id) { |
| 460 | 460 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 461 | 461 | bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
| 462 | - ); |
|
| 462 | + ); |
|
| 463 | 463 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 464 | 464 | return false; |
| 465 | 465 | } |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
| 488 | 488 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 489 | 489 | bigbluebuttonbn_bigbluebutton_action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
| 490 | - ); |
|
| 490 | + ); |
|
| 491 | 491 | |
| 492 | 492 | if ($xml) { |
| 493 | 493 | // If the xml packet returned failure it displays the message to the user. |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | function bigbluebuttonbn_is_meeting_running($meetingid) { |
| 505 | 505 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 506 | 506 | bigbluebuttonbn_bigbluebutton_action_url('isMeetingRunning', ['meetingID' => $meetingid]) |
| 507 | - ); |
|
| 507 | + ); |
|
| 508 | 508 | |
| 509 | 509 | if ($xml && $xml->returncode == 'SUCCESS') { |
| 510 | 510 | return ($xml->running == 'true'); |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | function bigbluebuttonbn_get_server_version() { |
| 517 | 517 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 518 | 518 | bigbluebuttonbn_bigbluebutton_action_url() |
| 519 | - ); |
|
| 519 | + ); |
|
| 520 | 520 | |
| 521 | 521 | if ($xml && $xml->returncode == 'SUCCESS') { |
| 522 | 522 | return $xml->version; |
@@ -582,10 +582,10 @@ discard block |
||
| 582 | 582 | |
| 583 | 583 | $options = array(); |
| 584 | 584 | $options['CURLOPT_HTTPHEADER'] = array( |
| 585 | - 'Content-Type: '.$contenttype, |
|
| 586 | - 'Content-Length: '.strlen($data), |
|
| 587 | - 'Content-Language: en-US', |
|
| 588 | - ); |
|
| 585 | + 'Content-Type: '.$contenttype, |
|
| 586 | + 'Content-Length: '.strlen($data), |
|
| 587 | + 'Content-Language: en-US', |
|
| 588 | + ); |
|
| 589 | 589 | |
| 590 | 590 | return $c->post($url, $data, $options); |
| 591 | 591 | } |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
| 645 | 645 | } |
| 646 | 646 | return $roles; |
| 647 | - } |
|
| 647 | + } |
|
| 648 | 648 | |
| 649 | 649 | function bigbluebuttonbn_get_role($id) { |
| 650 | 650 | $roles = (array) role_get_names(); |
@@ -664,18 +664,18 @@ discard block |
||
| 664 | 664 | 'all' => array( |
| 665 | 665 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
| 666 | 666 | 'children' => [] |
| 667 | - ) |
|
| 668 | - ); |
|
| 667 | + ) |
|
| 668 | + ); |
|
| 669 | 669 | |
| 670 | 670 | $data['role'] = array( |
| 671 | 671 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
| 672 | 672 | 'children' => bigbluebuttonbn_get_roles_select($context) |
| 673 | - ); |
|
| 673 | + ); |
|
| 674 | 674 | |
| 675 | 675 | $data['user'] = array( |
| 676 | 676 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
| 677 | 677 | 'children' => bigbluebuttonbn_get_users_select($context) |
| 678 | - ); |
|
| 678 | + ); |
|
| 679 | 679 | |
| 680 | 680 | return $data; |
| 681 | 681 | } |
@@ -722,9 +722,9 @@ discard block |
||
| 722 | 722 | } |
| 723 | 723 | |
| 724 | 724 | $participantlistarray[] = array( |
| 725 | - 'selectiontype' => 'role', |
|
| 726 | - 'selectionid' => $moderatordefault, |
|
| 727 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
| 725 | + 'selectiontype' => 'role', |
|
| 726 | + 'selectionid' => $moderatordefault, |
|
| 727 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | return $participantlistarray; |
@@ -736,11 +736,11 @@ discard block |
||
| 736 | 736 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
| 737 | 737 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
| 738 | 738 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
| 739 | - ], |
|
| 739 | + ], |
|
| 740 | 740 | 'type_selected' => 'all', |
| 741 | 741 | 'options' => ['all' => '---------------'], |
| 742 | 742 | 'selected' => 'all', |
| 743 | - ]; |
|
| 743 | + ]; |
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) { |
@@ -871,8 +871,8 @@ discard block |
||
| 871 | 871 | } |
| 872 | 872 | |
| 873 | 873 | $parray = array('url' => $purl, 'name' => $pname, |
| 874 | - 'icon' => $picon, |
|
| 875 | - 'mimetype_description' => $pmimetypedescrip); |
|
| 874 | + 'icon' => $picon, |
|
| 875 | + 'mimetype_description' => $pmimetypedescrip); |
|
| 876 | 876 | |
| 877 | 877 | return $parray; |
| 878 | 878 | } |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | $eventproperties['other'] = $eventsubtype; |
| 957 | 957 | } |
| 958 | 958 | $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
| 959 | - array($eventproperties)); |
|
| 959 | + array($eventproperties)); |
|
| 960 | 960 | $event->trigger(); |
| 961 | 961 | } |
| 962 | 962 | |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | // Ping again and refresh the cache. |
| 1004 | 1004 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
| 1005 | 1005 | bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 1006 | - ); |
|
| 1006 | + ); |
|
| 1007 | 1007 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
| 1008 | 1008 | |
| 1009 | 1009 | return $meetinginfo; |
@@ -1141,7 +1141,7 @@ discard block |
||
| 1141 | 1141 | $actionbar .= bigbluebuttonbn_actionbar_render_button( |
| 1142 | 1142 | $recording, |
| 1143 | 1143 | bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool) |
| 1144 | - ); |
|
| 1144 | + ); |
|
| 1145 | 1145 | } |
| 1146 | 1146 | |
| 1147 | 1147 | $head = html_writer::start_tag('div', array( |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | |
| 1228 | 1228 | $recordingtypes = html_writer::start_tag('div', |
| 1229 | 1229 | array('id' => 'playbacks-'.$recording['recordID'], 'data-imported' => $dataimported, |
| 1230 | - 'title' => $title, $visibility => $visibility)); |
|
| 1230 | + 'title' => $title, $visibility => $visibility)); |
|
| 1231 | 1231 | foreach ($recording['playbacks'] as $playback) { |
| 1232 | 1232 | $recordingtypes .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'], |
| 1233 | 1233 | 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'], |
@@ -1269,7 +1269,7 @@ discard block |
||
| 1269 | 1269 | $payload['source'] = 'meta_contextactivitydescription'; |
| 1270 | 1270 | $metadescription = trim($recording[$payload['source']]); |
| 1271 | 1271 | if (!empty($metadescription)) { |
| 1272 | - return bigbluebuttonbn_get_recording_data_row_text($recording, $metadescription, $payload); |
|
| 1272 | + return bigbluebuttonbn_get_recording_data_row_text($recording, $metadescription, $payload); |
|
| 1273 | 1273 | } |
| 1274 | 1274 | } |
| 1275 | 1275 | |
@@ -1324,7 +1324,7 @@ discard block |
||
| 1324 | 1324 | 'onclick' => $onclick, |
| 1325 | 1325 | 'data-action' => $data['action'], |
| 1326 | 1326 | 'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID']) |
| 1327 | - ); |
|
| 1327 | + ); |
|
| 1328 | 1328 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
| 1329 | 1329 | } |
| 1330 | 1330 | |
@@ -1925,22 +1925,22 @@ discard block |
||
| 1925 | 1925 | */ |
| 1926 | 1926 | function bigbluebuttonbn_get_cfg_options() { |
| 1927 | 1927 | return [ |
| 1928 | - 'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(), |
|
| 1929 | - 'recording_default' => bigbluebuttonbn_get_cfg_recording_default(), |
|
| 1930 | - 'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(), |
|
| 1931 | - 'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(), |
|
| 1932 | - 'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(), |
|
| 1933 | - 'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(), |
|
| 1934 | - 'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(), |
|
| 1935 | - 'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(), |
|
| 1936 | - 'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(), |
|
| 1937 | - 'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(), |
|
| 1938 | - 'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(), |
|
| 1939 | - 'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(), |
|
| 1940 | - 'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(), |
|
| 1941 | - 'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(), |
|
| 1942 | - 'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(), |
|
| 1943 | - 'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL, |
|
| 1928 | + 'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(), |
|
| 1929 | + 'recording_default' => bigbluebuttonbn_get_cfg_recording_default(), |
|
| 1930 | + 'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(), |
|
| 1931 | + 'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(), |
|
| 1932 | + 'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(), |
|
| 1933 | + 'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(), |
|
| 1934 | + 'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(), |
|
| 1935 | + 'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(), |
|
| 1936 | + 'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(), |
|
| 1937 | + 'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(), |
|
| 1938 | + 'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(), |
|
| 1939 | + 'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(), |
|
| 1940 | + 'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(), |
|
| 1941 | + 'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(), |
|
| 1942 | + 'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(), |
|
| 1943 | + 'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL, |
|
| 1944 | 1944 | ]; |
| 1945 | 1945 | } |
| 1946 | 1946 | |
@@ -2141,8 +2141,8 @@ discard block |
||
| 2141 | 2141 | $activitytime = ''; |
| 2142 | 2142 | if ($time) { |
| 2143 | 2143 | $activitytime = calendar_day_representation($time).' '. |
| 2144 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2145 | - calendar_time_representation($time); |
|
| 2144 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2145 | + calendar_time_representation($time); |
|
| 2146 | 2146 | } |
| 2147 | 2147 | |
| 2148 | 2148 | return $activitytime; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | global $CFG; |
| 29 | 29 | |
| 30 | -require_once(dirname(__FILE__).'/lib.php'); |
|
| 30 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
| 31 | 31 | |
| 32 | 32 | const BIGBLUEBUTTONBN_FORCED = true; |
| 33 | 33 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | if (isset($meta)) { |
| 76 | 76 | $log->meta = $meta; |
| 77 | 77 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
| 78 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
| 78 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
@@ -113,18 +113,18 @@ discard block |
||
| 113 | 113 | * @param array $metadata |
| 114 | 114 | */ |
| 115 | 115 | function bigbluebuttonbn_bigbluebutton_action_url($action = '', $data = array(), $metadata = array()) { |
| 116 | - $baseurl = bigbluebuttonbn_get_cfg_server_url().'api/'.$action.'?'; |
|
| 116 | + $baseurl = bigbluebuttonbn_get_cfg_server_url() . 'api/' . $action . '?'; |
|
| 117 | 117 | $params = ''; |
| 118 | 118 | |
| 119 | 119 | foreach ($data as $key => $value) { |
| 120 | - $params .= '&'.$key.'='.urlencode($value); |
|
| 120 | + $params .= '&' . $key . '=' . urlencode($value); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | foreach ($metadata as $key => $value) { |
| 124 | - $params .= '&'.'meta_'.$key.'='.urlencode($value); |
|
| 124 | + $params .= '&' . 'meta_' . $key . '=' . urlencode($value); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - return $baseurl.$params.'&checksum='.sha1($action.$params.bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 127 | + return $baseurl . $params . '&checksum=' . sha1($action . $params . bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | function bigbluebuttonbn_get_create_meeting_array($data, $metadata = array(), $pname = null, $purl = null) { |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | if (!is_null($pname) && !is_null($purl)) { |
| 136 | 136 | $method = BIGBLUEBUTTONBN_METHOD_POST; |
| 137 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
| 138 | - $purl."' /></module></modules>"; |
|
| 137 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
| 138 | + $purl . "' /></module></modules>"; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | 'moderatorPW' => $meeting->moderatorPW, |
| 181 | 181 | 'attendeePW' => $meeting->attendeePW, |
| 182 | 182 | 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, |
| 183 | - 'running' => $meeting->running, ); |
|
| 183 | + 'running' => $meeting->running,); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | return $meetings; |
@@ -323,12 +323,12 @@ discard block |
||
| 323 | 323 | function bigbluebuttonbn_get_recordings_imported_array($courseid, $bigbluebuttonbnid = null, $subset = true) { |
| 324 | 324 | global $DB; |
| 325 | 325 | |
| 326 | - $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
| 327 | - BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
| 326 | + $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
| 327 | + BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
| 328 | 328 | if ($bigbluebuttonbnid === null) { |
| 329 | - $select = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
| 329 | + $select = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
| 330 | 330 | } else if ($subset) { |
| 331 | - $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
| 331 | + $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
| 332 | 332 | } |
| 333 | 333 | $recordsimported = $DB->get_records_select('bigbluebuttonbn_logs', $select); |
| 334 | 334 | |
@@ -363,35 +363,35 @@ discard block |
||
| 363 | 363 | function bigbluebuttonbn_get_default_config_xml_array() { |
| 364 | 364 | $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML(); |
| 365 | 365 | |
| 366 | - return (array) $defaultconfigxml; |
|
| 366 | + return (array)$defaultconfigxml; |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | function bigbluebuttonbn_get_recording_array_value($recording) { |
| 370 | 370 | // Add formats. |
| 371 | 371 | $playbackarray = array(); |
| 372 | 372 | foreach ($recording->playback->format as $format) { |
| 373 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
| 374 | - 'url' => (string) $format->url, 'length' => (string) $format->length); |
|
| 373 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
| 374 | + 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
| 375 | 375 | // Add preview per format when existing. |
| 376 | 376 | if ($format->preview) { |
| 377 | 377 | $imagesarray = array(); |
| 378 | 378 | foreach ($format->preview->images->image as $image) { |
| 379 | - $imagearray = array('url' => (string) $image); |
|
| 379 | + $imagearray = array('url' => (string)$image); |
|
| 380 | 380 | foreach ($image->attributes() as $attkey => $attvalue) { |
| 381 | - $imagearray[$attkey] = (string) $attvalue; |
|
| 381 | + $imagearray[$attkey] = (string)$attvalue; |
|
| 382 | 382 | } |
| 383 | 383 | array_push($imagesarray, $imagearray); |
| 384 | 384 | } |
| 385 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
| 385 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | // Add the metadata to the recordings array. |
| 390 | 390 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
| 391 | - return array('recordID' => (string) $recording->recordID, |
|
| 392 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
| 393 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
| 394 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray) + $metadataarray; |
|
| 391 | + return array('recordID' => (string)$recording->recordID, |
|
| 392 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
| 393 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
| 394 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray) + $metadataarray; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | function bigbluebuttonbn_get_recording_array_meta($metadata) { |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | if (is_object($value)) { |
| 401 | 401 | $value = ''; |
| 402 | 402 | } |
| 403 | - $metadataarray['meta_'.$key] = $value; |
|
| 403 | + $metadataarray['meta_' . $key] = $value; |
|
| 404 | 404 | } |
| 405 | 405 | return $metadataarray; |
| 406 | 406 | } |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | $ids = explode(',', $recordids); |
| 459 | 459 | foreach ($ids as $id) { |
| 460 | 460 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
| 461 | - bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
| 461 | + bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
| 462 | 462 | ); |
| 463 | 463 | if ($xml && $xml->returncode != 'SUCCESS') { |
| 464 | 464 | return false; |
@@ -582,8 +582,8 @@ discard block |
||
| 582 | 582 | |
| 583 | 583 | $options = array(); |
| 584 | 584 | $options['CURLOPT_HTTPHEADER'] = array( |
| 585 | - 'Content-Type: '.$contenttype, |
|
| 586 | - 'Content-Length: '.strlen($data), |
|
| 585 | + 'Content-Type: ' . $contenttype, |
|
| 586 | + 'Content-Length: ' . strlen($data), |
|
| 587 | 587 | 'Content-Language: en-US', |
| 588 | 588 | ); |
| 589 | 589 | |
@@ -600,9 +600,9 @@ discard block |
||
| 600 | 600 | if ($userroles) { |
| 601 | 601 | $where = ''; |
| 602 | 602 | foreach ($userroles as $value) { |
| 603 | - $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid; |
|
| 603 | + $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid; |
|
| 604 | 604 | } |
| 605 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
| 605 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | return $userroles; |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | function bigbluebuttonbn_get_users(context $context = null) { |
| 618 | - $users = (array) get_enrolled_users($context); |
|
| 618 | + $users = (array)get_enrolled_users($context); |
|
| 619 | 619 | foreach ($users as $key => $value) { |
| 620 | 620 | $users[$key] = fullname($value); |
| 621 | 621 | } |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | function bigbluebuttonbn_get_users_select(context $context = null) { |
| 626 | - $users = (array) get_enrolled_users($context); |
|
| 626 | + $users = (array)get_enrolled_users($context); |
|
| 627 | 627 | foreach ($users as $key => $value) { |
| 628 | 628 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
| 629 | 629 | } |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | function bigbluebuttonbn_get_roles(context $context = null) { |
| 634 | - $roles = (array) role_get_names($context); |
|
| 634 | + $roles = (array)role_get_names($context); |
|
| 635 | 635 | foreach ($roles as $key => $value) { |
| 636 | 636 | $roles[$key] = $value->localname; |
| 637 | 637 | } |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
| 642 | - $roles = (array) role_get_names($context); |
|
| 642 | + $roles = (array)role_get_names($context); |
|
| 643 | 643 | foreach ($roles as $key => $value) { |
| 644 | 644 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
| 645 | 645 | } |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | function bigbluebuttonbn_get_role($id) { |
| 650 | - $roles = (array) role_get_names(); |
|
| 650 | + $roles = (array)role_get_names(); |
|
| 651 | 651 | if (is_numeric($id)) { |
| 652 | 652 | return $roles[$id]; |
| 653 | 653 | } |
@@ -811,9 +811,9 @@ discard block |
||
| 811 | 811 | $isunique = true; |
| 812 | 812 | if ($voicebridge != 0) { |
| 813 | 813 | $table = 'bigbluebuttonbn'; |
| 814 | - $select = 'voicebridge = '.$voicebridge; |
|
| 814 | + $select = 'voicebridge = ' . $voicebridge; |
|
| 815 | 815 | if ($id) { |
| 816 | - $select .= ' AND id <> '.$id; |
|
| 816 | + $select .= ' AND id <> ' . $id; |
|
| 817 | 817 | } |
| 818 | 818 | if ($DB->get_records_select($table, $select)) { |
| 819 | 819 | $isunique = false; |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | $mt = microtime(); |
| 882 | 882 | $rand = mt_rand(); |
| 883 | 883 | |
| 884 | - return md5($mt.$rand); |
|
| 884 | + return md5($mt . $rand); |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | function bigbluebuttonbn_random_password($length = 8) { |
@@ -901,39 +901,39 @@ discard block |
||
| 901 | 901 | |
| 902 | 902 | function bigbluebuttonbn_events() { |
| 903 | 903 | return array( |
| 904 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 905 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 906 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 907 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 908 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 909 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 910 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 911 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 912 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 913 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 914 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 915 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 916 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 917 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED |
|
| 904 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 905 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 906 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 907 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 908 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 909 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 910 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 911 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 912 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 913 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 914 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 915 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 916 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 917 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED |
|
| 918 | 918 | ); |
| 919 | 919 | } |
| 920 | 920 | |
| 921 | 921 | function bigbluebuttonbn_events_action() { |
| 922 | 922 | return array( |
| 923 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 924 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 925 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 926 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 927 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 928 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 929 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 930 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 931 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 932 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 933 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 934 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 935 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 936 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED |
|
| 923 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
| 924 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
| 925 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
| 926 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
| 927 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
| 928 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
| 929 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
| 930 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
| 931 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
| 932 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
| 933 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
| 934 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
| 935 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
| 936 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED |
|
| 937 | 937 | ); |
| 938 | 938 | } |
| 939 | 939 | |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | $eventproperties['timecreated'] = $timecreated; |
| 956 | 956 | $eventproperties['other'] = $eventsubtype; |
| 957 | 957 | } |
| 958 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
| 958 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
| 959 | 959 | array($eventproperties)); |
| 960 | 960 | $event->trigger(); |
| 961 | 961 | } |
@@ -997,11 +997,11 @@ discard block |
||
| 997 | 997 | $now = time(); |
| 998 | 998 | if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
| 999 | 999 | // Use the value in the cache. |
| 1000 | - return (array) json_decode($result['meeting_info']); |
|
| 1000 | + return (array)json_decode($result['meeting_info']); |
|
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | // Ping again and refresh the cache. |
| 1004 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
| 1004 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
| 1005 | 1005 | bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
| 1006 | 1006 | ); |
| 1007 | 1007 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1055,8 +1055,8 @@ discard block |
||
| 1055 | 1055 | * @param string $configxml |
| 1056 | 1056 | */ |
| 1057 | 1057 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
| 1058 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
| 1059 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 1058 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
| 1059 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 1060 | 1060 | |
| 1061 | 1061 | return $configxmlparams; |
| 1062 | 1062 | } |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | * @param string $configxml |
| 1067 | 1067 | */ |
| 1068 | 1068 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
| 1069 | - $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url().'api/setConfigXML?'; |
|
| 1069 | + $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url() . 'api/setConfigXML?'; |
|
| 1070 | 1070 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
| 1071 | 1071 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
| 1072 | 1072 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | */ |
| 1081 | 1081 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
| 1082 | 1082 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
| 1083 | - $configxmlarray = (array) $configxml; |
|
| 1083 | + $configxmlarray = (array)$configxml; |
|
| 1084 | 1084 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
| 1085 | 1085 | //debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
| 1086 | 1086 | return ''; |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | $starttime = $starttime - ($starttime % 1000); |
| 1118 | 1118 | |
| 1119 | 1119 | // Set formatted date. |
| 1120 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
| 1120 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
| 1121 | 1121 | $row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
| 1122 | 1122 | |
| 1123 | 1123 | // Set formatted duration. |
@@ -1192,7 +1192,7 @@ discard block |
||
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | 1194 | $recordingpreview = html_writer::start_tag('div', |
| 1195 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
| 1195 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
| 1196 | 1196 | foreach ($recording['playbacks'] as $playback) { |
| 1197 | 1197 | if (isset($playback['preview'])) { |
| 1198 | 1198 | foreach ($playback['preview'] as $image) { |
@@ -1226,12 +1226,12 @@ discard block |
||
| 1226 | 1226 | } |
| 1227 | 1227 | |
| 1228 | 1228 | $recordingtypes = html_writer::start_tag('div', |
| 1229 | - array('id' => 'playbacks-'.$recording['recordID'], 'data-imported' => $dataimported, |
|
| 1229 | + array('id' => 'playbacks-' . $recording['recordID'], 'data-imported' => $dataimported, |
|
| 1230 | 1230 | 'title' => $title, $visibility => $visibility)); |
| 1231 | 1231 | foreach ($recording['playbacks'] as $playback) { |
| 1232 | - $recordingtypes .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'], |
|
| 1233 | - 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'], |
|
| 1234 | - 'bigbluebuttonbn'), 'target' => '_new')).' '; |
|
| 1232 | + $recordingtypes .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_' . $playback['type'], |
|
| 1233 | + 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_' . $playback['type'], |
|
| 1234 | + 'bigbluebuttonbn'), 'target' => '_new')) . ' '; |
|
| 1235 | 1235 | } |
| 1236 | 1236 | $recordingtypes .= html_writer::end_tag('div'); |
| 1237 | 1237 | |
@@ -1312,11 +1312,11 @@ discard block |
||
| 1312 | 1312 | $target .= '-' . $data['target']; |
| 1313 | 1313 | } |
| 1314 | 1314 | $id = 'recording-' . $target . '-' . $recording['recordID']; |
| 1315 | - $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);'; |
|
| 1315 | + $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);'; |
|
| 1316 | 1316 | if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
| 1317 | 1317 | // With icon for $manageaction. |
| 1318 | 1318 | $iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
| 1319 | - $icon = new pix_icon('i/'.$data['tag'], |
|
| 1319 | + $icon = new pix_icon('i/' . $data['tag'], |
|
| 1320 | 1320 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
| 1321 | 1321 | 'moodle', $iconattributes); |
| 1322 | 1322 | $linkattributes = array( |
@@ -1407,7 +1407,7 @@ discard block |
||
| 1407 | 1407 | // There are recordings for this meeting. |
| 1408 | 1408 | foreach ($recordings as $recording) { |
| 1409 | 1409 | $row = new html_table_row(); |
| 1410 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
| 1410 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
| 1411 | 1411 | $row->attributes['data-imported'] = 'false'; |
| 1412 | 1412 | $texthead = ''; |
| 1413 | 1413 | $texttail = ''; |
@@ -1421,9 +1421,9 @@ discard block |
||
| 1421 | 1421 | $rowdata = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
| 1422 | 1422 | if ($rowdata != null) { |
| 1423 | 1423 | $rowdata->date_formatted = str_replace(' ', ' ', $rowdata->date_formatted); |
| 1424 | - $row->cells = array($texthead.$rowdata->recording.$texttail, |
|
| 1425 | - $texthead.$rowdata->activity.$texttail, $texthead.$rowdata->description.$texttail, |
|
| 1426 | - $rowdata->preview, $texthead.$rowdata->date_formatted.$texttail, |
|
| 1424 | + $row->cells = array($texthead . $rowdata->recording . $texttail, |
|
| 1425 | + $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail, |
|
| 1426 | + $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail, |
|
| 1427 | 1427 | $rowdata->duration_formatted); |
| 1428 | 1428 | if ($bbbsession['managerecordings']) { |
| 1429 | 1429 | $row->cells[] = $rowdata->actionbar; |
@@ -1445,9 +1445,9 @@ discard block |
||
| 1445 | 1445 | // Build the message_body. |
| 1446 | 1446 | $msg->activity_type = ''; |
| 1447 | 1447 | $msg->activity_title = $bigbluebuttonbn->name; |
| 1448 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
| 1449 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
| 1450 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
| 1448 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
| 1449 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
| 1450 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
| 1451 | 1451 | |
| 1452 | 1452 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext); |
| 1453 | 1453 | } |
@@ -1473,15 +1473,15 @@ discard block |
||
| 1473 | 1473 | global $CFG; |
| 1474 | 1474 | |
| 1475 | 1475 | if (isset($CFG->bigbluebuttonbn['server_url'])) { |
| 1476 | - return trim(trim($CFG->bigbluebuttonbn['server_url']), '/').'/'; |
|
| 1476 | + return trim(trim($CFG->bigbluebuttonbn['server_url']), '/') . '/'; |
|
| 1477 | 1477 | } |
| 1478 | 1478 | |
| 1479 | 1479 | if (isset($CFG->bigbluebuttonbn_server_url)) { |
| 1480 | - return trim(trim($CFG->bigbluebuttonbn_server_url), '/').'/'; |
|
| 1480 | + return trim(trim($CFG->bigbluebuttonbn_server_url), '/') . '/'; |
|
| 1481 | 1481 | } |
| 1482 | 1482 | |
| 1483 | 1483 | if (isset($CFG->BigBlueButtonBNServerURL)) { |
| 1484 | - return trim(trim($CFG->BigBlueButtonBNServerURL), '/').'/'; |
|
| 1484 | + return trim(trim($CFG->BigBlueButtonBNServerURL), '/') . '/'; |
|
| 1485 | 1485 | } |
| 1486 | 1486 | |
| 1487 | 1487 | return BIGBLUEBUTTONBN_DEFAULT_SERVER_URL; |
@@ -2018,15 +2018,15 @@ discard block |
||
| 2018 | 2018 | |
| 2019 | 2019 | // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'. |
| 2020 | 2020 | $select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'"; |
| 2021 | - $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
| 2022 | - BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
| 2021 | + $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
| 2022 | + BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
| 2023 | 2023 | if ($bigbluebuttonbnid === null) { |
| 2024 | 2024 | $select = "course = '{$courseid}'"; |
| 2025 | - $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
| 2025 | + $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
| 2026 | 2026 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
| 2027 | 2027 | } else if ($subset) { |
| 2028 | 2028 | $select = "id = '{$bigbluebuttonbnid}'"; |
| 2029 | - $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
| 2029 | + $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
| 2030 | 2030 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
| 2031 | 2031 | } |
| 2032 | 2032 | $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid'); |
@@ -2048,7 +2048,7 @@ discard block |
||
| 2048 | 2048 | if (!empty($bigbluebuttonbns)) { |
| 2049 | 2049 | // Prepare select for loading records based on existent bigbluebuttonbns. |
| 2050 | 2050 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
| 2051 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
| 2051 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
| 2052 | 2052 | // Include only Create events and exclude those with record not true. |
| 2053 | 2053 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
| 2054 | 2054 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2140,8 +2140,8 @@ discard block |
||
| 2140 | 2140 | function bigbluebuttonbn_format_activity_time($time) { |
| 2141 | 2141 | $activitytime = ''; |
| 2142 | 2142 | if ($time) { |
| 2143 | - $activitytime = calendar_day_representation($time).' '. |
|
| 2144 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
| 2143 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
| 2144 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
| 2145 | 2145 | calendar_time_representation($time); |
| 2146 | 2146 | } |
| 2147 | 2147 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | $logs = $DB->get_records('bigbluebuttonbn_logs', |
| 210 | 210 | array('bigbluebuttonbnid' => $bigbluebuttonbn->id, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_CREATE, 'meta' => "{\"record\":true}") |
| 211 | - ); |
|
| 211 | + ); |
|
| 212 | 212 | $log->meta = "{\"has_recordings\":false}"; |
| 213 | 213 | if (!empty($logs)) { |
| 214 | 214 | $log->meta = "{\"has_recordings\":true}"; |
@@ -233,9 +233,9 @@ discard block |
||
| 233 | 233 | global $DB; |
| 234 | 234 | |
| 235 | 235 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 236 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
| 237 | - 'userid' => $user->id, |
|
| 238 | - 'log' => 'Join', ), '*'); |
|
| 236 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
| 237 | + 'userid' => $user->id, |
|
| 238 | + 'log' => 'Join', ), '*'); |
|
| 239 | 239 | |
| 240 | 240 | if ($completed > 0) { |
| 241 | 241 | return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | global $DB; |
| 257 | 257 | |
| 258 | 258 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 259 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
| 260 | - 'userid' => $user->id, |
|
| 261 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
| 259 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
| 260 | + 'userid' => $user->id, |
|
| 261 | + 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
| 262 | 262 | |
| 263 | 263 | return $completed > 0; |
| 264 | 264 | } |
@@ -331,12 +331,12 @@ discard block |
||
| 331 | 331 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
| 332 | 332 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
| 333 | 333 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
| 334 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 334 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 335 | 335 | $str .= ' </div>'."\n"; |
| 336 | 336 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
| 337 | 337 | '</div>'."\n"; |
| 338 | 338 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
| 339 | - .'</div>'."\n"; |
|
| 339 | + .'</div>'."\n"; |
|
| 340 | 340 | $str .= '</div>'."\n"; |
| 341 | 341 | |
| 342 | 342 | return $str; |
@@ -27,32 +27,32 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | global $CFG; |
| 29 | 29 | |
| 30 | -require_once($CFG->dirroot.'/calendar/lib.php'); |
|
| 31 | -require_once($CFG->dirroot.'/message/lib.php'); |
|
| 32 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php'); |
|
| 33 | -require_once($CFG->libdir.'/accesslib.php'); |
|
| 34 | -require_once($CFG->libdir.'/completionlib.php'); |
|
| 35 | -require_once($CFG->libdir.'/datalib.php'); |
|
| 36 | -require_once($CFG->libdir.'/coursecatlib.php'); |
|
| 37 | -require_once($CFG->libdir.'/enrollib.php'); |
|
| 38 | -require_once($CFG->libdir.'/filelib.php'); |
|
| 39 | -require_once($CFG->libdir.'/formslib.php'); |
|
| 40 | - |
|
| 41 | -if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
| 42 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 30 | +require_once($CFG->dirroot . '/calendar/lib.php'); |
|
| 31 | +require_once($CFG->dirroot . '/message/lib.php'); |
|
| 32 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php'); |
|
| 33 | +require_once($CFG->libdir . '/accesslib.php'); |
|
| 34 | +require_once($CFG->libdir . '/completionlib.php'); |
|
| 35 | +require_once($CFG->libdir . '/datalib.php'); |
|
| 36 | +require_once($CFG->libdir . '/coursecatlib.php'); |
|
| 37 | +require_once($CFG->libdir . '/enrollib.php'); |
|
| 38 | +require_once($CFG->libdir . '/filelib.php'); |
|
| 39 | +require_once($CFG->libdir . '/formslib.php'); |
|
| 40 | + |
|
| 41 | +if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { |
|
| 42 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (!isset($CFG->bigbluebuttonbn)) { |
| 46 | 46 | $CFG->bigbluebuttonbn = array(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
| 50 | - require_once(dirname(__FILE__).'/config.php'); |
|
| 49 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
| 50 | + require_once(dirname(__FILE__) . '/config.php'); |
|
| 51 | 51 | // Old BigBlueButtonBN cfg schema. For backward compatibility. |
| 52 | 52 | global $BIGBLUEBUTTONBN_CFG; |
| 53 | 53 | |
| 54 | 54 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
| 55 | - foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
| 55 | + foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
| 56 | 56 | $cfgkey = str_replace("bigbluebuttonbn_", "", $key); |
| 57 | 57 | $CFG->bigbluebuttonbn[$cfgkey] = $value; |
| 58 | 58 | } |
@@ -83,19 +83,19 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $features = array( |
| 86 | - (string) FEATURE_IDNUMBER => true, |
|
| 87 | - (string) FEATURE_GROUPS => true, |
|
| 88 | - (string) FEATURE_GROUPINGS => true, |
|
| 89 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
| 90 | - (string) FEATURE_MOD_INTRO => true, |
|
| 91 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
| 92 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 93 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
| 94 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
| 95 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
| 86 | + (string)FEATURE_IDNUMBER => true, |
|
| 87 | + (string)FEATURE_GROUPS => true, |
|
| 88 | + (string)FEATURE_GROUPINGS => true, |
|
| 89 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
| 90 | + (string)FEATURE_MOD_INTRO => true, |
|
| 91 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
| 92 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 93 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
| 94 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
| 95 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
| 96 | 96 | ); |
| 97 | 97 | |
| 98 | - if (isset($features[(string) $feature])) { |
|
| 98 | + if (isset($features[(string)$feature])) { |
|
| 99 | 99 | return $features[$feature]; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | // End the session associated with this instance (if it's running). |
| 178 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
| 178 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
| 179 | 179 | $modpw = $bigbluebuttonbn->moderatorpass; |
| 180 | 180 | |
| 181 | 181 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
@@ -235,11 +235,11 @@ discard block |
||
| 235 | 235 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 236 | 236 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
| 237 | 237 | 'userid' => $user->id, |
| 238 | - 'log' => 'Join', ), '*'); |
|
| 238 | + 'log' => 'Join',), '*'); |
|
| 239 | 239 | |
| 240 | 240 | if ($completed > 0) { |
| 241 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
| 242 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
| 241 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
| 242 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
| 243 | 243 | get_string('view_message_times', 'bigbluebuttonbn'); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 259 | 259 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
| 260 | 260 | 'userid' => $user->id, |
| 261 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
| 261 | + 'log' => 'Join',), '*', IGNORE_MULTIPLE); |
|
| 262 | 262 | |
| 263 | 263 | return $completed > 0; |
| 264 | 264 | } |
@@ -328,16 +328,16 @@ discard block |
||
| 328 | 328 | if ($bigbluebuttonbn->visible) { |
| 329 | 329 | $classes = 'class="dimmed" '; |
| 330 | 330 | } |
| 331 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
| 332 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
| 333 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
| 334 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 335 | - $str .= ' </div>'."\n"; |
|
| 336 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
| 337 | - '</div>'."\n"; |
|
| 338 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
| 339 | - .'</div>'."\n"; |
|
| 340 | - $str .= '</div>'."\n"; |
|
| 331 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
| 332 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
| 333 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
| 334 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
| 335 | + $str .= ' </div>' . "\n"; |
|
| 336 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
| 337 | + '</div>' . "\n"; |
|
| 338 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
| 339 | + .'</div>' . "\n"; |
|
| 340 | + $str .= '</div>' . "\n"; |
|
| 341 | 341 | |
| 342 | 342 | return $str; |
| 343 | 343 | } |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | /* Now that an id was assigned, generate and set the meetingid property based on |
| 426 | 426 | * [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) */ |
| 427 | 427 | if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
| 428 | - $meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 428 | + $meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 429 | 429 | $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $bigbluebuttonbn->id)); |
| 430 | 430 | |
| 431 | 431 | $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn'); |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | if (count($files) == 1) { |
| 500 | 500 | // Get the first (and only) file. |
| 501 | 501 | $file = reset($files); |
| 502 | - $filesrc = '/'.$file->get_filename(); |
|
| 502 | + $filesrc = '/' . $file->get_filename(); |
|
| 503 | 503 | } |
| 504 | 504 | // Set the presentation column in the bigbluebuttonbn table. |
| 505 | 505 | $DB->set_field('bigbluebuttonbn', 'presentation', $filesrc, array('id' => $bigbluebuttonbnid)); |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | return false; |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
| 541 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
| 542 | 542 | $fs = get_file_storage(); |
| 543 | 543 | if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) { |
| 544 | 544 | return false; |
@@ -640,26 +640,26 @@ discard block |
||
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | function bigbluebuttonbn_notification_msg_html($msg) { |
| 643 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
|
| 644 | - get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
| 645 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '. |
|
| 646 | - get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
| 647 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
| 648 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 649 | - get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 650 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n"; |
|
| 651 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 652 | - get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 653 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n"; |
|
| 654 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 655 | - get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 656 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
| 657 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 658 | - get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 659 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
| 660 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '. |
|
| 661 | - get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 662 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
| 643 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
| 644 | + get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
| 645 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' . |
|
| 646 | + get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
| 647 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
| 648 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 649 | + get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 650 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n"; |
|
| 651 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 652 | + get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 653 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n"; |
|
| 654 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 655 | + get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 656 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
| 657 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 658 | + get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 659 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
| 660 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . |
|
| 661 | + get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 662 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | function bigbluebuttonbn_notification_send($sender, $bigbluebuttonbn, $message = '') { |
@@ -673,9 +673,9 @@ discard block |
||
| 673 | 673 | $msg->user_name = fullname($sender); |
| 674 | 674 | $msg->user_email = $sender->email; |
| 675 | 675 | $msg->course_name = "$course->fullname"; |
| 676 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. |
|
| 677 | - $msg->user_name.'('.$msg->user_email.') '; |
|
| 678 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
| 676 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . |
|
| 677 | + $msg->user_name . '(' . $msg->user_email . ') '; |
|
| 678 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
| 679 | 679 | |
| 680 | 680 | $users = get_enrolled_users($context); |
| 681 | 681 | foreach ($users as $user) { |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | if (empty($messageid)) { |
| 686 | 686 | $msgsend = ' was NOT sent.'; |
| 687 | 687 | } |
| 688 | - debugging('Msg to '.$msg->user_name.$msgsend, DEBUG_DEVELOPER); |
|
| 688 | + debugging('Msg to ' . $msg->user_name . $msgsend, DEBUG_DEVELOPER); |
|
| 689 | 689 | } |
| 690 | 690 | } |
| 691 | 691 | } |
@@ -369,10 +369,10 @@ discard block |
||
| 369 | 369 | if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) { |
| 370 | 370 | // Execute unpublish on imported recording link. |
| 371 | 371 | return array( |
| 372 | - 'status' => bigbluebuttonbn_publish_recording_imported( |
|
| 373 | - $params['id'], $bbbsession['bigbluebuttonbn']->id, false |
|
| 372 | + 'status' => bigbluebuttonbn_publish_recording_imported( |
|
| 373 | + $params['id'], $bbbsession['bigbluebuttonbn']->id, false |
|
| 374 | 374 | ) |
| 375 | - ); |
|
| 375 | + ); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | // As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
@@ -392,8 +392,8 @@ discard block |
||
| 392 | 392 | } |
| 393 | 393 | // Second: Execute the real unpublish. |
| 394 | 394 | return array( |
| 395 | - 'status' => bigbluebuttonbn_publish_recordings($params['id'], 'false') |
|
| 396 | - ); |
|
| 395 | + 'status' => bigbluebuttonbn_publish_recordings($params['id'], 'false') |
|
| 396 | + ); |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | function bigbluebuttonbn_broker_recording_action_edit($bbbsession, $params, $recordings) { |
@@ -401,10 +401,10 @@ discard block |
||
| 401 | 401 | error_log("Updating imported"); |
| 402 | 402 | // Execute update on imported recording link. |
| 403 | 403 | return array( |
| 404 | - 'status' => bigbluebuttonbn_update_recording_imported( |
|
| 405 | - $params['id'], $bbbsession['bigbluebuttonbn']->id, json_decode($params['meta']) |
|
| 404 | + 'status' => bigbluebuttonbn_update_recording_imported( |
|
| 405 | + $params['id'], $bbbsession['bigbluebuttonbn']->id, json_decode($params['meta']) |
|
| 406 | 406 | ) |
| 407 | - ); |
|
| 407 | + ); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | // As the recordingid was not identified as imported recording link, execute update on a real recording. |
@@ -412,8 +412,8 @@ discard block |
||
| 412 | 412 | // Execute update on actual recording. |
| 413 | 413 | error_log("Updating real"); |
| 414 | 414 | return array( |
| 415 | - 'status' => bigbluebuttonbn_update_recordings($params['id'], json_decode($params['meta'])) |
|
| 416 | - ); |
|
| 415 | + 'status' => bigbluebuttonbn_update_recordings($params['id'], json_decode($params['meta'])) |
|
| 416 | + ); |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | function bigbluebuttonbn_broker_recording_action_delete($bbbsession, $params, $recordings) { |
@@ -422,10 +422,10 @@ discard block |
||
| 422 | 422 | if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) { |
| 423 | 423 | // Execute delete on imported recording link. |
| 424 | 424 | return array( |
| 425 | - 'status' => bigbluebuttonbn_delete_recording_imported( |
|
| 426 | - $params['id'], $bbbsession['bigbluebuttonbn']->id |
|
| 425 | + 'status' => bigbluebuttonbn_delete_recording_imported( |
|
| 426 | + $params['id'], $bbbsession['bigbluebuttonbn']->id |
|
| 427 | 427 | ) |
| 428 | - ); |
|
| 428 | + ); |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | // As the recordingid was not identified as imported recording link, execute delete on a real recording. |
@@ -440,8 +440,8 @@ discard block |
||
| 440 | 440 | } |
| 441 | 441 | // Execute the actual delete. |
| 442 | 442 | return array( |
| 443 | - 'status' => bigbluebuttonbn_delete_recordings($params['id']) |
|
| 444 | - ); |
|
| 443 | + 'status' => bigbluebuttonbn_delete_recordings($params['id']) |
|
| 444 | + ); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | function bigbluebuttonbn_broker_recording_ready($params, $bigbluebuttonbn) { |
@@ -581,11 +581,11 @@ discard block |
||
| 581 | 581 | 'recording_import' => ['id' => 'The recordingID must be specified.'], |
| 582 | 582 | 'recording_ready' => [ |
| 583 | 583 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
| 584 | - ], |
|
| 584 | + ], |
|
| 585 | 585 | 'live_session_events' => [ |
| 586 | 586 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
| 587 | - ] |
|
| 588 | - ]; |
|
| 587 | + ] |
|
| 588 | + ]; |
|
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | function bigbluebuttonbn_broker_recording_is_imported($recordings, $recordingid) { |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 26 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 25 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 26 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 27 | 27 | |
| 28 | 28 | use \Firebase\JWT\JWT; |
| 29 | 29 | |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
| 40 | 40 | |
| 41 | 41 | if (empty($params['action'])) { |
| 42 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
| 42 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
| 47 | 47 | if (!empty($error)) { |
| 48 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 48 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
| 136 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
| 137 | 137 | return; |
| 138 | 138 | |
| 139 | 139 | } catch (Exception $e) { |
| 140 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
| 140 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
| 141 | 141 | return; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
| 284 | 284 | $callbackresponse['status'] = true; |
| 285 | - $callbackresponse['published'] = (string) $recording['published']; |
|
| 285 | + $callbackresponse['published'] = (string)$recording['published']; |
|
| 286 | 286 | if (!isset($params['meta'])) { |
| 287 | 287 | return $callbackresponse; |
| 288 | 288 | } |
@@ -451,8 +451,8 @@ discard block |
||
| 451 | 451 | $decodedparameters = JWT::decode($params['signed_parameters'], bigbluebuttonbn_get_cfg_shared_secret(), |
| 452 | 452 | array('HS256')); |
| 453 | 453 | } catch (Exception $e) { |
| 454 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 455 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 454 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 455 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 456 | 456 | return; |
| 457 | 457 | } |
| 458 | 458 | |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
| 471 | 471 | header('HTTP/1.0 202 Accepted'); |
| 472 | 472 | } catch (Exception $e) { |
| 473 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 474 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
| 473 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 474 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
| 487 | 487 | if (!isset($importrecordings[$params['id']])) { |
| 488 | 488 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
| 489 | - header('HTTP/1.0 404 Not found. '.$error); |
|
| 489 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
| 490 | 490 | return; |
| 491 | 491 | } |
| 492 | 492 | |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | |
| 495 | 495 | $importrecordings[$params['id']]['imported'] = true; |
| 496 | 496 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
| 497 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
| 497 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
| 498 | 498 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
| 499 | 499 | // Moodle event logger: Create an event for recording imported. |
| 500 | 500 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -511,8 +511,8 @@ discard block |
||
| 511 | 511 | $decodedparameters = JWT::decode($params['signed_parameters'], bigbluebuttonbn_get_cfg_shared_secret(), |
| 512 | 512 | array('HS256')); |
| 513 | 513 | } catch (Exception $e) { |
| 514 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 515 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 514 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 515 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 516 | 516 | return; |
| 517 | 517 | } |
| 518 | 518 | |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | $action = strtolower($params['action']); |
| 552 | 552 | if (!array_key_exists($action, $requiredparams)) { |
| 553 | - return 'Action '.$params['action'].' can not be performed.'; |
|
| 553 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
@@ -96,8 +96,8 @@ |
||
| 96 | 96 | $output .= html_writer::start_tag('br'); |
| 97 | 97 | $output .= html_writer::tag('input', '', |
| 98 | 98 | array('type' => 'button', 'class' => 'btn btn-secondary', |
| 99 | - 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
|
| 100 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
| 99 | + 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
|
| 100 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
| 101 | 101 | |
| 102 | 102 | // JavaScript for locales. |
| 103 | 103 | $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn'); |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 26 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 25 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 26 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 27 | 27 | |
| 28 | 28 | $bn = required_param('bn', PARAM_INT); |
| 29 | 29 | $tc = optional_param('tc', 0, PARAM_INT); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $output .= html_writer::tag('input', '', |
| 98 | 98 | array('type' => 'button', 'class' => 'btn btn-secondary', |
| 99 | 99 | 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
| 100 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
| 100 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $cm->id . '\'')); |
|
| 101 | 101 | |
| 102 | 102 | // JavaScript for locales. |
| 103 | 103 | $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn'); |
@@ -166,10 +166,10 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession, $bigbluebuttonbn) { |
| 168 | 168 | $data = ['meetingID' => $bbbsession['meetingid'], |
| 169 | - 'name' => $bbbsession['meetingname'], |
|
| 170 | - 'attendeePW' => $bbbsession['viewerPW'], |
|
| 171 | - 'moderatorPW' => $bbbsession['modPW'], |
|
| 172 | - 'logoutURL' => $bbbsession['logoutURL'], |
|
| 169 | + 'name' => $bbbsession['meetingname'], |
|
| 170 | + 'attendeePW' => $bbbsession['viewerPW'], |
|
| 171 | + 'moderatorPW' => $bbbsession['modPW'], |
|
| 172 | + 'logoutURL' => $bbbsession['logoutURL'], |
|
| 173 | 173 | ]; |
| 174 | 174 | |
| 175 | 175 | $data['record'] = 'false'; |
@@ -206,16 +206,16 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) { |
| 209 | - $metadata = ['bbb-origin' => $bbbsession['origin'], |
|
| 210 | - 'bbb-origin-version' => $bbbsession['originVersion'], |
|
| 211 | - 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
| 212 | - 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
| 213 | - 'bbb-origin-tag' => $bbbsession['originTag'], |
|
| 214 | - 'bbb-context' => $bbbsession['course']->fullname, |
|
| 215 | - 'bbb-recording-name' => $bbbsession['meetingname'], |
|
| 216 | - 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
| 217 | - 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
| 218 | - ]; |
|
| 209 | + $metadata = ['bbb-origin' => $bbbsession['origin'], |
|
| 210 | + 'bbb-origin-version' => $bbbsession['originVersion'], |
|
| 211 | + 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
| 212 | + 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
| 213 | + 'bbb-origin-tag' => $bbbsession['originTag'], |
|
| 214 | + 'bbb-context' => $bbbsession['course']->fullname, |
|
| 215 | + 'bbb-recording-name' => $bbbsession['meetingname'], |
|
| 216 | + 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
| 217 | + 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
| 218 | + ]; |
|
| 219 | 219 | |
| 220 | 220 | if (bigbluebuttonbn_is_bn_server()) { |
| 221 | 221 | if (bigbluebuttonbn_get_cfg_recordingready_enabled()) { |
@@ -60,96 +60,96 @@ |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | switch (strtolower($action)) { |
| 63 | - case 'logout': |
|
| 64 | - if (isset($errors) && $errors != '') { |
|
| 65 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
| 66 | - break; |
|
| 67 | - } |
|
| 68 | - |
|
| 69 | - if (is_null($bbbsession)) { |
|
| 70 | - bigbluebutton_bbb_view_close_window_manually(); |
|
| 71 | - break; |
|
| 72 | - } |
|
| 63 | + case 'logout': |
|
| 64 | + if (isset($errors) && $errors != '') { |
|
| 65 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
| 66 | + break; |
|
| 67 | + } |
|
| 73 | 68 | |
| 74 | - // Moodle event logger: Create an event for meeting left. |
|
| 75 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
| 69 | + if (is_null($bbbsession)) { |
|
| 70 | + bigbluebutton_bbb_view_close_window_manually(); |
|
| 71 | + break; |
|
| 72 | + } |
|
| 76 | 73 | |
| 77 | - // Update the cache. |
|
| 78 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
| 74 | + // Moodle event logger: Create an event for meeting left. |
|
| 75 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
| 79 | 76 | |
| 80 | - // Close the tab or window where BBB was opened. |
|
| 81 | - bigbluebutton_bbb_view_close_window(); |
|
| 82 | - break; |
|
| 83 | - case 'join': |
|
| 84 | - if (is_null($bbbsession)) { |
|
| 85 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
| 86 | - break; |
|
| 87 | - } |
|
| 77 | + // Update the cache. |
|
| 78 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
| 88 | 79 | |
| 89 | - // See if the session is in progress. |
|
| 90 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
| 91 | - // Since the meeting is already running, we just join the session. |
|
| 92 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 80 | + // Close the tab or window where BBB was opened. |
|
| 81 | + bigbluebutton_bbb_view_close_window(); |
|
| 93 | 82 | break; |
| 94 | - } |
|
| 83 | + case 'join': |
|
| 84 | + if (is_null($bbbsession)) { |
|
| 85 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
| 86 | + break; |
|
| 87 | + } |
|
| 95 | 88 | |
| 96 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
| 97 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
| 98 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 99 | - break; |
|
| 100 | - } |
|
| 89 | + // See if the session is in progress. |
|
| 90 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
| 91 | + // Since the meeting is already running, we just join the session. |
|
| 92 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 93 | + break; |
|
| 94 | + } |
|
| 101 | 95 | |
| 102 | - // As the meeting doesn't exist, try to create it. |
|
| 103 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
| 104 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn), |
|
| 105 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
| 106 | - $bbbsession['presentation']['name'], |
|
| 107 | - $bbbsession['presentation']['url'] |
|
| 108 | - ); |
|
| 109 | - |
|
| 110 | - if (!$response) { |
|
| 111 | - // The server is unreachable. |
|
| 112 | - if ($bbbsession['administrator']) { |
|
| 113 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
| 114 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 96 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
| 97 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
| 98 | + header('Location: '.$bbbsession['logoutURL']); |
|
| 115 | 99 | break; |
| 116 | 100 | } |
| 117 | - if ($bbbsession['moderator']) { |
|
| 118 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
| 101 | + |
|
| 102 | + // As the meeting doesn't exist, try to create it. |
|
| 103 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
| 104 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn), |
|
| 105 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
| 106 | + $bbbsession['presentation']['name'], |
|
| 107 | + $bbbsession['presentation']['url'] |
|
| 108 | + ); |
|
| 109 | + |
|
| 110 | + if (!$response) { |
|
| 111 | + // The server is unreachable. |
|
| 112 | + if ($bbbsession['administrator']) { |
|
| 113 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
| 114 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 115 | + break; |
|
| 116 | + } |
|
| 117 | + if ($bbbsession['moderator']) { |
|
| 118 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
| 119 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 120 | + break; |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
| 119 | 124 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
| 120 | 125 | break; |
| 121 | 126 | } |
| 122 | 127 | |
| 123 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
| 124 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 125 | - break; |
|
| 126 | - } |
|
| 128 | + if ($response['returncode'] == 'FAILED') { |
|
| 129 | + // The meeting was not created. |
|
| 130 | + if (!$printerrorkey) { |
|
| 131 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
| 132 | + break; |
|
| 133 | + } |
|
| 134 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
| 135 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
| 136 | + break; |
|
| 137 | + } |
|
| 127 | 138 | |
| 128 | - if ($response['returncode'] == 'FAILED') { |
|
| 129 | - // The meeting was not created. |
|
| 130 | - if (!$printerrorkey) { |
|
| 131 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
| 139 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
| 140 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
| 132 | 141 | break; |
| 133 | 142 | } |
| 134 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
| 135 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
| 136 | - break; |
|
| 137 | - } |
|
| 138 | 143 | |
| 139 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
| 140 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
| 144 | + // Moodle event logger: Create an event for meeting created. |
|
| 145 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
| 146 | + // Internal logger: Insert a record with the meeting created. |
|
| 147 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
| 148 | + // Since the meeting is already running, we just join the session. |
|
| 149 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 141 | 150 | break; |
| 142 | - } |
|
| 143 | - |
|
| 144 | - // Moodle event logger: Create an event for meeting created. |
|
| 145 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
| 146 | - // Internal logger: Insert a record with the meeting created. |
|
| 147 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
| 148 | - // Since the meeting is already running, we just join the session. |
|
| 149 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 150 | - break; |
|
| 151 | - default: |
|
| 152 | - bigbluebutton_bbb_view_close_window(); |
|
| 151 | + default: |
|
| 152 | + bigbluebutton_bbb_view_close_window(); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | function bigbluebutton_bbb_view_close_window() { |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 26 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 25 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 26 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 27 | 27 | |
| 28 | 28 | $id = optional_param('id', 0, PARAM_INT); |
| 29 | 29 | $bn = optional_param('bn', 0, PARAM_INT); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
| 97 | 97 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
| 98 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 98 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 99 | 99 | break; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -111,17 +111,17 @@ discard block |
||
| 111 | 111 | // The server is unreachable. |
| 112 | 112 | if ($bbbsession['administrator']) { |
| 113 | 113 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
| 114 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 114 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 115 | 115 | break; |
| 116 | 116 | } |
| 117 | 117 | if ($bbbsession['moderator']) { |
| 118 | 118 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
| 119 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 119 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 120 | 120 | break; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
| 124 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 124 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 125 | 125 | break; |
| 126 | 126 | } |
| 127 | 127 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | if ($durationtime > 0) { |
| 191 | 191 | $data['duration'] = $durationtime; |
| 192 | - $data['welcome'] .= '<br><br>'.str_replace('%duration%', ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
| 192 | + $data['welcome'] .= '<br><br>' . str_replace('%duration%', '' . $durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $voicebridge = intval($bbbsession['voicebridge']); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
| 237 | 237 | // No more users allowed to join. |
| 238 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 238 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 239 | 239 | |
| 240 | 240 | return; |
| 241 | 241 | } |
@@ -255,20 +255,20 @@ discard block |
||
| 255 | 255 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
| 256 | 256 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
| 257 | 257 | // Execute the redirect. |
| 258 | - header('Location: '.$joinurl); |
|
| 258 | + header('Location: ' . $joinurl); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
| 262 | 262 | global $CFG, $OUTPUT; |
| 263 | 263 | |
| 264 | - $errors = (array) json_decode(urldecode($serrors)); |
|
| 264 | + $errors = (array)json_decode(urldecode($serrors)); |
|
| 265 | 265 | $msgerrors = ''; |
| 266 | 266 | foreach ($errors as $error) { |
| 267 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
| 267 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | echo $OUTPUT->header(); |
| 271 | 271 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
| 272 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
| 272 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
| 273 | 273 | echo $OUTPUT->footer(); |
| 274 | 274 | } |