@@ -181,6 +181,9 @@ discard block |
||
181 | 181 | return "{$params['callback']}({$callbackresponsedata});"; |
182 | 182 | } |
183 | 183 | |
184 | +/** |
|
185 | + * @param boolean $running |
|
186 | + */ |
|
184 | 187 | function bigbluebuttonbn_broker_meeting_info_can_join($bbbsession, $running, $participantcount) { |
185 | 188 | $status = array("can_join" => false); |
186 | 189 | if ($running) { |
@@ -201,6 +204,9 @@ discard block |
||
201 | 204 | return $status; |
202 | 205 | } |
203 | 206 | |
207 | +/** |
|
208 | + * @param boolean $running |
|
209 | + */ |
|
204 | 210 | function bigbluebuttonbn_broker_meeting_info_can_end($bbbsession, $running) { |
205 | 211 | if ($running && ($bbbsession['administrator'] || $bbbsession['moderator'])) { |
206 | 212 | return array("can_end" => true); |
@@ -337,6 +343,9 @@ discard block |
||
337 | 343 | return "{$params['callback']}({$callbackresponsedata});"; |
338 | 344 | } |
339 | 345 | |
346 | +/** |
|
347 | + * @param string $action |
|
348 | + */ |
|
340 | 349 | function bigbluebuttonbn_broker_recording_action_perform($action, $params, $recordings) { |
341 | 350 | if ($action == 'recording_publish') { |
342 | 351 | return bigbluebuttonbn_broker_recording_action_publish($params, $recordings); |
@@ -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 | |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | return; |
140 | 140 | } |
141 | 141 | |
142 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
142 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
143 | 143 | return; |
144 | 144 | |
145 | 145 | } catch (Exception $e) { |
146 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
146 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
147 | 147 | return; |
148 | 148 | } |
149 | 149 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
284 | 284 | $callbackresponse['status'] = true; |
285 | 285 | $callbackresponse['found'] = true; |
286 | - $callbackresponse['published'] = (string) $recording['published']; |
|
286 | + $callbackresponse['published'] = (string)$recording['published']; |
|
287 | 287 | if (!isset($params['meta']) || empty($params['meta'])) { |
288 | 288 | return $callbackresponse; |
289 | 289 | } |
@@ -545,8 +545,8 @@ discard block |
||
545 | 545 | $decodedparameters = JWT::decode($params['signed_parameters'], (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'), |
546 | 546 | array('HS256')); |
547 | 547 | } catch (Exception $e) { |
548 | - $error = 'Caught exception: '.$e->getMessage(); |
|
549 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
548 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
549 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
550 | 550 | return; |
551 | 551 | } |
552 | 552 | |
@@ -564,8 +564,8 @@ discard block |
||
564 | 564 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
565 | 565 | header('HTTP/1.0 202 Accepted'); |
566 | 566 | } catch (Exception $e) { |
567 | - $error = 'Caught exception: '.$e->getMessage(); |
|
568 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
567 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
568 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
569 | 569 | } |
570 | 570 | } |
571 | 571 | |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
581 | 581 | if (!isset($importrecordings[$params['id']])) { |
582 | 582 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
583 | - header('HTTP/1.0 404 Not found. '.$error); |
|
583 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
584 | 584 | return; |
585 | 585 | } |
586 | 586 | |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | |
589 | 589 | $importrecordings[$params['id']]['imported'] = true; |
590 | 590 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
591 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
591 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
592 | 592 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
593 | 593 | // Moodle event logger: Create an event for recording imported. |
594 | 594 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -606,8 +606,8 @@ discard block |
||
606 | 606 | $decodedparameters = JWT::decode($params['signed_parameters'], (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'), |
607 | 607 | array('HS256')); |
608 | 608 | } catch (Exception $e) { |
609 | - $error = 'Caught exception: '.$e->getMessage(); |
|
610 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
609 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
610 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
611 | 611 | return; |
612 | 612 | } |
613 | 613 | |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | |
646 | 646 | $action = strtolower($params['action']); |
647 | 647 | if (!array_key_exists($action, $requiredparams)) { |
648 | - return 'Action '.$params['action'].' can not be performed.'; |
|
648 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
649 | 649 | } |
650 | 650 | |
651 | 651 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | */ |
95 | 95 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
96 | 96 | $data = ['meetingID' => $meetingid, |
97 | - 'fullName' => $username, |
|
98 | - 'password' => $pw, |
|
99 | - 'logoutURL' => $logouturl, |
|
97 | + 'fullName' => $username, |
|
98 | + 'password' => $pw, |
|
99 | + 'logoutURL' => $logouturl, |
|
100 | 100 | ]; |
101 | 101 | if (!is_null($configtoken)) { |
102 | 102 | $data['configToken'] = $configtoken; |
@@ -177,23 +177,23 @@ discard block |
||
177 | 177 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
178 | 178 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
179 | 179 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
180 | - ); |
|
180 | + ); |
|
181 | 181 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
182 | 182 | // Meeting info was returned. |
183 | 183 | return array('returncode' => $xml->returncode, |
184 | - 'meetingID' => $xml->meetingID, |
|
185 | - 'moderatorPW' => $xml->moderatorPW, |
|
186 | - 'attendeePW' => $xml->attendeePW, |
|
187 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
188 | - 'running' => $xml->running, |
|
189 | - 'recording' => $xml->recording, |
|
190 | - 'startTime' => $xml->startTime, |
|
191 | - 'endTime' => $xml->endTime, |
|
192 | - 'participantCount' => $xml->participantCount, |
|
193 | - 'moderatorCount' => $xml->moderatorCount, |
|
194 | - 'attendees' => $xml->attendees, |
|
195 | - 'metadata' => $xml->metadata, |
|
196 | - ); |
|
184 | + 'meetingID' => $xml->meetingID, |
|
185 | + 'moderatorPW' => $xml->moderatorPW, |
|
186 | + 'attendeePW' => $xml->attendeePW, |
|
187 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
188 | + 'running' => $xml->running, |
|
189 | + 'recording' => $xml->recording, |
|
190 | + 'startTime' => $xml->startTime, |
|
191 | + 'endTime' => $xml->endTime, |
|
192 | + 'participantCount' => $xml->participantCount, |
|
193 | + 'moderatorCount' => $xml->moderatorCount, |
|
194 | + 'attendees' => $xml->attendees, |
|
195 | + 'metadata' => $xml->metadata, |
|
196 | + ); |
|
197 | 197 | } |
198 | 198 | if ($xml) { |
199 | 199 | // Either failure or success without meeting info. |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | // Do getRecordings is executed using a method GET (supported by all versions of BBB). |
250 | 250 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
251 | 251 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getRecordings', ['meetingID' => implode(',', $mids)]) |
252 | - ); |
|
252 | + ); |
|
253 | 253 | if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { |
254 | 254 | // If there were meetings already created. |
255 | 255 | foreach ($xml->recordings->recording as $recording) { |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | function bigbluebuttonbn_get_default_config_xml() { |
310 | 310 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
311 | 311 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
312 | - ); |
|
312 | + ); |
|
313 | 313 | return $xml; |
314 | 314 | } |
315 | 315 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | foreach ($ids as $id) { |
379 | 379 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
380 | 380 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
381 | - ); |
|
381 | + ); |
|
382 | 382 | if ($xml && $xml->returncode != 'SUCCESS') { |
383 | 383 | return false; |
384 | 384 | } |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | foreach ($ids as $id) { |
396 | 396 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
397 | 397 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
398 | - ); |
|
398 | + ); |
|
399 | 399 | if ($xml && $xml->returncode != 'SUCCESS') { |
400 | 400 | return false; |
401 | 401 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | foreach ($ids as $id) { |
413 | 413 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
414 | 414 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
415 | - ); |
|
415 | + ); |
|
416 | 416 | if ($xml && $xml->returncode != 'SUCCESS') { |
417 | 417 | return false; |
418 | 418 | } |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
428 | 428 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
429 | 429 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
430 | - ); |
|
430 | + ); |
|
431 | 431 | if ($xml) { |
432 | 432 | // If the xml packet returned failure it displays the message to the user. |
433 | 433 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | function bigbluebuttonbn_is_meeting_running($meetingid) { |
443 | 443 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
444 | 444 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('isMeetingRunning', ['meetingID' => $meetingid]) |
445 | - ); |
|
445 | + ); |
|
446 | 446 | if ($xml && $xml->returncode == 'SUCCESS') { |
447 | 447 | return ($xml->running == 'true'); |
448 | 448 | } |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | function bigbluebuttonbn_get_server_version() { |
453 | 453 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
454 | 454 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
455 | - ); |
|
455 | + ); |
|
456 | 456 | if ($xml && $xml->returncode == 'SUCCESS') { |
457 | 457 | return $xml->version; |
458 | 458 | } |
@@ -507,10 +507,10 @@ discard block |
||
507 | 507 | |
508 | 508 | $options = array(); |
509 | 509 | $options['CURLOPT_HTTPHEADER'] = array( |
510 | - 'Content-Type: '.$contenttype, |
|
511 | - 'Content-Length: '.strlen($data), |
|
512 | - 'Content-Language: en-US', |
|
513 | - ); |
|
510 | + 'Content-Type: '.$contenttype, |
|
511 | + 'Content-Length: '.strlen($data), |
|
512 | + 'Content-Language: en-US', |
|
513 | + ); |
|
514 | 514 | |
515 | 515 | return $c->post($url, $data, $options); |
516 | 516 | } |
@@ -581,13 +581,13 @@ discard block |
||
581 | 581 | |
582 | 582 | function bigbluebuttonbn_role_unknown() { |
583 | 583 | return array( |
584 | - "id" => "0", |
|
585 | - "name" => "", |
|
586 | - "shortname" => "unknown", |
|
587 | - "description" => "", |
|
588 | - "sortorder" => "0", |
|
589 | - "archetype" => "guest", |
|
590 | - "localname" => "Unknown" |
|
584 | + "id" => "0", |
|
585 | + "name" => "", |
|
586 | + "shortname" => "unknown", |
|
587 | + "description" => "", |
|
588 | + "sortorder" => "0", |
|
589 | + "archetype" => "guest", |
|
590 | + "localname" => "Unknown" |
|
591 | 591 | ); |
592 | 592 | } |
593 | 593 | |
@@ -596,16 +596,16 @@ discard block |
||
596 | 596 | 'all' => array( |
597 | 597 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
598 | 598 | 'children' => [] |
599 | - ) |
|
600 | - ); |
|
599 | + ) |
|
600 | + ); |
|
601 | 601 | $data['role'] = array( |
602 | 602 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
603 | 603 | 'children' => bigbluebuttonbn_get_roles_select($context) |
604 | - ); |
|
604 | + ); |
|
605 | 605 | $data['user'] = array( |
606 | 606 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
607 | 607 | 'children' => bigbluebuttonbn_get_users_select($context) |
608 | - ); |
|
608 | + ); |
|
609 | 609 | return $data; |
610 | 610 | } |
611 | 611 | |
@@ -635,9 +635,9 @@ discard block |
||
635 | 635 | continue; |
636 | 636 | } |
637 | 637 | $participantlistarray[] = array( |
638 | - 'selectiontype' => 'role', |
|
639 | - 'selectionid' => $moderatordefault, |
|
640 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
638 | + 'selectiontype' => 'role', |
|
639 | + 'selectionid' => $moderatordefault, |
|
640 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
641 | 641 | } |
642 | 642 | return $participantlistarray; |
643 | 643 | } |
@@ -668,11 +668,11 @@ discard block |
||
668 | 668 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
669 | 669 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
670 | 670 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
671 | - ], |
|
671 | + ], |
|
672 | 672 | 'type_selected' => 'all', |
673 | 673 | 'options' => ['all' => '---------------'], |
674 | 674 | 'selected' => 'all', |
675 | - ]; |
|
675 | + ]; |
|
676 | 676 | } |
677 | 677 | |
678 | 678 | function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) { |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | $eventproperties['other'] = $options['other']; |
863 | 863 | } |
864 | 864 | $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
865 | - array($eventproperties)); |
|
865 | + array($eventproperties)); |
|
866 | 866 | $event->trigger(); |
867 | 867 | } |
868 | 868 | |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | // Ping again and refresh the cache. |
908 | 908 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
909 | 909 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
910 | - ); |
|
910 | + ); |
|
911 | 911 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
912 | 912 | return $meetinginfo; |
913 | 913 | } |
@@ -1143,8 +1143,8 @@ discard block |
||
1143 | 1143 | } |
1144 | 1144 | $id = 'playbacks-'.$recording['recordID']; |
1145 | 1145 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1146 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1147 | - 'title' => $title, $visibility => $visibility)); |
|
1146 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1147 | + 'title' => $title, $visibility => $visibility)); |
|
1148 | 1148 | foreach ($recording['playbacks'] as $playback) { |
1149 | 1149 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1150 | 1150 | $playback).' '; |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1159 | 1159 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);'; |
1160 | 1160 | $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
1161 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1161 | + '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1162 | 1162 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1163 | 1163 | $href .= '&href='.urlencode(trim($playback['url'])); |
1164 | 1164 | } |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | 'data-target' => $playback['type'], |
1171 | 1171 | 'data-href' => $href, |
1172 | 1172 | 'class' => 'btn btn-sm btn-default' |
1173 | - ); |
|
1173 | + ); |
|
1174 | 1174 | return $OUTPUT->action_link('#', $title, null, $linkattributes); |
1175 | 1175 | } |
1176 | 1176 | |
@@ -1254,7 +1254,7 @@ discard block |
||
1254 | 1254 | 'onclick' => $onclick, |
1255 | 1255 | 'data-action' => $data['action'], |
1256 | 1256 | 'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID']) |
1257 | - ); |
|
1257 | + ); |
|
1258 | 1258 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
1259 | 1259 | } |
1260 | 1260 | // With text for $manageaction. |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail, |
1360 | 1360 | $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail, |
1361 | 1361 | $rowdata->duration_formatted |
1362 | - ); |
|
1362 | + ); |
|
1363 | 1363 | if ($bbbsession['managerecordings']) { |
1364 | 1364 | $row->cells[] = $rowdata->actionbar; |
1365 | 1365 | } |
@@ -1601,8 +1601,8 @@ discard block |
||
1601 | 1601 | $activitytime = ''; |
1602 | 1602 | if ($time) { |
1603 | 1603 | $activitytime = calendar_day_representation($time).' '. |
1604 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1605 | - calendar_time_representation($time); |
|
1604 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1605 | + calendar_time_representation($time); |
|
1606 | 1606 | } |
1607 | 1607 | return $activitytime; |
1608 | 1608 | } |
@@ -1739,7 +1739,7 @@ discard block |
||
1739 | 1739 | $owner = array('0' => get_string('mod_form_field_participant_list_type_owner', 'bigbluebuttonbn')); |
1740 | 1740 | $renderer->render_group_element('participant_moderator_default', |
1741 | 1741 | $renderer->render_group_element_configmultiselect('participant_moderator_default', array_keys($owner), array_merge($owner, $roles)) |
1742 | - ); |
|
1742 | + ); |
|
1743 | 1743 | } |
1744 | 1744 | // Configuration for "send notifications" feature. |
1745 | 1745 | if ((boolean)\mod_bigbluebuttonbn\settings\renderer::section_send_notifications_shown()) { |
@@ -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 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if (isset($meta)) { |
80 | 80 | $log->meta = $meta; |
81 | 81 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
82 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
82 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
83 | 83 | } |
84 | 84 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
85 | 85 | } |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | $data = null; |
120 | 120 | if (!is_null($pname) && !is_null($purl)) { |
121 | 121 | $method = BIGBLUEBUTTONBN_METHOD_POST; |
122 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
123 | - $purl."' /></module></modules>"; |
|
122 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
123 | + $purl . "' /></module></modules>"; |
|
124 | 124 | } |
125 | 125 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
126 | 126 | if ($xml) { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | 'moderatorPW' => $meeting->moderatorPW, |
160 | 160 | 'attendeePW' => $meeting->attendeePW, |
161 | 161 | 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, |
162 | - 'running' => $meeting->running, ); |
|
162 | + 'running' => $meeting->running,); |
|
163 | 163 | } |
164 | 164 | return $meetings; |
165 | 165 | } |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | // Override imported flag with actual ID. |
300 | 300 | $recording['imported'] = $recordimported->id; |
301 | 301 | if (isset($recordimported->protected)) { |
302 | - $recording['protected'] = (string) $recordimported->protected; |
|
302 | + $recording['protected'] = (string)$recordimported->protected; |
|
303 | 303 | } |
304 | 304 | $recordsimportedarray[$recording['recordID']] = $recording; |
305 | 305 | } |
@@ -315,36 +315,36 @@ discard block |
||
315 | 315 | |
316 | 316 | function bigbluebuttonbn_get_default_config_xml_array() { |
317 | 317 | $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML(); |
318 | - return (array) $defaultconfigxml; |
|
318 | + return (array)$defaultconfigxml; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | function bigbluebuttonbn_get_recording_array_value($recording) { |
322 | 322 | // Add formats. |
323 | 323 | $playbackarray = array(); |
324 | 324 | foreach ($recording->playback->format as $format) { |
325 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
326 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
325 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
326 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
327 | 327 | // Add preview per format when existing. |
328 | 328 | if ($format->preview) { |
329 | 329 | $imagesarray = array(); |
330 | 330 | foreach ($format->preview->images->image as $image) { |
331 | - $imagearray = array('url' => trim((string) $image)); |
|
331 | + $imagearray = array('url' => trim((string)$image)); |
|
332 | 332 | foreach ($image->attributes() as $attkey => $attvalue) { |
333 | - $imagearray[$attkey] = (string) $attvalue; |
|
333 | + $imagearray[$attkey] = (string)$attvalue; |
|
334 | 334 | } |
335 | 335 | array_push($imagesarray, $imagearray); |
336 | 336 | } |
337 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
337 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | // Add the metadata to the recordings array. |
341 | 341 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
342 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
343 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
344 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
345 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
342 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
343 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
344 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
345 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
346 | 346 | if (isset($recording->protected)) { |
347 | - $recordingarray['protected'] = (string) $recording->protected; |
|
347 | + $recordingarray['protected'] = (string)$recording->protected; |
|
348 | 348 | } |
349 | 349 | return $recordingarray + $metadataarray; |
350 | 350 | } |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | if (is_object($value)) { |
356 | 356 | $value = ''; |
357 | 357 | } |
358 | - $metadataarray['meta_'.$key] = $value; |
|
358 | + $metadataarray['meta_' . $key] = $value; |
|
359 | 359 | } |
360 | 360 | return $metadataarray; |
361 | 361 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $ids = explode(',', $recordids); |
412 | 412 | foreach ($ids as $id) { |
413 | 413 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
414 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
414 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
415 | 415 | ); |
416 | 416 | if ($xml && $xml->returncode != 'SUCCESS') { |
417 | 417 | return false; |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | return $xml; |
479 | 479 | } catch (Exception $e) { |
480 | 480 | libxml_use_internal_errors($previous); |
481 | - $error = 'Caught exception: '.$e->getMessage(); |
|
481 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
482 | 482 | debugging($error, DEBUG_DEVELOPER); |
483 | 483 | return null; |
484 | 484 | } |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
490 | 490 | return $response; |
491 | 491 | } catch (Exception $e) { |
492 | - $error = 'Caught exception: '.$e->getMessage(); |
|
492 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
493 | 493 | debugging($error, DEBUG_DEVELOPER); |
494 | 494 | libxml_use_internal_errors($previous); |
495 | 495 | return null; |
@@ -507,8 +507,8 @@ discard block |
||
507 | 507 | |
508 | 508 | $options = array(); |
509 | 509 | $options['CURLOPT_HTTPHEADER'] = array( |
510 | - 'Content-Type: '.$contenttype, |
|
511 | - 'Content-Length: '.strlen($data), |
|
510 | + 'Content-Type: ' . $contenttype, |
|
511 | + 'Content-Length: ' . strlen($data), |
|
512 | 512 | 'Content-Language: en-US', |
513 | 513 | ); |
514 | 514 | |
@@ -523,9 +523,9 @@ discard block |
||
523 | 523 | if ($userroles) { |
524 | 524 | $where = ''; |
525 | 525 | foreach ($userroles as $value) { |
526 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$value->roleid; |
|
526 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $value->roleid; |
|
527 | 527 | } |
528 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
528 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
529 | 529 | } |
530 | 530 | return $userroles; |
531 | 531 | } |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | function bigbluebuttonbn_get_users(context $context = null) { |
539 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
539 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
540 | 540 | foreach ($users as $key => $value) { |
541 | 541 | $users[$key] = fullname($value); |
542 | 542 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | } |
545 | 545 | |
546 | 546 | function bigbluebuttonbn_get_users_select(context $context = null) { |
547 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
547 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
548 | 548 | foreach ($users as $key => $value) { |
549 | 549 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
550 | 550 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | function bigbluebuttonbn_get_roles(context $context = null) { |
555 | - $roles = (array) role_get_names($context); |
|
555 | + $roles = (array)role_get_names($context); |
|
556 | 556 | foreach ($roles as $key => $value) { |
557 | 557 | $roles[$key] = $value->localname; |
558 | 558 | } |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | } |
561 | 561 | |
562 | 562 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
563 | - $roles = (array) role_get_names($context); |
|
563 | + $roles = (array)role_get_names($context); |
|
564 | 564 | foreach ($roles as $key => $value) { |
565 | 565 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
566 | 566 | } |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | } |
569 | 569 | |
570 | 570 | function bigbluebuttonbn_get_role($id) { |
571 | - $roles = (array) role_get_names(); |
|
571 | + $roles = (array)role_get_names(); |
|
572 | 572 | if (is_numeric($id)) { |
573 | 573 | return (object)$roles[$id]; |
574 | 574 | } |
@@ -648,11 +648,11 @@ discard block |
||
648 | 648 | return array(); |
649 | 649 | } |
650 | 650 | foreach ($rules as $key => $rule) { |
651 | - if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) { |
|
651 | + if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) { |
|
652 | 652 | continue; |
653 | 653 | } |
654 | 654 | $role = bigbluebuttonbn_get_role($rule['selectionid']); |
655 | - if ( $role == null ) { |
|
655 | + if ($role == null) { |
|
656 | 656 | unset($rules[$key]); |
657 | 657 | continue; |
658 | 658 | } |
@@ -691,10 +691,10 @@ discard block |
||
691 | 691 | if (empty($userroles)) { |
692 | 692 | $userroles = get_user_roles($context, $userid, true); |
693 | 693 | } |
694 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
694 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
695 | 695 | } |
696 | 696 | |
697 | -function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) { |
|
697 | +function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) { |
|
698 | 698 | // Iterate participant rules. |
699 | 699 | foreach ($participantlist as $participant) { |
700 | 700 | if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) { |
@@ -739,9 +739,9 @@ discard block |
||
739 | 739 | $isunique = true; |
740 | 740 | if ($voicebridge != 0) { |
741 | 741 | $table = 'bigbluebuttonbn'; |
742 | - $select = 'voicebridge = '.$voicebridge; |
|
742 | + $select = 'voicebridge = ' . $voicebridge; |
|
743 | 743 | if ($id) { |
744 | - $select .= ' AND id <> '.$id; |
|
744 | + $select .= ' AND id <> ' . $id; |
|
745 | 745 | } |
746 | 746 | if ($DB->get_records_select($table, $select)) { |
747 | 747 | $isunique = false; |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | function bigbluebuttonbn_generate_nonce() { |
796 | 796 | $mt = microtime(); |
797 | 797 | $rand = mt_rand(); |
798 | - return md5($mt.$rand); |
|
798 | + return md5($mt . $rand); |
|
799 | 799 | } |
800 | 800 | |
801 | 801 | function bigbluebuttonbn_random_password($length = 8) { |
@@ -806,41 +806,41 @@ discard block |
||
806 | 806 | |
807 | 807 | function bigbluebuttonbn_events() { |
808 | 808 | return array( |
809 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
810 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
811 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
812 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
813 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
814 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
815 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
816 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
817 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
818 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
819 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
820 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
821 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
822 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
823 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
809 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
810 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
811 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
812 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
813 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
814 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
815 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
816 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
817 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
818 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
819 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
820 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
821 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
822 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
823 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
824 | 824 | ); |
825 | 825 | } |
826 | 826 | |
827 | 827 | function bigbluebuttonbn_events_action() { |
828 | 828 | return array( |
829 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
830 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
831 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
832 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
833 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
834 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
835 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
836 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
837 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
838 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
839 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
840 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
841 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
842 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
843 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
829 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
830 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
831 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
832 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
833 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
834 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
835 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
836 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
837 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
838 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
839 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
840 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
841 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
842 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
843 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
844 | 844 | ); |
845 | 845 | } |
846 | 846 | |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | if (array_key_exists('other', $options)) { |
862 | 862 | $eventproperties['other'] = $options['other']; |
863 | 863 | } |
864 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
864 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
865 | 865 | array($eventproperties)); |
866 | 866 | $event->trigger(); |
867 | 867 | } |
@@ -902,10 +902,10 @@ discard block |
||
902 | 902 | $now = time(); |
903 | 903 | if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
904 | 904 | // Use the value in the cache. |
905 | - return (array) json_decode($result['meeting_info']); |
|
905 | + return (array)json_decode($result['meeting_info']); |
|
906 | 906 | } |
907 | 907 | // Ping again and refresh the cache. |
908 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
908 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
909 | 909 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
910 | 910 | ); |
911 | 911 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -980,8 +980,8 @@ discard block |
||
980 | 980 | * @param string $configxml |
981 | 981 | */ |
982 | 982 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
983 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
984 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
983 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
984 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
985 | 985 | return $configxmlparams; |
986 | 986 | } |
987 | 987 | |
@@ -990,7 +990,7 @@ discard block |
||
990 | 990 | * @param string $configxml |
991 | 991 | */ |
992 | 992 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
993 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
993 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
994 | 994 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
995 | 995 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
996 | 996 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | */ |
1004 | 1004 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1005 | 1005 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1006 | - $configxmlarray = (array) $configxml; |
|
1006 | + $configxmlarray = (array)$configxml; |
|
1007 | 1007 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1008 | 1008 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1009 | 1009 | return ''; |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | global $USER; |
1054 | 1054 | $starttime = $starttime - ($starttime % 1000); |
1055 | 1055 | // Set formatted date. |
1056 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1056 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1057 | 1057 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1058 | 1058 | } |
1059 | 1059 | |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) { |
1070 | 1070 | $actionbar = ''; |
1071 | 1071 | foreach ($tools as $tool) { |
1072 | - if ( $tool == 'protect' && !isset($recording['protected']) ) { |
|
1072 | + if ($tool == 'protect' && !isset($recording['protected'])) { |
|
1073 | 1073 | continue; |
1074 | 1074 | } |
1075 | 1075 | $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool); |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | $visibility = 'hidden '; |
1114 | 1114 | } |
1115 | 1115 | $recordingpreview = html_writer::start_tag('div', |
1116 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
1116 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
1117 | 1117 | foreach ($recording['playbacks'] as $playback) { |
1118 | 1118 | if (isset($playback['preview'])) { |
1119 | 1119 | foreach ($playback['preview'] as $image) { |
@@ -1141,13 +1141,13 @@ discard block |
||
1141 | 1141 | if ($recording['published'] === 'false') { |
1142 | 1142 | $visibility = 'hidden '; |
1143 | 1143 | } |
1144 | - $id = 'playbacks-'.$recording['recordID']; |
|
1144 | + $id = 'playbacks-' . $recording['recordID']; |
|
1145 | 1145 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1146 | 1146 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1147 | 1147 | 'title' => $title, $visibility => $visibility)); |
1148 | 1148 | foreach ($recording['playbacks'] as $playback) { |
1149 | 1149 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1150 | - $playback).' '; |
|
1150 | + $playback) . ' '; |
|
1151 | 1151 | } |
1152 | 1152 | $recordingtypes .= html_writer::end_tag('div'); |
1153 | 1153 | return $recordingtypes; |
@@ -1155,12 +1155,12 @@ discard block |
||
1155 | 1155 | |
1156 | 1156 | function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) { |
1157 | 1157 | global $CFG, $OUTPUT; |
1158 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1158 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1159 | 1159 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);'; |
1160 | - $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
|
1161 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1160 | + $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid . |
|
1161 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1162 | 1162 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1163 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1163 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1164 | 1164 | } |
1165 | 1165 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID']; |
1166 | 1166 | $linkattributes = array( |
@@ -1242,11 +1242,11 @@ discard block |
||
1242 | 1242 | $target .= '-' . $data['target']; |
1243 | 1243 | } |
1244 | 1244 | $id = 'recording-' . $target . '-' . $recording['recordID']; |
1245 | - $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);'; |
|
1245 | + $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);'; |
|
1246 | 1246 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) { |
1247 | 1247 | // With icon for $manageaction. |
1248 | 1248 | $iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
1249 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1249 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1250 | 1250 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1251 | 1251 | 'moodle', $iconattributes); |
1252 | 1252 | $linkattributes = array( |
@@ -1328,7 +1328,7 @@ discard block |
||
1328 | 1328 | if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { |
1329 | 1329 | // There are recordings for this meeting. |
1330 | 1330 | foreach ($recordings as $recording) { |
1331 | - if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) { |
|
1331 | + if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
|
1332 | 1332 | continue; |
1333 | 1333 | } |
1334 | 1334 | bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table); |
@@ -1343,7 +1343,7 @@ discard block |
||
1343 | 1343 | return; |
1344 | 1344 | } |
1345 | 1345 | $row = new html_table_row(); |
1346 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1346 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1347 | 1347 | $row->attributes['data-imported'] = 'false'; |
1348 | 1348 | $texthead = ''; |
1349 | 1349 | $texttail = ''; |
@@ -1367,7 +1367,7 @@ discard block |
||
1367 | 1367 | } |
1368 | 1368 | |
1369 | 1369 | function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) { |
1370 | - if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) { |
|
1370 | + if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) { |
|
1371 | 1371 | return true; |
1372 | 1372 | } |
1373 | 1373 | return false; |
@@ -1380,9 +1380,9 @@ discard block |
||
1380 | 1380 | // Build the message_body. |
1381 | 1381 | $msg->activity_type = ''; |
1382 | 1382 | $msg->activity_title = $bigbluebuttonbn->name; |
1383 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
1384 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
1385 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1383 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
1384 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
1385 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1386 | 1386 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext); |
1387 | 1387 | } |
1388 | 1388 | |
@@ -1472,15 +1472,15 @@ discard block |
||
1472 | 1472 | |
1473 | 1473 | function bigbluebuttonbn_get_recordings_sql_selectdeleted($courseid, $bigbluebuttonbnid = null, $subset = true) { |
1474 | 1474 | if ($bigbluebuttonbnid === null) { |
1475 | - return "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1475 | + return "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1476 | 1476 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1477 | 1477 | } |
1478 | 1478 | if ($subset) { |
1479 | - return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1479 | + return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1480 | 1480 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1481 | 1481 | } |
1482 | - return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
1483 | - BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1482 | + return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
1483 | + BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1484 | 1484 | } |
1485 | 1485 | |
1486 | 1486 | function bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid = null, $subset = true, |
@@ -1525,7 +1525,7 @@ discard block |
||
1525 | 1525 | } |
1526 | 1526 | // Prepare select for loading records based on existent bigbluebuttonbns. |
1527 | 1527 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
1528 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
1528 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
1529 | 1529 | // Include only Create events and exclude those with record not true. |
1530 | 1530 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
1531 | 1531 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -1600,8 +1600,8 @@ discard block |
||
1600 | 1600 | function bigbluebuttonbn_format_activity_time($time) { |
1601 | 1601 | $activitytime = ''; |
1602 | 1602 | if ($time) { |
1603 | - $activitytime = calendar_day_representation($time).' '. |
|
1604 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1603 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
1604 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
1605 | 1605 | calendar_time_representation($time); |
1606 | 1606 | } |
1607 | 1607 | return $activitytime; |
@@ -1711,7 +1711,7 @@ discard block |
||
1711 | 1711 | // This feature only works if curl is installed. |
1712 | 1712 | $preuploadpresentationdescrip = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn'); |
1713 | 1713 | if (!extension_loaded('curl')) { |
1714 | - $preuploadpresentationdescrip .= '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>'; |
|
1714 | + $preuploadpresentationdescrip .= '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>'; |
|
1715 | 1715 | } |
1716 | 1716 | $renderer->render_group_header('preuploadpresentation', null, $preuploadpresentationdescrip); |
1717 | 1717 | if (extension_loaded('curl')) { |
@@ -119,28 +119,28 @@ |
||
119 | 119 | */ |
120 | 120 | public static function get_options() { |
121 | 121 | return [ |
122 | - 'version_major' => self::get_moodle_version_major(), |
|
123 | - 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
124 | - 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
125 | - 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
126 | - 'userlimit_default' => self::get('userlimit_default'), |
|
127 | - 'userlimit_editable' => self::get('userlimit_editable'), |
|
128 | - 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
129 | - 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
130 | - 'recordings_enabled' => self::get('recordings_enabled'), |
|
131 | - 'recordings_html_default' => self::get('recordings_html_default'), |
|
132 | - 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
133 | - 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
134 | - 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
135 | - 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
136 | - 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
137 | - 'recording_default' => self::get('recording_default'), |
|
138 | - 'recording_editable' => self::get('recording_editable'), |
|
139 | - 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
140 | - 'general_warning_message' => self::get('general_warning_message'), |
|
141 | - 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
142 | - 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
143 | - 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
144 | - ]; |
|
122 | + 'version_major' => self::get_moodle_version_major(), |
|
123 | + 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
124 | + 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
125 | + 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
126 | + 'userlimit_default' => self::get('userlimit_default'), |
|
127 | + 'userlimit_editable' => self::get('userlimit_editable'), |
|
128 | + 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
129 | + 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
130 | + 'recordings_enabled' => self::get('recordings_enabled'), |
|
131 | + 'recordings_html_default' => self::get('recordings_html_default'), |
|
132 | + 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
133 | + 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
134 | + 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
135 | + 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
136 | + 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
137 | + 'recording_default' => self::get('recording_default'), |
|
138 | + 'recording_editable' => self::get('recording_editable'), |
|
139 | + 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
140 | + 'general_warning_message' => self::get('general_warning_message'), |
|
141 | + 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
142 | + 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
143 | + 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
144 | + ]; |
|
145 | 145 | } |
146 | 146 | } |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function defaultvalues() { |
46 | 46 | return array( |
47 | - 'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
48 | - 'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
47 | + 'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
48 | + 'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
49 | 49 | 'importrecordings_enabled' => 'false', |
50 | 50 | 'voicebridge_editable' => 'false', |
51 | 51 | 'importrecordings_enabled' => 'false', |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | public static function get($setting) { |
100 | 100 | global $CFG; |
101 | 101 | if (isset($CFG->bigbluebuttonbn[$setting])) { |
102 | - return (string) $CFG->bigbluebuttonbn[$setting]; |
|
102 | + return (string)$CFG->bigbluebuttonbn[$setting]; |
|
103 | 103 | } |
104 | - if (isset($CFG->{'bigbluebuttonbn_'.$setting})) { |
|
105 | - return (string)$CFG->{'bigbluebuttonbn_'.$setting}; |
|
104 | + if (isset($CFG->{'bigbluebuttonbn_' . $setting})) { |
|
105 | + return (string)$CFG->{'bigbluebuttonbn_' . $setting}; |
|
106 | 106 | } |
107 | 107 | return self::defaultvalue($setting); |
108 | 108 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | defined('MOODLE_INTERNAL') || die(); |
28 | 28 | |
29 | 29 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
30 | -require_once($CFG->libdir.'/adminlib.php'); |
|
30 | +require_once($CFG->libdir . '/adminlib.php'); |
|
31 | 31 | |
32 | 32 | class renderer { |
33 | 33 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $itemname = get_string('config_' . $name, 'bigbluebuttonbn'); |
46 | 46 | } |
47 | 47 | if ($itemdescription == null) { |
48 | - $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn'); |
|
48 | + $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn'); |
|
49 | 49 | } |
50 | 50 | $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription); |
51 | 51 | $this->settings->add($item); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * recordings from a different activity even from a different course. |
95 | 95 | **/ |
96 | 96 | |
97 | - /* |
|
97 | + /* |
|
98 | 98 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
99 | 99 | * activities will have the 'import recordings' capability enabled. |
100 | 100 | */ |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * 'Join session' button enabled |
116 | 116 | **/ |
117 | 117 | |
118 | - /* |
|
118 | + /* |
|
119 | 119 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
120 | 120 | * activities will have the 'wait for moderator' capability enabled by |
121 | 121 | * default. |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * 5. CONFIGURATION FOR "STATIC VOICE BRIDGE" FEATURE |
150 | 150 | * |
151 | 151 | **/ |
152 | - /* |
|
152 | + /* |
|
153 | 153 | * A conference voice bridge number can be permanently assigned to a room |
154 | 154 | * or activity. |
155 | 155 | */ |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * 6. CONFIGURATION FOR "PRE-UPLOAD PRESENTATION" FEATURE |
160 | 160 | * |
161 | 161 | **/ |
162 | - /* |
|
162 | + /* |
|
163 | 163 | * Since version 0.8, BigBluebutton has an implementation for allowing |
164 | 164 | * preuploading presentation. When this feature is enabled, users creating or |
165 | 165 | * editing a room or activity can upload a PDF or Office document to the |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * applied to each room or activity, or globally. |
177 | 177 | **/ |
178 | 178 | |
179 | - /* |
|
179 | + /* |
|
180 | 180 | * The number of users allowed in a session by default when a new room or |
181 | 181 | * conference is added. If the number is set to 0, no limit is established. |
182 | 182 | * $CFG->bigbluebuttonbn['userlimit_default'] = 0; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * By default only the owner is assigned. |
198 | 198 | **/ |
199 | 199 | |
200 | - /* |
|
200 | + /* |
|
201 | 201 | * The values for this parameter can be 'owner' and/or any of the roles defined in |
202 | 202 | * Moodle (including the custom parameters). The value used will be the key for the role. |
203 | 203 | * [owner|manager|coursecreator|editingteacher|teacher|student|guest|user|frontpage|ANY_CUSTOM_ROLE] |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * 9. CONFIGURATION FOR "NOTIFICATION SENDING" FEATURE |
209 | 209 | * |
210 | 210 | **/ |
211 | - /* |
|
211 | + /* |
|
212 | 212 | * When the value is set to 1 (checked) the 'notification sending' |
213 | 213 | * capability can be used by the user creating or editing the room or |
214 | 214 | * activity. |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * 10. CONFIGURATION FOR "RECORDING READY" FEATURE |
223 | 223 | * |
224 | 224 | **/ |
225 | - /* |
|
225 | + /* |
|
226 | 226 | * When the value is set to 1 (checked) the 'notify users when recording ready' |
227 | 227 | * capability is enabled, meaning that a message will be sent to all enrolled |
228 | 228 | * users in a course when a recording is ready |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * 12. GENERAL CONFIGURATION FOR RECORDINGS UI |
247 | 247 | * |
248 | 248 | **/ |
249 | - /* |
|
249 | + /* |
|
250 | 250 | * When the value is set to 1 (checked) the bigbluebuttonbn resources |
251 | 251 | * will show the recodings in an html table by default. |
252 | 252 | * $CFG->bigbluebuttonbn['recordings_html_default'] = 0; |
@@ -270,22 +270,22 @@ discard block |
||
270 | 270 | * $CFG->bigbluebuttonbn['recordings_deleted_editable'] = 0; |
271 | 271 | */ |
272 | 272 | |
273 | - /* |
|
273 | + /* |
|
274 | 274 | * When the value is set to 1 (checked) the bigbluebuttonbn resources for recordings |
275 | 275 | * will show only the imported links as part of the list. |
276 | 276 | * $CFG->bigbluebuttonbn['recordings_imported_default'] = 0; |
277 | 277 | */ |
278 | 278 | |
279 | - /* |
|
279 | + /* |
|
280 | 280 | * When the value is set to 1 (checked) the 'show only imported links' |
281 | 281 | * capability can be enabled/disabled by the user creating or editing the resource for recordings. |
282 | 282 | * $CFG->bigbluebuttonbn['recordings_imported_editable'] = 1; |
283 | 283 | */ |
284 | 284 | |
285 | - /* |
|
285 | + /* |
|
286 | 286 | * CONFIGURATION FOR FEATURES OFFERED BY BN SERVERS |
287 | 287 | ** ------------------------------------------------------------------ **/ |
288 | - /* |
|
288 | + /* |
|
289 | 289 | * When general_warning_message value is different than "", the string is shown |
290 | 290 | * as a warning message to privileged users (administrators and Teachers or users allowed to edit). |
291 | 291 | * $CFG->bigbluebuttonbn['general_warning_message'] = "This will may have recordings enabled when upgraded to premium."; |
@@ -61,104 +61,104 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | switch (strtolower($action)) { |
64 | - case 'logout': |
|
65 | - if (isset($errors) && $errors != '') { |
|
66 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
67 | - break; |
|
68 | - } |
|
69 | - |
|
70 | - if (is_null($bbbsession)) { |
|
71 | - bigbluebutton_bbb_view_close_window_manually(); |
|
72 | - break; |
|
73 | - } |
|
64 | + case 'logout': |
|
65 | + if (isset($errors) && $errors != '') { |
|
66 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
67 | + break; |
|
68 | + } |
|
74 | 69 | |
75 | - // Moodle event logger: Create an event for meeting left. |
|
76 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
70 | + if (is_null($bbbsession)) { |
|
71 | + bigbluebutton_bbb_view_close_window_manually(); |
|
72 | + break; |
|
73 | + } |
|
77 | 74 | |
78 | - // Update the cache. |
|
79 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
75 | + // Moodle event logger: Create an event for meeting left. |
|
76 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
80 | 77 | |
81 | - // Close the tab or window where BBB was opened. |
|
82 | - bigbluebutton_bbb_view_close_window(); |
|
83 | - break; |
|
84 | - case 'join': |
|
85 | - if (is_null($bbbsession)) { |
|
86 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
87 | - break; |
|
88 | - } |
|
78 | + // Update the cache. |
|
79 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
89 | 80 | |
90 | - // See if the session is in progress. |
|
91 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
92 | - // Since the meeting is already running, we just join the session. |
|
93 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
81 | + // Close the tab or window where BBB was opened. |
|
82 | + bigbluebutton_bbb_view_close_window(); |
|
94 | 83 | break; |
95 | - } |
|
84 | + case 'join': |
|
85 | + if (is_null($bbbsession)) { |
|
86 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
87 | + break; |
|
88 | + } |
|
96 | 89 | |
97 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
98 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
99 | - header('Location: '.$bbbsession['logoutURL']); |
|
100 | - break; |
|
101 | - } |
|
90 | + // See if the session is in progress. |
|
91 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
92 | + // Since the meeting is already running, we just join the session. |
|
93 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
94 | + break; |
|
95 | + } |
|
102 | 96 | |
103 | - // As the meeting doesn't exist, try to create it. |
|
104 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
105 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn), |
|
106 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
107 | - $bbbsession['presentation']['name'], |
|
108 | - $bbbsession['presentation']['url'] |
|
109 | - ); |
|
110 | - |
|
111 | - if (!$response) { |
|
112 | - // The server is unreachable. |
|
113 | - if ($bbbsession['administrator']) { |
|
114 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
115 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
97 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
98 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
99 | + header('Location: '.$bbbsession['logoutURL']); |
|
116 | 100 | break; |
117 | 101 | } |
118 | - if ($bbbsession['moderator']) { |
|
119 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
102 | + |
|
103 | + // As the meeting doesn't exist, try to create it. |
|
104 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
105 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn), |
|
106 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
107 | + $bbbsession['presentation']['name'], |
|
108 | + $bbbsession['presentation']['url'] |
|
109 | + ); |
|
110 | + |
|
111 | + if (!$response) { |
|
112 | + // The server is unreachable. |
|
113 | + if ($bbbsession['administrator']) { |
|
114 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
115 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
116 | + break; |
|
117 | + } |
|
118 | + if ($bbbsession['moderator']) { |
|
119 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
120 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
121 | + break; |
|
122 | + } |
|
123 | + |
|
124 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
120 | 125 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
121 | 126 | break; |
122 | 127 | } |
123 | 128 | |
124 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
125 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
126 | - break; |
|
127 | - } |
|
129 | + if ($response['returncode'] == 'FAILED') { |
|
130 | + // The meeting was not created. |
|
131 | + if (!$printerrorkey) { |
|
132 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
133 | + break; |
|
134 | + } |
|
135 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
136 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
137 | + break; |
|
138 | + } |
|
128 | 139 | |
129 | - if ($response['returncode'] == 'FAILED') { |
|
130 | - // The meeting was not created. |
|
131 | - if (!$printerrorkey) { |
|
132 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
140 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
141 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
133 | 142 | break; |
134 | 143 | } |
135 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
136 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
137 | - break; |
|
138 | - } |
|
139 | 144 | |
140 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
141 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
145 | + // Moodle event logger: Create an event for meeting created. |
|
146 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
147 | + // Internal logger: Insert a record with the meeting created. |
|
148 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
149 | + // Since the meeting is already running, we just join the session. |
|
150 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
142 | 151 | break; |
143 | - } |
|
152 | + case 'play': |
|
153 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
144 | 154 | |
145 | - // Moodle event logger: Create an event for meeting created. |
|
146 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
147 | - // Internal logger: Insert a record with the meeting created. |
|
148 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
149 | - // Since the meeting is already running, we just join the session. |
|
150 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
151 | - break; |
|
152 | - case 'play': |
|
153 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
154 | - |
|
155 | - // Moodle event logger: Create an event for meeting left. |
|
156 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
157 | - // Execute the redirect. |
|
158 | - header('Location: '.urldecode($href)); |
|
159 | - break; |
|
160 | - default: |
|
161 | - bigbluebutton_bbb_view_close_window(); |
|
155 | + // Moodle event logger: Create an event for meeting left. |
|
156 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
157 | + // Execute the redirect. |
|
158 | + header('Location: '.urldecode($href)); |
|
159 | + break; |
|
160 | + default: |
|
161 | + bigbluebutton_bbb_view_close_window(); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | function bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype) { |
@@ -27,7 +27,7 @@ |
||
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 | // Configuration for BigBlueButton. |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | defined('MOODLE_INTERNAL') || die(); |
28 | 28 | |
29 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
30 | -require_once($CFG->dirroot.'/course/moodleform_mod.php'); |
|
29 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
30 | +require_once($CFG->dirroot . '/course/moodleform_mod.php'); |
|
31 | 31 | |
32 | 32 | class mod_bigbluebuttonbn_mod_form extends moodleform_mod { |
33 | 33 | |
@@ -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 | return; |
42 | 42 | } |
43 | 43 | // Context. |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ); |
111 | 111 | $defaultvalues['presentation'] = $draftitemid; |
112 | 112 | } catch (Exception $e) { |
113 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
113 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
114 | 114 | return null; |
115 | 115 | } |
116 | 116 | } |
@@ -282,10 +282,10 @@ discard block |
||
282 | 282 | html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type', |
283 | 283 | $participantselection['type_selected'], array(), |
284 | 284 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
285 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).' '. |
|
285 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')) . ' ' . |
|
286 | 286 | html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
287 | 287 | $participantselection['selected'], array(), |
288 | - array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).' '. |
|
288 | + array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')) . ' ' . |
|
289 | 289 | html_writer::tag('input', '', array('id' => 'id_addselectionid', 'type' => 'button', 'class' => 'btn btn-secondary', |
290 | 290 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
291 | 291 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participant_add(); return 0;' |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | // Render elements for participant list. |
303 | 303 | $htmllist = html_writer::tag('div', |
304 | 304 | html_writer::label(get_string('mod_form_field_participant_list', 'bigbluebuttonbn'), |
305 | - 'bigbluebuttonbn_participant_list'). |
|
305 | + 'bigbluebuttonbn_participant_list') . |
|
306 | 306 | html_writer::table($table) |
307 | 307 | ); |
308 | 308 | $mform->addElement('html', "\n\n"); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | return; |
333 | 333 | } |
334 | 334 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
335 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
335 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
336 | 336 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
337 | 337 | } |
338 | 338 | if (!empty($rule)) { |
@@ -85,10 +85,10 @@ |
||
85 | 85 | // Migrate settings. |
86 | 86 | unset_config('recordingtagging_default', 'mod_bigbluebuttonbn'); |
87 | 87 | unset_config('recordingtagging_editable', 'mod_bigbluebuttonbn'); |
88 | - $cfgvalue = get_config('mod_bigbluebuttonbn', 'importrecordings_from_deleted_activities_enabled'); |
|
88 | + $cfgvalue = get_config('mod_bigbluebuttonbn', 'importrecordings_from_deleted_activities_enabled'); |
|
89 | 89 | set_config('importrecordings_from_deleted_enabled', $cfgvalue, 'mod_bigbluebuttonbn'); |
90 | 90 | unset_config('importrecordings_from_deleted_activities_enabled', 'mod_bigbluebuttonbn'); |
91 | - $cfgvalue = get_config('mod_bigbluebuttonbn', 'moderator_default'); |
|
91 | + $cfgvalue = get_config('mod_bigbluebuttonbn', 'moderator_default'); |
|
92 | 92 | set_config('participant_moderator_default', $cfgvalue, 'mod_bigbluebuttonbn'); |
93 | 93 | unset_config('moderator_default', 'mod_bigbluebuttonbn'); |
94 | 94 | // Update db version tag. |