@@ -40,12 +40,12 @@ |
||
40 | 40 | 'moderatorpass', 'viewerpass', 'wait', 'record', 'tagging', |
41 | 41 | 'welcome', 'voicebridge', 'openingtime', 'closingtime', |
42 | 42 | 'timecreated', 'timemodified', 'presentation', 'participants', |
43 | - 'userlimit', )); |
|
43 | + 'userlimit',)); |
|
44 | 44 | |
45 | 45 | $logs = new backup_nested_element('logs'); |
46 | 46 | |
47 | 47 | $log = new backup_nested_element('log', array('id'), array( |
48 | - 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', )); |
|
48 | + 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',)); |
|
49 | 49 | |
50 | 50 | // Build the tree. |
51 | 51 | $bigbluebuttonbn->add_child($logs); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | // BigBlueButton API Calls. |
81 | 81 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
82 | 82 | $data = ['meetingID' => $meetingid, |
83 | - 'fullName' => $username, |
|
84 | - 'password' => $pw, |
|
85 | - 'logoutURL' => $logouturl, |
|
83 | + 'fullName' => $username, |
|
84 | + 'password' => $pw, |
|
85 | + 'logoutURL' => $logouturl, |
|
86 | 86 | ]; |
87 | 87 | |
88 | 88 | if (!is_null($configtoken)) { |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | function bigbluebuttonbn_get_create_meeting_url($name, $meetingid, $attendeepw, $moderatorpw, $welcome, |
99 | 99 | $logouturl, $record = 'false', $duration = 0, $voicebridge = 0, $maxparticipants = 0, $metadata = array()) { |
100 | 100 | $data = ['meetingID' => $meetingid, |
101 | - 'name' => $name, |
|
102 | - 'attendeePW' => $attendeepw, |
|
103 | - 'moderatorPW' => $moderatorpw, |
|
104 | - 'logoutURL' => $logouturl, |
|
105 | - 'record' => $record, |
|
101 | + 'name' => $name, |
|
102 | + 'attendeePW' => $attendeepw, |
|
103 | + 'moderatorPW' => $moderatorpw, |
|
104 | + 'logoutURL' => $logouturl, |
|
105 | + 'record' => $record, |
|
106 | 106 | ]; |
107 | 107 | |
108 | 108 | $voicebridge = intval($voicebridge); |
@@ -234,24 +234,24 @@ discard block |
||
234 | 234 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
235 | 235 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
236 | 236 | bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
237 | - ); |
|
237 | + ); |
|
238 | 238 | |
239 | 239 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
240 | 240 | // Meeting info was returned. |
241 | 241 | return array('returncode' => $xml->returncode, |
242 | - 'meetingID' => $xml->meetingID, |
|
243 | - 'moderatorPW' => $xml->moderatorPW, |
|
244 | - 'attendeePW' => $xml->attendeePW, |
|
245 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
246 | - 'running' => $xml->running, |
|
247 | - 'recording' => $xml->recording, |
|
248 | - 'startTime' => $xml->startTime, |
|
249 | - 'endTime' => $xml->endTime, |
|
250 | - 'participantCount' => $xml->participantCount, |
|
251 | - 'moderatorCount' => $xml->moderatorCount, |
|
252 | - 'attendees' => $xml->attendees, |
|
253 | - 'metadata' => $xml->metadata, |
|
254 | - ); |
|
242 | + 'meetingID' => $xml->meetingID, |
|
243 | + 'moderatorPW' => $xml->moderatorPW, |
|
244 | + 'attendeePW' => $xml->attendeePW, |
|
245 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
246 | + 'running' => $xml->running, |
|
247 | + 'recording' => $xml->recording, |
|
248 | + 'startTime' => $xml->startTime, |
|
249 | + 'endTime' => $xml->endTime, |
|
250 | + 'participantCount' => $xml->participantCount, |
|
251 | + 'moderatorCount' => $xml->moderatorCount, |
|
252 | + 'attendees' => $xml->attendees, |
|
253 | + 'metadata' => $xml->metadata, |
|
254 | + ); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | if ($xml) { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | // Do getRecordings is executed using a method GET (supported by all versions of BBB). |
288 | 288 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
289 | 289 | bigbluebuttonbn_bigbluebutton_action_url('getRecordings', ['meetingID' => implode(',', $mids)]) |
290 | - ); |
|
290 | + ); |
|
291 | 291 | if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { |
292 | 292 | // If there were meetings already created. |
293 | 293 | foreach ($xml->recordings->recording as $recording) { |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | function bigbluebuttonbn_get_default_config_xml() { |
359 | 359 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
360 | 360 | bigbluebuttonbn_bigbluebutton_action_url('getDefaultConfigXML') |
361 | - ); |
|
361 | + ); |
|
362 | 362 | |
363 | 363 | return $xml; |
364 | 364 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | foreach ($ids as $id) { |
426 | 426 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
427 | 427 | bigbluebuttonbn_bigbluebutton_action_url('deleteRecordings', ['recordID' => $id]) |
428 | - ); |
|
428 | + ); |
|
429 | 429 | if ($xml && $xml->returncode != 'SUCCESS') { |
430 | 430 | return false; |
431 | 431 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | foreach ($ids as $id) { |
444 | 444 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
445 | 445 | bigbluebuttonbn_bigbluebutton_action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
446 | - ); |
|
446 | + ); |
|
447 | 447 | if ($xml && $xml->returncode != 'SUCCESS') { |
448 | 448 | return false; |
449 | 449 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
460 | 460 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
461 | 461 | bigbluebuttonbn_bigbluebutton_action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
462 | - ); |
|
462 | + ); |
|
463 | 463 | |
464 | 464 | if ($xml) { |
465 | 465 | // If the xml packet returned failure it displays the message to the user. |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | function bigbluebuttonbn_is_meeting_running($meetingid) { |
477 | 477 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
478 | 478 | bigbluebuttonbn_bigbluebutton_action_url('isMeetingRunning', ['meetingID' => $meetingid]) |
479 | - ); |
|
479 | + ); |
|
480 | 480 | |
481 | 481 | if ($xml && $xml->returncode == 'SUCCESS') { |
482 | 482 | return ($xml->running == 'true') ? true : false; |
@@ -552,10 +552,10 @@ discard block |
||
552 | 552 | |
553 | 553 | $options = array(); |
554 | 554 | $options['CURLOPT_HTTPHEADER'] = array( |
555 | - 'Content-Type: '.$contenttype, |
|
556 | - 'Content-Length: '.strlen($data), |
|
557 | - 'Content-Language: en-US', |
|
558 | - ); |
|
555 | + 'Content-Type: '.$contenttype, |
|
556 | + 'Content-Length: '.strlen($data), |
|
557 | + 'Content-Language: en-US', |
|
558 | + ); |
|
559 | 559 | |
560 | 560 | return $c->post($url, $data, $options); |
561 | 561 | } |
@@ -621,8 +621,8 @@ discard block |
||
621 | 621 | $participantlist = json_decode($bigbluebuttonbn->participants); |
622 | 622 | foreach ($participantlist as $participant) { |
623 | 623 | $participantlistarray[] = array('selectiontype' => $participant->selectiontype, |
624 | - 'selectionid' => $participant->selectionid, |
|
625 | - 'role' => $participant->role, ); |
|
624 | + 'selectionid' => $participant->selectionid, |
|
625 | + 'role' => $participant->role, ); |
|
626 | 626 | } |
627 | 627 | |
628 | 628 | return $participantlistarray; |
@@ -633,8 +633,8 @@ discard block |
||
633 | 633 | |
634 | 634 | $participantlistarray = array(); |
635 | 635 | $participantlistarray[] = array('selectiontype' => 'all', |
636 | - 'selectionid' => 'all', |
|
637 | - 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER, ); |
|
636 | + 'selectionid' => 'all', |
|
637 | + 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER, ); |
|
638 | 638 | |
639 | 639 | $moderatordefaults = explode(',', bigbluebuttonbn_get_cfg_moderator_default()); |
640 | 640 | foreach ($moderatordefaults as $moderatordefault) { |
@@ -643,8 +643,8 @@ discard block |
||
643 | 643 | foreach ($users as $user) { |
644 | 644 | if ($user->id == $USER->id) { |
645 | 645 | $participantlistarray[] = array('selectiontype' => 'user', |
646 | - 'selectionid' => $USER->id, |
|
647 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
646 | + 'selectionid' => $USER->id, |
|
647 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
648 | 648 | break; |
649 | 649 | } |
650 | 650 | } |
@@ -652,8 +652,8 @@ discard block |
||
652 | 652 | } |
653 | 653 | |
654 | 654 | $participantlistarray[] = array('selectiontype' => 'role', |
655 | - 'selectionid' => $moderatordefault, |
|
656 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
655 | + 'selectionid' => $moderatordefault, |
|
656 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
657 | 657 | } |
658 | 658 | |
659 | 659 | return $participantlistarray; |
@@ -767,8 +767,8 @@ discard block |
||
767 | 767 | } |
768 | 768 | |
769 | 769 | $parray = array('url' => $purl, 'name' => $pname, |
770 | - 'icon' => $picon, |
|
771 | - 'mimetype_description' => $pmimetypedescrip); |
|
770 | + 'icon' => $picon, |
|
771 | + 'mimetype_description' => $pmimetypedescrip); |
|
772 | 772 | |
773 | 773 | return $parray; |
774 | 774 | } |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | // Ping again and refresh the cache. |
886 | 886 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
887 | 887 | bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
888 | - ); |
|
888 | + ); |
|
889 | 889 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
890 | 890 | |
891 | 891 | return $meetinginfo; |
@@ -1848,24 +1848,24 @@ discard block |
||
1848 | 1848 | */ |
1849 | 1849 | function bigbluebuttonbn_get_cfg_options() { |
1850 | 1850 | return [ |
1851 | - 'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(), |
|
1852 | - 'recording_default' => bigbluebuttonbn_get_cfg_recording_default(), |
|
1853 | - 'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(), |
|
1854 | - 'recording_tagging_default' => bigbluebuttonbn_get_cfg_recording_tagging_default(), |
|
1855 | - 'recording_tagging_editable' => bigbluebuttonbn_get_cfg_recording_tagging_editable(), |
|
1856 | - 'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(), |
|
1857 | - 'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(), |
|
1858 | - 'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(), |
|
1859 | - 'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(), |
|
1860 | - 'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(), |
|
1861 | - 'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(), |
|
1862 | - 'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(), |
|
1863 | - 'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(), |
|
1864 | - 'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(), |
|
1865 | - 'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(), |
|
1866 | - 'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(), |
|
1867 | - 'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(), |
|
1868 | - 'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL, |
|
1851 | + 'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(), |
|
1852 | + 'recording_default' => bigbluebuttonbn_get_cfg_recording_default(), |
|
1853 | + 'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(), |
|
1854 | + 'recording_tagging_default' => bigbluebuttonbn_get_cfg_recording_tagging_default(), |
|
1855 | + 'recording_tagging_editable' => bigbluebuttonbn_get_cfg_recording_tagging_editable(), |
|
1856 | + 'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(), |
|
1857 | + 'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(), |
|
1858 | + 'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(), |
|
1859 | + 'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(), |
|
1860 | + 'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(), |
|
1861 | + 'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(), |
|
1862 | + 'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(), |
|
1863 | + 'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(), |
|
1864 | + 'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(), |
|
1865 | + 'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(), |
|
1866 | + 'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(), |
|
1867 | + 'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(), |
|
1868 | + 'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL, |
|
1869 | 1869 | ]; |
1870 | 1870 | } |
1871 | 1871 | |
@@ -2050,8 +2050,8 @@ discard block |
||
2050 | 2050 | $activitytime = ''; |
2051 | 2051 | if ($time) { |
2052 | 2052 | $activitytime = calendar_day_representation($time).' '. |
2053 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2054 | - calendar_time_representation($time); |
|
2053 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2054 | + calendar_time_representation($time); |
|
2055 | 2055 | } |
2056 | 2056 | |
2057 | 2057 | 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 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (isset($meta)) { |
72 | 72 | $log->meta = $meta; |
73 | 73 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
74 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
74 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
@@ -141,19 +141,19 @@ discard block |
||
141 | 141 | * @param array $metadata |
142 | 142 | */ |
143 | 143 | function bigbluebuttonbn_bigbluebutton_action_url($action, $data = array(), $metadata = array()) { |
144 | - $baseurl = bigbluebuttonbn_get_cfg_server_url().'api/'.$action.'?'; |
|
144 | + $baseurl = bigbluebuttonbn_get_cfg_server_url() . 'api/' . $action . '?'; |
|
145 | 145 | |
146 | 146 | $params = ''; |
147 | 147 | |
148 | 148 | foreach ($data as $key => $value) { |
149 | - $params .= '&'.$key.'='.urlencode($value); |
|
149 | + $params .= '&' . $key . '=' . urlencode($value); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | foreach ($metadata as $key => $value) { |
153 | - $params .= '&'.'meta_'.$key.'='.urlencode($value); |
|
153 | + $params .= '&' . 'meta_' . $key . '=' . urlencode($value); |
|
154 | 154 | } |
155 | 155 | |
156 | - return $baseurl.$params.'&checksum='.sha1($action.$params.bigbluebuttonbn_get_cfg_shared_secret()); |
|
156 | + return $baseurl . $params . '&checksum=' . sha1($action . $params . bigbluebuttonbn_get_cfg_shared_secret()); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | function bigbluebuttonbn_get_create_meeting_array($meetingname, $meetingid, $welcomestring, $mpw, $apw, |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | |
168 | 168 | if (!is_null($pname) && !is_null($purl)) { |
169 | 169 | $method = BIGBLUEBUTTONBN_METHOD_POST; |
170 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
171 | - $purl."' /></module></modules>"; |
|
170 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
171 | + $purl . "' /></module></modules>"; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | 'moderatorPW' => $meeting->moderatorPW, |
214 | 214 | 'attendeePW' => $meeting->attendeePW, |
215 | 215 | 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, |
216 | - 'running' => $meeting->running, ); |
|
216 | + 'running' => $meeting->running,); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | return $meetings; |
@@ -330,12 +330,12 @@ discard block |
||
330 | 330 | function bigbluebuttonbn_get_recordings_imported_array($courseid, $bigbluebuttonbnid = null, $subset = true) { |
331 | 331 | global $DB; |
332 | 332 | |
333 | - $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
334 | - BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
333 | + $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
334 | + BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
335 | 335 | if ($bigbluebuttonbnid === null) { |
336 | - $select = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
336 | + $select = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
337 | 337 | } else if ($subset) { |
338 | - $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'"; |
|
338 | + $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'"; |
|
339 | 339 | } |
340 | 340 | $recordsimported = $DB->get_records_select('bigbluebuttonbn_logs', $select); |
341 | 341 | |
@@ -366,26 +366,26 @@ discard block |
||
366 | 366 | function bigbluebuttonbn_get_default_config_xml_array() { |
367 | 367 | $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML(); |
368 | 368 | |
369 | - return (array) $defaultconfigxml; |
|
369 | + return (array)$defaultconfigxml; |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | function bigbluebuttonbn_get_recording_array_value($recording) { |
373 | 373 | // Add formats. |
374 | 374 | $playbackarray = array(); |
375 | 375 | foreach ($recording->playback->format as $format) { |
376 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
377 | - 'url' => (string) $format->url, 'length' => (string) $format->length); |
|
376 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
377 | + 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
378 | 378 | // Add preview per format when existing. |
379 | 379 | if ($format->preview) { |
380 | 380 | $imagesarray = array(); |
381 | 381 | foreach ($format->preview->images->image as $image) { |
382 | - $imagearray = array('url' => (string) $image); |
|
382 | + $imagearray = array('url' => (string)$image); |
|
383 | 383 | foreach ($image->attributes() as $attkey => $attvalue) { |
384 | - $imagearray[$attkey] = (string) $attvalue; |
|
384 | + $imagearray[$attkey] = (string)$attvalue; |
|
385 | 385 | } |
386 | 386 | array_push($imagesarray, $imagearray); |
387 | 387 | } |
388 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
388 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
389 | 389 | } |
390 | 390 | } |
391 | 391 | |
@@ -396,13 +396,13 @@ discard block |
||
396 | 396 | if (is_object($value)) { |
397 | 397 | $value = ''; |
398 | 398 | } |
399 | - $metadataarray['meta_'.$key] = $value; |
|
399 | + $metadataarray['meta_' . $key] = $value; |
|
400 | 400 | } |
401 | 401 | |
402 | - $recordingarrayvalue = array('recordID' => (string) $recording->recordID, |
|
403 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
404 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
405 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray) + $metadataarray; |
|
402 | + $recordingarrayvalue = array('recordID' => (string)$recording->recordID, |
|
403 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
404 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
405 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray) + $metadataarray; |
|
406 | 406 | |
407 | 407 | return $recordingarrayvalue; |
408 | 408 | } |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | } |
487 | 487 | |
488 | 488 | function bigbluebuttonbn_get_server_version() { |
489 | - $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_get_cfg_server_url().'api'); |
|
489 | + $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_get_cfg_server_url() . 'api'); |
|
490 | 490 | |
491 | 491 | if ($xml && $xml->returncode == 'SUCCESS') { |
492 | 492 | return $xml->version; |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = BIGBLUEBUTTONBN_METHOD_GET, |
503 | 503 | $data = null, $contenttype = 'text/xml') { |
504 | 504 | |
505 | - debugging('Request to: '.$url, DEBUG_DEVELOPER); |
|
505 | + debugging('Request to: ' . $url, DEBUG_DEVELOPER); |
|
506 | 506 | |
507 | 507 | if (extension_loaded('curl')) { |
508 | 508 | $response = bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method, $data, $contenttype); |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | return null; |
513 | 513 | } |
514 | 514 | |
515 | - debugging('Response: '.$response, DEBUG_DEVELOPER); |
|
515 | + debugging('Response: ' . $response, DEBUG_DEVELOPER); |
|
516 | 516 | |
517 | 517 | $previous = libxml_use_internal_errors(true); |
518 | 518 | try { |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | return $xml; |
522 | 522 | } catch (Exception $e) { |
523 | 523 | libxml_use_internal_errors($previous); |
524 | - $error = 'Caught exception: '.$e->getMessage(); |
|
524 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
525 | 525 | debugging($error, DEBUG_DEVELOPER); |
526 | 526 | return null; |
527 | 527 | } |
@@ -531,10 +531,10 @@ discard block |
||
531 | 531 | $previous = libxml_use_internal_errors(true); |
532 | 532 | try { |
533 | 533 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
534 | - debugging('Response processed: '.$response->asXML(), DEBUG_DEVELOPER); |
|
534 | + debugging('Response processed: ' . $response->asXML(), DEBUG_DEVELOPER); |
|
535 | 535 | return $response; |
536 | 536 | } catch (Exception $e) { |
537 | - $error = 'Caught exception: '.$e->getMessage(); |
|
537 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
538 | 538 | debugging($error, DEBUG_DEVELOPER); |
539 | 539 | libxml_use_internal_errors($previous); |
540 | 540 | return null; |
@@ -552,8 +552,8 @@ discard block |
||
552 | 552 | |
553 | 553 | $options = array(); |
554 | 554 | $options['CURLOPT_HTTPHEADER'] = array( |
555 | - 'Content-Type: '.$contenttype, |
|
556 | - 'Content-Length: '.strlen($data), |
|
555 | + 'Content-Type: ' . $contenttype, |
|
556 | + 'Content-Length: ' . strlen($data), |
|
557 | 557 | 'Content-Language: en-US', |
558 | 558 | ); |
559 | 559 | |
@@ -570,9 +570,9 @@ discard block |
||
570 | 570 | if ($userroles) { |
571 | 571 | $where = ''; |
572 | 572 | foreach ($userroles as $value) { |
573 | - $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid; |
|
573 | + $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid; |
|
574 | 574 | } |
575 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
575 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
576 | 576 | } |
577 | 577 | |
578 | 578 | return $userroles; |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | foreach ($participantlist as $participant) { |
623 | 623 | $participantlistarray[] = array('selectiontype' => $participant->selectiontype, |
624 | 624 | 'selectionid' => $participant->selectionid, |
625 | - 'role' => $participant->role, ); |
|
625 | + 'role' => $participant->role,); |
|
626 | 626 | } |
627 | 627 | |
628 | 628 | return $participantlistarray; |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | $participantlistarray = array(); |
635 | 635 | $participantlistarray[] = array('selectiontype' => 'all', |
636 | 636 | 'selectionid' => 'all', |
637 | - 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER, ); |
|
637 | + 'role' => BIGBLUEBUTTONBN_ROLE_VIEWER,); |
|
638 | 638 | |
639 | 639 | $moderatordefaults = explode(',', bigbluebuttonbn_get_cfg_moderator_default()); |
640 | 640 | foreach ($moderatordefaults as $moderatordefault) { |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | if ($user->id == $USER->id) { |
645 | 645 | $participantlistarray[] = array('selectiontype' => 'user', |
646 | 646 | 'selectionid' => $USER->id, |
647 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
647 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR,); |
|
648 | 648 | break; |
649 | 649 | } |
650 | 650 | } |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | |
654 | 654 | $participantlistarray[] = array('selectiontype' => 'role', |
655 | 655 | 'selectionid' => $moderatordefault, |
656 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, ); |
|
656 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR,); |
|
657 | 657 | } |
658 | 658 | |
659 | 659 | return $participantlistarray; |
@@ -707,9 +707,9 @@ discard block |
||
707 | 707 | $isunique = true; |
708 | 708 | if ($voicebridge != 0) { |
709 | 709 | $table = 'bigbluebuttonbn'; |
710 | - $select = 'voicebridge = '.$voicebridge; |
|
710 | + $select = 'voicebridge = ' . $voicebridge; |
|
711 | 711 | if ($id) { |
712 | - $select .= ' AND id <> '.$id; |
|
712 | + $select .= ' AND id <> ' . $id; |
|
713 | 713 | } |
714 | 714 | if ($DB->get_records_select($table, $select)) { |
715 | 715 | $isunique = false; |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | $mt = microtime(); |
778 | 778 | $rand = mt_rand(); |
779 | 779 | |
780 | - return md5($mt.$rand); |
|
780 | + return md5($mt . $rand); |
|
781 | 781 | } |
782 | 782 | |
783 | 783 | function bigbluebuttonbn_random_password($length = 8) { |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | } |
884 | 884 | |
885 | 885 | // Ping again and refresh the cache. |
886 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
886 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
887 | 887 | bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
888 | 888 | ); |
889 | 889 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | case 'moodle_event': |
971 | 971 | break; |
972 | 972 | default: |
973 | - return bigbluebuttonbn_add_error($error, 'Action '.$params['action'].' can not be performed.'); |
|
973 | + return bigbluebuttonbn_add_error($error, 'Action ' . $params['action'] . ' can not be performed.'); |
|
974 | 974 | } |
975 | 975 | |
976 | 976 | return ''; |
@@ -994,8 +994,8 @@ discard block |
||
994 | 994 | * @param string $configxml |
995 | 995 | */ |
996 | 996 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
997 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
998 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.bigbluebuttonbn_get_cfg_shared_secret()); |
|
997 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
998 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . bigbluebuttonbn_get_cfg_shared_secret()); |
|
999 | 999 | |
1000 | 1000 | return $configxmlparams; |
1001 | 1001 | } |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | * @param string $configxml |
1006 | 1006 | */ |
1007 | 1007 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1008 | - $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url().'api/setConfigXML?'; |
|
1008 | + $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url() . 'api/setConfigXML?'; |
|
1009 | 1009 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1010 | 1010 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
1011 | 1011 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | */ |
1020 | 1020 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1021 | 1021 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1022 | - $configxmlarray = (array) $configxml; |
|
1022 | + $configxmlarray = (array)$configxml; |
|
1023 | 1023 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1024 | 1024 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1025 | 1025 | return ''; |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | $row->date = floatval($recording['startTime']); |
1053 | 1053 | |
1054 | 1054 | // Set formatted date. |
1055 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1055 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1056 | 1056 | $row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1057 | 1057 | |
1058 | 1058 | // Set formatted duration. |
@@ -1119,7 +1119,7 @@ discard block |
||
1119 | 1119 | |
1120 | 1120 | $attributes = 'data-imported="false"'; |
1121 | 1121 | if (isset($recording['imported'])) { |
1122 | - $attributes = 'data-imported="true" title="'.get_string('view_recording_link_warning', 'bigbluebuttonbn').'"'; |
|
1122 | + $attributes = 'data-imported="true" title="' . get_string('view_recording_link_warning', 'bigbluebuttonbn') . '"'; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | $visibility = ''; |
@@ -1127,11 +1127,11 @@ discard block |
||
1127 | 1127 | $visibility = 'hidden '; |
1128 | 1128 | } |
1129 | 1129 | |
1130 | - $recordingtypes = '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.' '.$visibility.'>'; |
|
1130 | + $recordingtypes = '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . ' ' . $visibility . '>'; |
|
1131 | 1131 | foreach ($recording['playbacks'] as $playback) { |
1132 | - $recordingtypes .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'], |
|
1133 | - 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'], |
|
1134 | - 'bigbluebuttonbn'), 'target' => '_new')).' '; |
|
1132 | + $recordingtypes .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_' . $playback['type'], |
|
1133 | + 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_' . $playback['type'], |
|
1134 | + 'bigbluebuttonbn'), 'target' => '_new')) . ' '; |
|
1135 | 1135 | } |
1136 | 1136 | $recordingtypes .= '</div>'; |
1137 | 1137 | |
@@ -1165,13 +1165,13 @@ discard block |
||
1165 | 1165 | function bigbluebuttonbn_actionbar_render($manageaction, $managetag, $recording) { |
1166 | 1166 | global $OUTPUT; |
1167 | 1167 | |
1168 | - $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("'.$manageaction.'", "'. |
|
1169 | - $recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
1168 | + $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("' . $manageaction . '", "' . |
|
1169 | + $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
1170 | 1170 | if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
1171 | 1171 | // With icon for $manageaction. |
1172 | - $iconattributes = array('id' => 'recording-btn-'.$manageaction.'-'.$recording['recordID']); |
|
1173 | - $icon = new pix_icon('i/'.$managetag, get_string($managetag), 'moodle', $iconattributes); |
|
1174 | - $linkattributes = array('id' => 'recording-link-'.$manageaction.'-'.$recording['recordID'], |
|
1172 | + $iconattributes = array('id' => 'recording-btn-' . $manageaction . '-' . $recording['recordID']); |
|
1173 | + $icon = new pix_icon('i/' . $managetag, get_string($managetag), 'moodle', $iconattributes); |
|
1174 | + $linkattributes = array('id' => 'recording-link-' . $manageaction . '-' . $recording['recordID'], |
|
1175 | 1175 | 'onclick' => $onclick); |
1176 | 1176 | |
1177 | 1177 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1245,7 +1245,7 @@ discard block |
||
1245 | 1245 | $table->data = array(); |
1246 | 1246 | |
1247 | 1247 | // Initialize table headers. |
1248 | - $table->head = array($playback.$recording, $description, $preview, $date, $duration); |
|
1248 | + $table->head = array($playback . $recording, $description, $preview, $date, $duration); |
|
1249 | 1249 | $table->align = array('left', 'left', 'left', 'left', 'left', 'center'); |
1250 | 1250 | if ($bbbsession['managerecordings']) { |
1251 | 1251 | $table->head[] = $actionbar; |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | // There are recordings for this meeting. |
1258 | 1258 | foreach ($recordings as $recording) { |
1259 | 1259 | $row = new html_table_row(); |
1260 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1260 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1261 | 1261 | $row->attributes['data-imported'] = 'false'; |
1262 | 1262 | if (isset($recording['imported'])) { |
1263 | 1263 | $row->attributes['data-imported'] = 'true'; |
@@ -1289,9 +1289,9 @@ discard block |
||
1289 | 1289 | // Build the message_body. |
1290 | 1290 | $msg->activity_type = ''; |
1291 | 1291 | $msg->activity_title = $bigbluebuttonbn->name; |
1292 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
1293 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
1294 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1292 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
1293 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
1294 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1295 | 1295 | |
1296 | 1296 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext); |
1297 | 1297 | } |
@@ -1362,15 +1362,15 @@ discard block |
||
1362 | 1362 | global $CFG; |
1363 | 1363 | |
1364 | 1364 | if (isset($CFG->bigbluebuttonbn['server_url'])) { |
1365 | - return trim(trim($CFG->bigbluebuttonbn['server_url']), '/').'/'; |
|
1365 | + return trim(trim($CFG->bigbluebuttonbn['server_url']), '/') . '/'; |
|
1366 | 1366 | } |
1367 | 1367 | |
1368 | 1368 | if (isset($CFG->bigbluebuttonbn_server_url)) { |
1369 | - return trim(trim($CFG->bigbluebuttonbn_server_url), '/').'/'; |
|
1369 | + return trim(trim($CFG->bigbluebuttonbn_server_url), '/') . '/'; |
|
1370 | 1370 | } |
1371 | 1371 | |
1372 | 1372 | if (isset($CFG->BigBlueButtonBNServerURL)) { |
1373 | - return trim(trim($CFG->BigBlueButtonBNServerURL), '/').'/'; |
|
1373 | + return trim(trim($CFG->BigBlueButtonBNServerURL), '/') . '/'; |
|
1374 | 1374 | } |
1375 | 1375 | |
1376 | 1376 | return BIGBLUEBUTTONBN_DEFAULT_SERVER_URL; |
@@ -1917,7 +1917,7 @@ discard block |
||
1917 | 1917 | $tags = ''; |
1918 | 1918 | $tagsarray = core_tag_tag::get_item_tags_array('core', 'course_modules', $id); |
1919 | 1919 | foreach ($tagsarray as $tag) { |
1920 | - $tags .= ($tags == '') ? $tag : ','.$tag; |
|
1920 | + $tags .= ($tags == '') ? $tag : ',' . $tag; |
|
1921 | 1921 | } |
1922 | 1922 | |
1923 | 1923 | return $tags; |
@@ -1941,15 +1941,15 @@ discard block |
||
1941 | 1941 | |
1942 | 1942 | // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'. |
1943 | 1943 | $select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'"; |
1944 | - $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
1945 | - BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1944 | + $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
1945 | + BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1946 | 1946 | if ($bigbluebuttonbnid === null) { |
1947 | 1947 | $select = "course = '{$courseid}'"; |
1948 | - $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1948 | + $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1949 | 1949 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1950 | 1950 | } else if ($subset) { |
1951 | 1951 | $select = "id = '{$bigbluebuttonbnid}'"; |
1952 | - $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1952 | + $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1953 | 1953 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1954 | 1954 | } |
1955 | 1955 | $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid'); |
@@ -1971,7 +1971,7 @@ discard block |
||
1971 | 1971 | if (!empty($bigbluebuttonbns)) { |
1972 | 1972 | // Prepare select for loading records based on existent bigbluebuttonbns. |
1973 | 1973 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
1974 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
1974 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
1975 | 1975 | // Include only Create events and exclude those with record not true. |
1976 | 1976 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
1977 | 1977 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2049,8 +2049,8 @@ discard block |
||
2049 | 2049 | function bigbluebuttonbn_format_activity_time($time) { |
2050 | 2050 | $activitytime = ''; |
2051 | 2051 | if ($time) { |
2052 | - $activitytime = calendar_day_representation($time).' '. |
|
2053 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2052 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2053 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2054 | 2054 | calendar_time_representation($time); |
2055 | 2055 | } |
2056 | 2056 |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | 'strings' => $strings, 'pix_icon_delete_url' => $pixicondeleteurl, 'roles' => $roles, |
89 | 89 | 'users' => $users, 'participant_selection' => $participantselection, |
90 | 90 | 'participant_list' => $participantlist, |
91 | - ]); |
|
91 | + ]); |
|
92 | 92 | |
93 | 93 | // Add block 'Schedule'. |
94 | 94 | bigbluebuttonbn_mform_add_block_schedule($mform, ['activity' => $currentactivity]); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $field['description_key'], $cfg['recordings_html_default']); |
255 | 255 | |
256 | 256 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted_activities', 'data_type' => PARAM_INT, |
257 | - 'description_key' => null]; |
|
257 | + 'description_key' => null]; |
|
258 | 258 | if ($cfg['recordings_deleted_activities_editable']) { |
259 | 259 | $field['type'] = 'checkbox'; |
260 | 260 | $field['description_key'] = 'mod_form_field_recordings_deleted_activities'; |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type', |
310 | 310 | $participantselection['type_selected'], array(), |
311 | 311 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
312 | - 'onchange' => 'M.mod_bigbluebuttonbn.mod_form_participant_selection_set(); return 0;')).' '. |
|
312 | + 'onchange' => 'M.mod_bigbluebuttonbn.mod_form_participant_selection_set(); return 0;')).' '. |
|
313 | 313 | html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
314 | 314 | $participantselection['selected'], array(), |
315 | 315 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).' '. |
@@ -354,9 +354,9 @@ discard block |
||
354 | 354 | $col2 = new html_table_cell(); |
355 | 355 | $options = [ |
356 | 356 | BIGBLUEBUTTONBN_ROLE_VIEWER => get_string('mod_form_field_participant_bbb_role_'. |
357 | - BIGBLUEBUTTONBN_ROLE_VIEWER, 'bigbluebuttonbn'), |
|
357 | + BIGBLUEBUTTONBN_ROLE_VIEWER, 'bigbluebuttonbn'), |
|
358 | 358 | BIGBLUEBUTTONBN_ROLE_MODERATOR => get_string('mod_form_field_participant_bbb_role_'. |
359 | - BIGBLUEBUTTONBN_ROLE_MODERATOR, 'bigbluebuttonbn'), |
|
359 | + BIGBLUEBUTTONBN_ROLE_MODERATOR, 'bigbluebuttonbn'), |
|
360 | 360 | ]; |
361 | 361 | $optionselected = $participant['role']; |
362 | 362 | $col2->text = html_writer::tag('i', ' '. |
@@ -365,8 +365,8 @@ discard block |
||
365 | 365 | 'participant_list_role_'.$participant['selectiontype'].'-'.$participant['selectionid'], |
366 | 366 | $optionselected, array(), |
367 | 367 | array('id' => 'participant_list_role_'.$participant['selectiontype'].'-'.$participant['selectionid'], |
368 | - 'onchange' => 'M.mod_bigbluebuttonbn.mod_form_participant_list_role_update(\''. |
|
369 | - $participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;', |
|
368 | + 'onchange' => 'M.mod_bigbluebuttonbn.mod_form_participant_list_role_update(\''. |
|
369 | + $participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;', |
|
370 | 370 | ) |
371 | 371 | ) |
372 | 372 | ); |
@@ -436,23 +436,23 @@ discard block |
||
436 | 436 | |
437 | 437 | public function bigbluebuttonbn_get_participant_selection_strings() { |
438 | 438 | return [ |
439 | - 'as' => get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn'), |
|
440 | - 'viewer' => get_string('mod_form_field_participant_bbb_role_viewer', 'bigbluebuttonbn'), |
|
441 | - 'moderator' => get_string('mod_form_field_participant_bbb_role_moderator', 'bigbluebuttonbn'), |
|
442 | - 'remove' => get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn'), |
|
439 | + 'as' => get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn'), |
|
440 | + 'viewer' => get_string('mod_form_field_participant_bbb_role_viewer', 'bigbluebuttonbn'), |
|
441 | + 'moderator' => get_string('mod_form_field_participant_bbb_role_moderator', 'bigbluebuttonbn'), |
|
442 | + 'remove' => get_string('mod_form_field_participant_list_action_remove', 'bigbluebuttonbn'), |
|
443 | 443 | ]; |
444 | 444 | } |
445 | 445 | |
446 | 446 | public function bigbluebuttonbn_get_participant_selection_data() { |
447 | 447 | return [ |
448 | - 'type_options' => [ |
|
449 | - 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
|
450 | - 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
|
451 | - 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
|
452 | - ], |
|
453 | - 'type_selected' => 'all', |
|
454 | - 'options' => ['all' => '---------------'], |
|
455 | - 'selected' => 'all', |
|
448 | + 'type_options' => [ |
|
449 | + 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
|
450 | + 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
|
451 | + 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
|
452 | + ], |
|
453 | + 'type_selected' => 'all', |
|
454 | + 'options' => ['all' => '---------------'], |
|
455 | + 'selected' => 'all', |
|
456 | 456 | ]; |
457 | 457 | } |
458 | 458 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | |
26 | 26 | defined('MOODLE_INTERNAL') || die(); |
27 | 27 | |
28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
29 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
29 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
30 | 30 | |
31 | 31 | class mod_bigbluebuttonbn_mod_form extends moodleform_mod |
32 | 32 | { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $serverversion = bigbluebuttonbn_get_server_version(); |
38 | 38 | if (is_null($serverversion)) { |
39 | 39 | print_error('general_error_unable_connect', 'bigbluebuttonbn', |
40 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
40 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $bigbluebuttonbn = null; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | $context = context_course::instance($course->id); |
55 | - $pixicondeleteurl = ''.$OUTPUT->pix_url('t/delete', 'moodle'); |
|
55 | + $pixicondeleteurl = '' . $OUTPUT->pix_url('t/delete', 'moodle'); |
|
56 | 56 | |
57 | 57 | // UI configuration options. |
58 | 58 | $cfg = bigbluebuttonbn_get_cfg_options(); |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | $jsvars['icons_enabled'] = $cfg['recording_icons_enabled']; |
103 | 103 | $jsvars['pix_icon_delete'] = $pixicondeleteurl; |
104 | 104 | $jsvars['strings'] = $strings; |
105 | - $jsvars['participant_selection'] = json_decode('{"all": [], "role": '. |
|
106 | - json_encode(bigbluebuttonbn_get_roles_select($roles)).', "user": '. |
|
107 | - json_encode(bigbluebuttonbn_get_users_select($users)).'}'); |
|
105 | + $jsvars['participant_selection'] = json_decode('{"all": [], "role": ' . |
|
106 | + json_encode(bigbluebuttonbn_get_roles_select($roles)) . ', "user": ' . |
|
107 | + json_encode(bigbluebuttonbn_get_users_select($users)) . '}'); |
|
108 | 108 | $jsvars['participant_list'] = $participantlist; |
109 | 109 | $PAGE->requires->data_for_js('bigbluebuttonbn', $jsvars); |
110 | 110 | $jsmodule = array( |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ); |
125 | 125 | $defaultvalues['presentation'] = $draftitemid; |
126 | 126 | } catch (Exception $e) { |
127 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
127 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
128 | 128 | return null; |
129 | 129 | } |
130 | 130 | } |
@@ -309,12 +309,12 @@ discard block |
||
309 | 309 | html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type', |
310 | 310 | $participantselection['type_selected'], array(), |
311 | 311 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
312 | - 'onchange' => 'M.mod_bigbluebuttonbn.mod_form_participant_selection_set(); return 0;')).' '. |
|
312 | + 'onchange' => 'M.mod_bigbluebuttonbn.mod_form_participant_selection_set(); return 0;')) . ' ' . |
|
313 | 313 | html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
314 | 314 | $participantselection['selected'], array(), |
315 | - array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).' '. |
|
316 | - '<input value="'.get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'). |
|
317 | - '" class="btn btn-secondary" type="button" id="id_addselectionid" '. |
|
315 | + array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')) . ' ' . |
|
316 | + '<input value="' . get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn') . |
|
317 | + '" class="btn btn-secondary" type="button" id="id_addselectionid" ' . |
|
318 | 318 | 'onclick="M.mod_bigbluebuttonbn.mod_form_participant_add(); return 0;" />' |
319 | 319 | ); |
320 | 320 | |
@@ -341,11 +341,11 @@ discard block |
||
341 | 341 | } |
342 | 342 | } |
343 | 343 | } |
344 | - $selectiontype = '<b><i>'. |
|
345 | - get_string('mod_form_field_participant_list_type_'.$selectiontype, 'bigbluebuttonbn').'</i></b>'; |
|
344 | + $selectiontype = '<b><i>' . |
|
345 | + get_string('mod_form_field_participant_list_type_' . $selectiontype, 'bigbluebuttonbn') . '</i></b>'; |
|
346 | 346 | |
347 | 347 | $row = new html_table_row(); |
348 | - $row->id = 'participant_list_tr_'.$participant['selectiontype'].'-'.$participant['selectionid']; |
|
348 | + $row->id = 'participant_list_tr_' . $participant['selectiontype'] . '-' . $participant['selectionid']; |
|
349 | 349 | |
350 | 350 | $col0 = new html_table_cell(); |
351 | 351 | $col0->text = $selectiontype; |
@@ -353,26 +353,26 @@ discard block |
||
353 | 353 | $col1->text = $selectionid; |
354 | 354 | $col2 = new html_table_cell(); |
355 | 355 | $options = [ |
356 | - BIGBLUEBUTTONBN_ROLE_VIEWER => get_string('mod_form_field_participant_bbb_role_'. |
|
356 | + BIGBLUEBUTTONBN_ROLE_VIEWER => get_string('mod_form_field_participant_bbb_role_' . |
|
357 | 357 | BIGBLUEBUTTONBN_ROLE_VIEWER, 'bigbluebuttonbn'), |
358 | - BIGBLUEBUTTONBN_ROLE_MODERATOR => get_string('mod_form_field_participant_bbb_role_'. |
|
358 | + BIGBLUEBUTTONBN_ROLE_MODERATOR => get_string('mod_form_field_participant_bbb_role_' . |
|
359 | 359 | BIGBLUEBUTTONBN_ROLE_MODERATOR, 'bigbluebuttonbn'), |
360 | 360 | ]; |
361 | 361 | $optionselected = $participant['role']; |
362 | - $col2->text = html_writer::tag('i', ' '. |
|
363 | - get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn').' '. |
|
362 | + $col2->text = html_writer::tag('i', ' ' . |
|
363 | + get_string('mod_form_field_participant_list_text_as', 'bigbluebuttonbn') . ' ' . |
|
364 | 364 | html_writer::select($options, |
365 | - 'participant_list_role_'.$participant['selectiontype'].'-'.$participant['selectionid'], |
|
365 | + 'participant_list_role_' . $participant['selectiontype'] . '-' . $participant['selectionid'], |
|
366 | 366 | $optionselected, array(), |
367 | - array('id' => 'participant_list_role_'.$participant['selectiontype'].'-'.$participant['selectionid'], |
|
368 | - 'onchange' => 'M.mod_bigbluebuttonbn.mod_form_participant_list_role_update(\''. |
|
369 | - $participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;', |
|
367 | + array('id' => 'participant_list_role_' . $participant['selectiontype'] . '-' . $participant['selectionid'], |
|
368 | + 'onchange' => 'M.mod_bigbluebuttonbn.mod_form_participant_list_role_update(\'' . |
|
369 | + $participant['selectiontype'] . '\', \'' . $participant['selectionid'] . '\'); return 0;', |
|
370 | 370 | ) |
371 | 371 | ) |
372 | 372 | ); |
373 | 373 | $col3 = new html_table_cell(); |
374 | - $onclick = 'M.mod_bigbluebuttonbn.mod_form_participant_remove(\''. |
|
375 | - $participant['selectiontype'].'\', \''.$participant['selectionid'].'\'); return 0;'; |
|
374 | + $onclick = 'M.mod_bigbluebuttonbn.mod_form_participant_remove(\'' . |
|
375 | + $participant['selectiontype'] . '\', \'' . $participant['selectionid'] . '\'); return 0;'; |
|
376 | 376 | // With text for delete. |
377 | 377 | $col3->text = html_writer::tag('a', '<b>x</b>', ['class' => 'btn action_icon', |
378 | 378 | 'onclick' => $onclick, 'title' => $data['strings']['remove'], ]); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | // Render elements for participant list. |
394 | 394 | $htmlparticipantlist = html_writer::tag('div', |
395 | 395 | html_writer::label(get_string('mod_form_field_participant_list', 'bigbluebuttonbn'), |
396 | - 'bigbluebuttonbn_participant_list'). |
|
396 | + 'bigbluebuttonbn_participant_list') . |
|
397 | 397 | html_writer::table($table) |
398 | 398 | ); |
399 | 399 |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | 'bbb-recording-name' => $bbbrecordingname, |
117 | 117 | 'bbb-recording-description' => $bbbrecordingdescription, |
118 | 118 | 'bbb-recording-tags' => $bbbrecordingtags, |
119 | - ); |
|
119 | + ); |
|
120 | 120 | |
121 | 121 | if (bigbluebuttonbn_server_offers_bn_capabilities()) { |
122 | 122 | if (bigbluebuttonbn_get_cfg_recordingready_enabled()) { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $metadata, |
153 | 153 | $bbbsession['presentation']['name'], |
154 | 154 | $bbbsession['presentation']['url'] |
155 | - ); |
|
155 | + ); |
|
156 | 156 | |
157 | 157 | if (!$response) { |
158 | 158 | // If the server is unreachable, then prompts the user of the necessary action. |
@@ -63,135 +63,135 @@ |
||
63 | 63 | $bbbsession = $SESSION->bigbluebuttonbn_bbbsession; |
64 | 64 | } |
65 | 65 | switch (strtolower($action)) { |
66 | - case 'logout': |
|
67 | - if (isset($errors) && $errors != '') { |
|
68 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
69 | - } else if (isset($bbbsession) && !is_null($bbbsession)) { |
|
70 | - // Moodle event logger: Create an event for meeting left. |
|
71 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
72 | - |
|
73 | - // Update the cache. |
|
74 | - $meetinginfo = bigbluebuttonbn_get_meetinginfo($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
75 | - |
|
76 | - // Close the tab or window where BBB was opened. |
|
77 | - bigbluebutton_bbb_view_close_window(); |
|
78 | - } else { |
|
79 | - bigbluebutton_bbb_view_close_window_manually(); |
|
80 | - } |
|
81 | - break; |
|
82 | - case 'join': |
|
83 | - if (isset($bbbsession) && !is_null($bbbsession)) { |
|
84 | - // See if the session is in progress. |
|
85 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
86 | - // Since the meeting is already running, we just join the session. |
|
87 | - bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $bigbluebuttonbn); |
|
88 | - break; |
|
89 | - } |
|
90 | - |
|
91 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
92 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
93 | - header('Location: '.$bbbsession['logoutURL']); |
|
94 | - break; |
|
95 | - } |
|
96 | - |
|
97 | - // Prepare the metadata. |
|
98 | - $bbbrecordingname = $bbbsession['contextActivityName']; |
|
99 | - if (isset($name) && $name != '') { |
|
100 | - $bbbrecordingname = $name; |
|
66 | + case 'logout': |
|
67 | + if (isset($errors) && $errors != '') { |
|
68 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
69 | + } else if (isset($bbbsession) && !is_null($bbbsession)) { |
|
70 | + // Moodle event logger: Create an event for meeting left. |
|
71 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
72 | + |
|
73 | + // Update the cache. |
|
74 | + $meetinginfo = bigbluebuttonbn_get_meetinginfo($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
75 | + |
|
76 | + // Close the tab or window where BBB was opened. |
|
77 | + bigbluebutton_bbb_view_close_window(); |
|
78 | + } else { |
|
79 | + bigbluebutton_bbb_view_close_window_manually(); |
|
101 | 80 | } |
102 | - $bbbrecordingdescription = $bbbsession['contextActivityDescription']; |
|
103 | - if (isset($description) && $description != '') { |
|
104 | - $bbbrecordingdescription = $description; |
|
105 | - } |
|
106 | - $bbbrecordingtags = $bbbsession['contextActivityTags']; |
|
107 | - if (isset($tags) && $tags != '') { |
|
108 | - $bbbrecordingtags = $tags; |
|
109 | - } |
|
110 | - $metadata = array('bbb-origin' => $bbbsession['origin'], |
|
111 | - 'bbb-origin-version' => $bbbsession['originVersion'], |
|
112 | - 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
113 | - 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
114 | - 'bbb-origin-tag' => $bbbsession['originTag'], |
|
115 | - 'bbb-context' => $bbbsession['course']->fullname, |
|
116 | - 'bbb-recording-name' => $bbbrecordingname, |
|
117 | - 'bbb-recording-description' => $bbbrecordingdescription, |
|
118 | - 'bbb-recording-tags' => $bbbrecordingtags, |
|
119 | - ); |
|
120 | - |
|
121 | - if (bigbluebuttonbn_server_offers_bn_capabilities()) { |
|
122 | - if (bigbluebuttonbn_get_cfg_recordingready_enabled()) { |
|
123 | - $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL']; |
|
81 | + break; |
|
82 | + case 'join': |
|
83 | + if (isset($bbbsession) && !is_null($bbbsession)) { |
|
84 | + // See if the session is in progress. |
|
85 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
86 | + // Since the meeting is already running, we just join the session. |
|
87 | + bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $bigbluebuttonbn); |
|
88 | + break; |
|
124 | 89 | } |
125 | 90 | |
126 | - if (bigbluebuttonbn_get_cfg_meetingevents_enabled()) { |
|
127 | - $metadata['bn-meeting-events-url'] = $bbbsession['meetingEventsURL']; |
|
91 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
92 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
93 | + header('Location: '.$bbbsession['logoutURL']); |
|
94 | + break; |
|
128 | 95 | } |
129 | - } |
|
130 | 96 | |
131 | - // Set the duration for the meeting. |
|
132 | - $durationtime = 0; |
|
133 | - if (bigbluebuttonbn_get_cfg_scheduled_duration_enabled()) { |
|
134 | - $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->closingtime); |
|
135 | - if ($durationtime > 0) { |
|
136 | - $bbbsession['welcome'] .= '<br><br>'.str_replace('%duration%', ''.$durationtime, |
|
137 | - get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
97 | + // Prepare the metadata. |
|
98 | + $bbbrecordingname = $bbbsession['contextActivityName']; |
|
99 | + if (isset($name) && $name != '') { |
|
100 | + $bbbrecordingname = $name; |
|
138 | 101 | } |
139 | - } |
|
140 | - // Execute the create command. |
|
141 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
142 | - $bbbsession['meetingname'], |
|
143 | - $bbbsession['meetingid'], |
|
144 | - $bbbsession['welcome'], |
|
145 | - $bbbsession['modPW'], |
|
146 | - $bbbsession['viewerPW'], |
|
147 | - $bbbsession['logoutURL'], |
|
148 | - $bbbsession['record'] ? 'true' : 'false', |
|
149 | - $durationtime, |
|
150 | - $bbbsession['voicebridge'], |
|
151 | - $bbbsession['userlimit'], |
|
152 | - $metadata, |
|
153 | - $bbbsession['presentation']['name'], |
|
154 | - $bbbsession['presentation']['url'] |
|
102 | + $bbbrecordingdescription = $bbbsession['contextActivityDescription']; |
|
103 | + if (isset($description) && $description != '') { |
|
104 | + $bbbrecordingdescription = $description; |
|
105 | + } |
|
106 | + $bbbrecordingtags = $bbbsession['contextActivityTags']; |
|
107 | + if (isset($tags) && $tags != '') { |
|
108 | + $bbbrecordingtags = $tags; |
|
109 | + } |
|
110 | + $metadata = array('bbb-origin' => $bbbsession['origin'], |
|
111 | + 'bbb-origin-version' => $bbbsession['originVersion'], |
|
112 | + 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
113 | + 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
114 | + 'bbb-origin-tag' => $bbbsession['originTag'], |
|
115 | + 'bbb-context' => $bbbsession['course']->fullname, |
|
116 | + 'bbb-recording-name' => $bbbrecordingname, |
|
117 | + 'bbb-recording-description' => $bbbrecordingdescription, |
|
118 | + 'bbb-recording-tags' => $bbbrecordingtags, |
|
155 | 119 | ); |
156 | 120 | |
157 | - if (!$response) { |
|
158 | - // If the server is unreachable, then prompts the user of the necessary action. |
|
159 | - $printerrorkey = 'view_error_unable_join_student'; |
|
160 | - if ($bbbsession['administrator']) { |
|
161 | - $printerrorkey = 'view_error_unable_join'; |
|
121 | + if (bigbluebuttonbn_server_offers_bn_capabilities()) { |
|
122 | + if (bigbluebuttonbn_get_cfg_recordingready_enabled()) { |
|
123 | + $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL']; |
|
124 | + } |
|
125 | + |
|
126 | + if (bigbluebuttonbn_get_cfg_meetingevents_enabled()) { |
|
127 | + $metadata['bn-meeting-events-url'] = $bbbsession['meetingEventsURL']; |
|
128 | + } |
|
162 | 129 | } |
163 | - if ($bbbsession['moderator']) { |
|
164 | - $printerrorkey = 'view_error_unable_join_teacher'; |
|
130 | + |
|
131 | + // Set the duration for the meeting. |
|
132 | + $durationtime = 0; |
|
133 | + if (bigbluebuttonbn_get_cfg_scheduled_duration_enabled()) { |
|
134 | + $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->closingtime); |
|
135 | + if ($durationtime > 0) { |
|
136 | + $bbbsession['welcome'] .= '<br><br>'.str_replace('%duration%', ''.$durationtime, |
|
137 | + get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
|
138 | + } |
|
165 | 139 | } |
166 | - print_error($printerrorkey, 'bigbluebuttonbn', |
|
167 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
168 | - break; |
|
169 | - } else if ($response['returncode'] == 'FAILED') { |
|
170 | - // The meeting was not created. |
|
171 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
172 | - if (!$printerrorkey) { |
|
173 | - $printerrorkey = $response['message']; |
|
140 | + // Execute the create command. |
|
141 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
142 | + $bbbsession['meetingname'], |
|
143 | + $bbbsession['meetingid'], |
|
144 | + $bbbsession['welcome'], |
|
145 | + $bbbsession['modPW'], |
|
146 | + $bbbsession['viewerPW'], |
|
147 | + $bbbsession['logoutURL'], |
|
148 | + $bbbsession['record'] ? 'true' : 'false', |
|
149 | + $durationtime, |
|
150 | + $bbbsession['voicebridge'], |
|
151 | + $bbbsession['userlimit'], |
|
152 | + $metadata, |
|
153 | + $bbbsession['presentation']['name'], |
|
154 | + $bbbsession['presentation']['url'] |
|
155 | + ); |
|
156 | + |
|
157 | + if (!$response) { |
|
158 | + // If the server is unreachable, then prompts the user of the necessary action. |
|
159 | + $printerrorkey = 'view_error_unable_join_student'; |
|
160 | + if ($bbbsession['administrator']) { |
|
161 | + $printerrorkey = 'view_error_unable_join'; |
|
162 | + } |
|
163 | + if ($bbbsession['moderator']) { |
|
164 | + $printerrorkey = 'view_error_unable_join_teacher'; |
|
165 | + } |
|
166 | + print_error($printerrorkey, 'bigbluebuttonbn', |
|
167 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
168 | + break; |
|
169 | + } else if ($response['returncode'] == 'FAILED') { |
|
170 | + // The meeting was not created. |
|
171 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
172 | + if (!$printerrorkey) { |
|
173 | + $printerrorkey = $response['message']; |
|
174 | + } |
|
175 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
176 | + break; |
|
177 | + } else if ($response['hasBeenForciblyEnded'] == 'true') { |
|
178 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
179 | + break; |
|
174 | 180 | } |
175 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
176 | - break; |
|
177 | - } else if ($response['hasBeenForciblyEnded'] == 'true') { |
|
178 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
181 | + |
|
182 | + // Moodle event logger: Create an event for meeting created. |
|
183 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
184 | + // Internal logger: Insert a record with the meeting created. |
|
185 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
186 | + // Since the meeting is already running, we just join the session. |
|
187 | + bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $bigbluebuttonbn); |
|
179 | 188 | break; |
180 | 189 | } |
181 | 190 | |
182 | - // Moodle event logger: Create an event for meeting created. |
|
183 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
184 | - // Internal logger: Insert a record with the meeting created. |
|
185 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
186 | - // Since the meeting is already running, we just join the session. |
|
187 | - bigbluebutton_bbb_view_execute_join($bbbsession, $cm, $bigbluebuttonbn); |
|
191 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
188 | 192 | break; |
189 | - } |
|
190 | - |
|
191 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
192 | - break; |
|
193 | - default: |
|
194 | - bigbluebutton_bbb_view_close_window(); |
|
193 | + default: |
|
194 | + bigbluebutton_bbb_view_close_window(); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | function bigbluebutton_bbb_view_close_window() { |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | defined('MOODLE_INTERNAL') || die(); |
26 | 26 | |
27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
29 | 29 | |
30 | 30 | $id = optional_param('id', 0, PARAM_INT); |
31 | 31 | $bn = optional_param('bn', 0, PARAM_INT); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
92 | 92 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
93 | - header('Location: '.$bbbsession['logoutURL']); |
|
93 | + header('Location: ' . $bbbsession['logoutURL']); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | if (bigbluebuttonbn_get_cfg_scheduled_duration_enabled()) { |
134 | 134 | $durationtime = bigbluebuttonbn_get_duration($bigbluebuttonbn->closingtime); |
135 | 135 | if ($durationtime > 0) { |
136 | - $bbbsession['welcome'] .= '<br><br>'.str_replace('%duration%', ''.$durationtime, |
|
136 | + $bbbsession['welcome'] .= '<br><br>' . str_replace('%duration%', '' . $durationtime, |
|
137 | 137 | get_string('bbbdurationwarning', 'bigbluebuttonbn')); |
138 | 138 | } |
139 | 139 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $printerrorkey = 'view_error_unable_join_teacher'; |
165 | 165 | } |
166 | 166 | print_error($printerrorkey, 'bigbluebuttonbn', |
167 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
167 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
168 | 168 | break; |
169 | 169 | } else if ($response['returncode'] == 'FAILED') { |
170 | 170 | // The meeting was not created. |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
214 | 214 | // No more users allowed to join. |
215 | - header('Location: '.$bbbsession['logoutURL']); |
|
215 | + header('Location: ' . $bbbsession['logoutURL']); |
|
216 | 216 | |
217 | 217 | return; |
218 | 218 | } |
@@ -232,20 +232,20 @@ discard block |
||
232 | 232 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
233 | 233 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
234 | 234 | // Execute the redirect. |
235 | - header('Location: '.$joinurl); |
|
235 | + header('Location: ' . $joinurl); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
239 | 239 | global $CFG, $OUTPUT; |
240 | 240 | |
241 | - $errors = (array) json_decode(urldecode($serrors)); |
|
241 | + $errors = (array)json_decode(urldecode($serrors)); |
|
242 | 242 | $msgerrors = ''; |
243 | 243 | foreach ($errors as $error) { |
244 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
244 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | echo $OUTPUT->header(); |
248 | 248 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
249 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
249 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
250 | 250 | echo $OUTPUT->footer(); |
251 | 251 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $output .= html_writer::start_tag('br'); |
96 | 96 | $output .= html_writer::tag('input', '', |
97 | 97 | array('type' => 'button', 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
98 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
98 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
99 | 99 | |
100 | 100 | $jsvars = array( |
101 | 101 | 'bn' => $bn, |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | defined('MOODLE_INTERNAL') || die(); |
26 | 26 | |
27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
29 | 29 | |
30 | 30 | $bn = required_param('bn', PARAM_INT); |
31 | 31 | $tc = optional_param('tc', 0, PARAM_INT); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $output .= html_writer::start_tag('br'); |
96 | 96 | $output .= html_writer::tag('input', '', |
97 | 97 | array('type' => 'button', 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
98 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
98 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $cm->id . '\'')); |
|
99 | 99 | |
100 | 100 | $jsvars = array( |
101 | 101 | 'bn' => $bn, |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | global $CFG; |
29 | 29 | |
30 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
30 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
31 | 31 | |
32 | 32 | if ($ADMIN->fulltree) { |
33 | 33 | if (!isset($CFG->bigbluebuttonbn['server_url']) || |
@@ -258,8 +258,8 @@ discard block |
||
258 | 258 | } else { |
259 | 259 | $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation', |
260 | 260 | get_string('config_feature_preuploadpresentation', 'bigbluebuttonbn'), |
261 | - get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn').'<br><br>'. |
|
262 | - '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>' |
|
261 | + get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn') . '<br><br>' . |
|
262 | + '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>' |
|
263 | 263 | )); |
264 | 264 | } |
265 | 265 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * can be used to identify the recording in the list of recordings. |
96 | 96 | **/ |
97 | 97 | |
98 | - /* |
|
98 | + /* |
|
99 | 99 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
100 | 100 | * activities will have the 'recording tagging' capability enabled by |
101 | 101 | * default. |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * recordings from a different activity even from a different course. |
120 | 120 | **/ |
121 | 121 | |
122 | - /* |
|
122 | + /* |
|
123 | 123 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
124 | 124 | * activities will have the 'import recordings' capability enabled. |
125 | 125 | */ |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * 'Join session' button enabled |
141 | 141 | **/ |
142 | 142 | |
143 | - /* |
|
143 | + /* |
|
144 | 144 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
145 | 145 | * activities will have the 'wait for moderator' capability enabled by |
146 | 146 | * default. |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * 6. CONFIGURATION FOR "STATIC VOICE BRIDGE" FEATURE |
175 | 175 | * |
176 | 176 | **/ |
177 | - /* |
|
177 | + /* |
|
178 | 178 | * A conference voice bridge number can be permanently assigned to a room |
179 | 179 | * or activity. |
180 | 180 | */ |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * 7. CONFIGURATION FOR "PRE-UPLOAD PRESENTATION" FEATURE |
185 | 185 | * |
186 | 186 | **/ |
187 | - /* |
|
187 | + /* |
|
188 | 188 | * Since version 0.8, BigBluebutton has an implementation for allowing |
189 | 189 | * preuploading presentation. When this feature is enabled, users creating or |
190 | 190 | * editing a room or activity can upload a PDF or Office document to the |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * applied to each room or activity, or globally. |
202 | 202 | **/ |
203 | 203 | |
204 | - /* |
|
204 | + /* |
|
205 | 205 | * The number of users allowed in a session by default when a new room or |
206 | 206 | * conference is added. If the number is set to 0, no limit is established. |
207 | 207 | * $CFG->bigbluebuttonbn['userlimit_default'] = 0; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * By default only the owner is assigned. |
223 | 223 | **/ |
224 | 224 | |
225 | - /* |
|
225 | + /* |
|
226 | 226 | * The values for this parameter can be 'owner' and/or any of the roles defined in |
227 | 227 | * Moodle (including the custom parameters). The value used will be the key for the role. |
228 | 228 | * [owner|manager|coursecreator|editingteacher|teacher|student|guest|user|frontpage|ANY_CUSTOM_ROLE] |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * 10. CONFIGURATION FOR "NOTIFICATION SENDING" FEATURE |
234 | 234 | * |
235 | 235 | **/ |
236 | - /* |
|
236 | + /* |
|
237 | 237 | * When the value is set to 1 (checked) the 'notification sending' |
238 | 238 | * capability can be used by the user creating or editing the room or |
239 | 239 | * activity. |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * 11. CONFIGURATION FOR "RECORDING READY" FEATURE |
248 | 248 | * |
249 | 249 | **/ |
250 | - /* |
|
250 | + /* |
|
251 | 251 | * When the value is set to 1 (checked) the 'notify users when recording ready' |
252 | 252 | * capability is enabled, meaning that a message will be sent to all enrolled |
253 | 253 | * users in a course when a recording is ready |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | * 13. GENERAL CONFIGURATION FOR RECORDINGS UI |
271 | 271 | * |
272 | 272 | **/ |
273 | - /* |
|
273 | + /* |
|
274 | 274 | * When the value is set to 1 (checked) the bigbluebuttonbn resources |
275 | 275 | * will show the recodings in an html table by default. |
276 | 276 | * $CFG->bigbluebuttonbn['recordings_html_default'] = 0; |