@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | /** |
327 | 327 | * Helper function to retrive the default config.xml file. |
328 | 328 | * |
329 | - * @return string |
|
329 | + * @return null|SimpleXMLElement |
|
330 | 330 | */ |
331 | 331 | function bigbluebuttonbn_get_default_config_xml() { |
332 | 332 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * @param object $a |
398 | 398 | * @param object $b |
399 | 399 | * |
400 | - * @return array |
|
400 | + * @return integer |
|
401 | 401 | */ |
402 | 402 | function bigbluebuttonbn_recording_build_sorter($a, $b) { |
403 | 403 | if ($a['startTime'] < $b['startTime']) { |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | * @param string $data |
524 | 524 | * @param string $contenttype |
525 | 525 | * |
526 | - * @return object |
|
526 | + * @return null|SimpleXMLElement |
|
527 | 527 | */ |
528 | 528 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
529 | 529 | if (extension_loaded('curl')) { |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | * @param string $data |
565 | 565 | * @param string $contenttype |
566 | 566 | * |
567 | - * @return object |
|
567 | + * @return string |
|
568 | 568 | */ |
569 | 569 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
570 | 570 | $c = new curl(); |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | * |
929 | 929 | * @param integer $voicebridge |
930 | 930 | * |
931 | - * @return string |
|
931 | + * @return boolean |
|
932 | 932 | */ |
933 | 933 | function bigbluebuttonbn_voicebridge_unique($voicebridge) { |
934 | 934 | global $DB; |
@@ -1028,7 +1028,7 @@ discard block |
||
1028 | 1028 | /** |
1029 | 1029 | * Helper returns an array with all possible bigbluebuttonbn events. |
1030 | 1030 | * |
1031 | - * @return array |
|
1031 | + * @return string[] |
|
1032 | 1032 | */ |
1033 | 1033 | function bigbluebuttonbn_events() { |
1034 | 1034 | return array( |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | * @param string $meetingid |
1238 | 1238 | * @param string $configxml |
1239 | 1239 | * |
1240 | - * @return object |
|
1240 | + * @return null|SimpleXMLElement |
|
1241 | 1241 | */ |
1242 | 1242 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1243 | 1243 | $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
@@ -1286,7 +1286,7 @@ discard block |
||
1286 | 1286 | * @param array $recording |
1287 | 1287 | * @param array $tools |
1288 | 1288 | * |
1289 | - * @return array |
|
1289 | + * @return null|stdClass |
|
1290 | 1290 | */ |
1291 | 1291 | function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) { |
1292 | 1292 | if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
@@ -1788,7 +1788,7 @@ discard block |
||
1788 | 1788 | * |
1789 | 1789 | * @param array $bbbsession |
1790 | 1790 | * @param array $recording |
1791 | - * @param object $rowdata |
|
1791 | + * @param stdClass $rowdata |
|
1792 | 1792 | * |
1793 | 1793 | * @return object |
1794 | 1794 | */ |
@@ -1976,7 +1976,7 @@ discard block |
||
1976 | 1976 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
1977 | 1977 | * in the getRecordings request considering only those that belong to deleted activities. |
1978 | 1978 | * |
1979 | - * @param string $courseid |
|
1979 | + * @param integer $courseid |
|
1980 | 1980 | * @param string $bigbluebuttonbnid |
1981 | 1981 | * @param bool $subset |
1982 | 1982 | * |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
121 | 121 | $data = ['meetingID' => $meetingid, |
122 | - 'fullName' => $username, |
|
123 | - 'password' => $pw, |
|
124 | - 'logoutURL' => $logouturl, |
|
122 | + 'fullName' => $username, |
|
123 | + 'password' => $pw, |
|
124 | + 'logoutURL' => $logouturl, |
|
125 | 125 | ]; |
126 | 126 | if (!is_null($configtoken)) { |
127 | 127 | $data['configToken'] = $configtoken; |
@@ -173,23 +173,23 @@ discard block |
||
173 | 173 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
174 | 174 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
175 | 175 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
176 | - ); |
|
176 | + ); |
|
177 | 177 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
178 | 178 | // Meeting info was returned. |
179 | 179 | return array('returncode' => $xml->returncode, |
180 | - 'meetingID' => $xml->meetingID, |
|
181 | - 'moderatorPW' => $xml->moderatorPW, |
|
182 | - 'attendeePW' => $xml->attendeePW, |
|
183 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
184 | - 'running' => $xml->running, |
|
185 | - 'recording' => $xml->recording, |
|
186 | - 'startTime' => $xml->startTime, |
|
187 | - 'endTime' => $xml->endTime, |
|
188 | - 'participantCount' => $xml->participantCount, |
|
189 | - 'moderatorCount' => $xml->moderatorCount, |
|
190 | - 'attendees' => $xml->attendees, |
|
191 | - 'metadata' => $xml->metadata, |
|
192 | - ); |
|
180 | + 'meetingID' => $xml->meetingID, |
|
181 | + 'moderatorPW' => $xml->moderatorPW, |
|
182 | + 'attendeePW' => $xml->attendeePW, |
|
183 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
184 | + 'running' => $xml->running, |
|
185 | + 'recording' => $xml->recording, |
|
186 | + 'startTime' => $xml->startTime, |
|
187 | + 'endTime' => $xml->endTime, |
|
188 | + 'participantCount' => $xml->participantCount, |
|
189 | + 'moderatorCount' => $xml->moderatorCount, |
|
190 | + 'attendees' => $xml->attendees, |
|
191 | + 'metadata' => $xml->metadata, |
|
192 | + ); |
|
193 | 193 | } |
194 | 194 | if ($xml) { |
195 | 195 | // Either failure or success without meeting info. |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | function bigbluebuttonbn_get_default_config_xml() { |
332 | 332 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
333 | 333 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
334 | - ); |
|
334 | + ); |
|
335 | 335 | return $xml; |
336 | 336 | } |
337 | 337 | |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | foreach ($ids as $id) { |
422 | 422 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
423 | 423 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
424 | - ); |
|
424 | + ); |
|
425 | 425 | if ($xml && $xml->returncode != 'SUCCESS') { |
426 | 426 | return false; |
427 | 427 | } |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | foreach ($ids as $id) { |
441 | 441 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
442 | 442 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
443 | - ); |
|
443 | + ); |
|
444 | 444 | if ($xml && $xml->returncode != 'SUCCESS') { |
445 | 445 | return false; |
446 | 446 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | foreach ($ids as $id) { |
460 | 460 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
461 | 461 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
462 | - ); |
|
462 | + ); |
|
463 | 463 | if ($xml && $xml->returncode != 'SUCCESS') { |
464 | 464 | return false; |
465 | 465 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
477 | 477 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
478 | 478 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
479 | - ); |
|
479 | + ); |
|
480 | 480 | if ($xml) { |
481 | 481 | // If the xml packet returned failure it displays the message to the user. |
482 | 482 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | */ |
497 | 497 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
498 | 498 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
499 | - ); |
|
499 | + ); |
|
500 | 500 | return ($xml && $xml->returncode == 'SUCCESS'); |
501 | 501 | } |
502 | 502 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | function bigbluebuttonbn_get_server_version() { |
509 | 509 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
510 | 510 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
511 | - ); |
|
511 | + ); |
|
512 | 512 | if ($xml && $xml->returncode == 'SUCCESS') { |
513 | 513 | return $xml->version; |
514 | 514 | } |
@@ -576,10 +576,10 @@ discard block |
||
576 | 576 | |
577 | 577 | $options = array(); |
578 | 578 | $options['CURLOPT_HTTPHEADER'] = array( |
579 | - 'Content-Type: '.$contenttype, |
|
580 | - 'Content-Length: '.strlen($data), |
|
581 | - 'Content-Language: en-US', |
|
582 | - ); |
|
579 | + 'Content-Type: '.$contenttype, |
|
580 | + 'Content-Length: '.strlen($data), |
|
581 | + 'Content-Language: en-US', |
|
582 | + ); |
|
583 | 583 | |
584 | 584 | return $c->post($url, $data, $options); |
585 | 585 | } |
@@ -722,16 +722,16 @@ discard block |
||
722 | 722 | 'all' => array( |
723 | 723 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
724 | 724 | 'children' => [] |
725 | - ) |
|
726 | - ); |
|
725 | + ) |
|
726 | + ); |
|
727 | 727 | $data['role'] = array( |
728 | 728 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
729 | 729 | 'children' => bigbluebuttonbn_get_roles_select($context) |
730 | - ); |
|
730 | + ); |
|
731 | 731 | $data['user'] = array( |
732 | 732 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
733 | 733 | 'children' => bigbluebuttonbn_get_users_select($context) |
734 | - ); |
|
734 | + ); |
|
735 | 735 | return $data; |
736 | 736 | } |
737 | 737 | |
@@ -776,9 +776,9 @@ discard block |
||
776 | 776 | continue; |
777 | 777 | } |
778 | 778 | $participantlistarray[] = array( |
779 | - 'selectiontype' => 'role', |
|
780 | - 'selectionid' => $moderatordefault, |
|
781 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
779 | + 'selectiontype' => 'role', |
|
780 | + 'selectionid' => $moderatordefault, |
|
781 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
782 | 782 | } |
783 | 783 | return $participantlistarray; |
784 | 784 | } |
@@ -821,11 +821,11 @@ discard block |
||
821 | 821 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
822 | 822 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
823 | 823 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
824 | - ], |
|
824 | + ], |
|
825 | 825 | 'type_selected' => 'all', |
826 | 826 | 'options' => ['all' => '---------------'], |
827 | 827 | 'selected' => 'all', |
828 | - ]; |
|
828 | + ]; |
|
829 | 829 | } |
830 | 830 | |
831 | 831 | /** |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | $eventproperties['other'] = $options['other']; |
1104 | 1104 | } |
1105 | 1105 | $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
1106 | - array($eventproperties)); |
|
1106 | + array($eventproperties)); |
|
1107 | 1107 | $event->trigger(); |
1108 | 1108 | } |
1109 | 1109 | |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | // Ping again and refresh the cache. |
1148 | 1148 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
1149 | 1149 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1150 | - ); |
|
1150 | + ); |
|
1151 | 1151 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
1152 | 1152 | return $meetinginfo; |
1153 | 1153 | } |
@@ -1517,8 +1517,8 @@ discard block |
||
1517 | 1517 | } |
1518 | 1518 | $id = 'playbacks-'.$recording['recordID']; |
1519 | 1519 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1520 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1521 | - 'title' => $title, $visibility => $visibility)); |
|
1520 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1521 | + 'title' => $title, $visibility => $visibility)); |
|
1522 | 1522 | foreach ($recording['playbacks'] as $playback) { |
1523 | 1523 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1524 | 1524 | $playback).' '; |
@@ -1541,7 +1541,7 @@ discard block |
||
1541 | 1541 | $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1542 | 1542 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
1543 | 1543 | $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
1544 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1544 | + '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1545 | 1545 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1546 | 1546 | $href .= '&href='.urlencode(trim($playback['url'])); |
1547 | 1547 | } |
@@ -1553,7 +1553,7 @@ discard block |
||
1553 | 1553 | 'data-target' => $playback['type'], |
1554 | 1554 | 'data-href' => $href, |
1555 | 1555 | 'class' => 'btn btn-sm btn-default' |
1556 | - ); |
|
1556 | + ); |
|
1557 | 1557 | return $OUTPUT->action_link('#', $title, null, $linkattributes); |
1558 | 1558 | } |
1559 | 1559 | |
@@ -1667,10 +1667,10 @@ discard block |
||
1667 | 1667 | 'id' => $id, |
1668 | 1668 | 'onclick' => $onclick, |
1669 | 1669 | 'data-action' => $data['action'] |
1670 | - ); |
|
1670 | + ); |
|
1671 | 1671 | if (!isset($recording['imported'])) { |
1672 | 1672 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
1673 | - $recording['recordID']); |
|
1673 | + $recording['recordID']); |
|
1674 | 1674 | } |
1675 | 1675 | if (isset($data['disabled'])) { |
1676 | 1676 | $iconattributes['class'] .= ' fa-' . $data['disabled']; |
@@ -2181,8 +2181,8 @@ discard block |
||
2181 | 2181 | $activitytime = ''; |
2182 | 2182 | if ($time) { |
2183 | 2183 | $activitytime = calendar_day_representation($time).' '. |
2184 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2185 | - calendar_time_representation($time); |
|
2184 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2185 | + calendar_time_representation($time); |
|
2186 | 2186 | } |
2187 | 2187 | return $activitytime; |
2188 | 2188 | } |
@@ -2467,7 +2467,7 @@ discard block |
||
2467 | 2467 | $renderer->render_group_element('participant_moderator_default', |
2468 | 2468 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
2469 | 2469 | array_keys($owner), array_merge($owner, $roles)) |
2470 | - ); |
|
2470 | + ); |
|
2471 | 2471 | } |
2472 | 2472 | } |
2473 | 2473 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | global $CFG; |
30 | 30 | |
31 | -require_once(dirname(__FILE__).'/lib.php'); |
|
31 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
32 | 32 | |
33 | 33 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ |
34 | 34 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (isset($meta)) { |
101 | 101 | $log->meta = $meta; |
102 | 102 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
103 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
103 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
104 | 104 | } |
105 | 105 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
106 | 106 | } |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | $data = null; |
149 | 149 | if (!is_null($pname) && !is_null($purl)) { |
150 | 150 | $method = 'POST'; |
151 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
152 | - $purl."' /></module></modules>"; |
|
151 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
152 | + $purl . "' /></module></modules>"; |
|
153 | 153 | } |
154 | 154 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
155 | 155 | if ($xml) { |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | // Override imported flag with actual ID. |
317 | 317 | $recording['imported'] = $recordimported->id; |
318 | 318 | if (isset($recordimported->protected)) { |
319 | - $recording['protected'] = (string) $recordimported->protected; |
|
319 | + $recording['protected'] = (string)$recordimported->protected; |
|
320 | 320 | } |
321 | 321 | $recordsimportedarray[$recording['recordID']] = $recording; |
322 | 322 | } |
@@ -346,29 +346,29 @@ discard block |
||
346 | 346 | // Add formats. |
347 | 347 | $playbackarray = array(); |
348 | 348 | foreach ($recording->playback->format as $format) { |
349 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
350 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
349 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
350 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
351 | 351 | // Add preview per format when existing. |
352 | 352 | if ($format->preview) { |
353 | 353 | $imagesarray = array(); |
354 | 354 | foreach ($format->preview->images->image as $image) { |
355 | - $imagearray = array('url' => trim((string) $image)); |
|
355 | + $imagearray = array('url' => trim((string)$image)); |
|
356 | 356 | foreach ($image->attributes() as $attkey => $attvalue) { |
357 | - $imagearray[$attkey] = (string) $attvalue; |
|
357 | + $imagearray[$attkey] = (string)$attvalue; |
|
358 | 358 | } |
359 | 359 | array_push($imagesarray, $imagearray); |
360 | 360 | } |
361 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
361 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
362 | 362 | } |
363 | 363 | } |
364 | 364 | // Add the metadata to the recordings array. |
365 | 365 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
366 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
367 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
368 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
369 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
366 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
367 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
368 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
369 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
370 | 370 | if (isset($recording->protected)) { |
371 | - $recordingarray['protected'] = (string) $recording->protected; |
|
371 | + $recordingarray['protected'] = (string)$recording->protected; |
|
372 | 372 | } |
373 | 373 | return $recordingarray + $metadataarray; |
374 | 374 | } |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | if (is_object($value)) { |
387 | 387 | $value = ''; |
388 | 388 | } |
389 | - $metadataarray['meta_'.$key] = $value; |
|
389 | + $metadataarray['meta_' . $key] = $value; |
|
390 | 390 | } |
391 | 391 | return $metadataarray; |
392 | 392 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $ids = explode(',', $recordids); |
459 | 459 | foreach ($ids as $id) { |
460 | 460 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
461 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
461 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
462 | 462 | ); |
463 | 463 | if ($xml && $xml->returncode != 'SUCCESS') { |
464 | 464 | return false; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | return $xml; |
539 | 539 | } catch (Exception $e) { |
540 | 540 | libxml_use_internal_errors($previous); |
541 | - $error = 'Caught exception: '.$e->getMessage(); |
|
541 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
542 | 542 | debugging($error, DEBUG_DEVELOPER); |
543 | 543 | return null; |
544 | 544 | } |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
550 | 550 | return $response; |
551 | 551 | } catch (Exception $e) { |
552 | - $error = 'Caught exception: '.$e->getMessage(); |
|
552 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
553 | 553 | debugging($error, DEBUG_DEVELOPER); |
554 | 554 | libxml_use_internal_errors($previous); |
555 | 555 | return null; |
@@ -576,8 +576,8 @@ discard block |
||
576 | 576 | |
577 | 577 | $options = array(); |
578 | 578 | $options['CURLOPT_HTTPHEADER'] = array( |
579 | - 'Content-Type: '.$contenttype, |
|
580 | - 'Content-Length: '.strlen($data), |
|
579 | + 'Content-Type: ' . $contenttype, |
|
580 | + 'Content-Length: ' . strlen($data), |
|
581 | 581 | 'Content-Language: en-US', |
582 | 582 | ); |
583 | 583 | |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | * @return void |
595 | 595 | */ |
596 | 596 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
597 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
597 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
598 | 598 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
599 | 599 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
600 | 600 | } |
@@ -614,9 +614,9 @@ discard block |
||
614 | 614 | if ($userroles) { |
615 | 615 | $where = ''; |
616 | 616 | foreach ($userroles as $userrole) { |
617 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$userrole->roleid; |
|
617 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
618 | 618 | } |
619 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
619 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
620 | 620 | } |
621 | 621 | return $userroles; |
622 | 622 | } |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | * @return array $users |
640 | 640 | */ |
641 | 641 | function bigbluebuttonbn_get_users(context $context = null) { |
642 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
642 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
643 | 643 | foreach ($users as $key => $value) { |
644 | 644 | $users[$key] = fullname($value); |
645 | 645 | } |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | * @return array $users |
655 | 655 | */ |
656 | 656 | function bigbluebuttonbn_get_users_select(context $context = null) { |
657 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
657 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
658 | 658 | foreach ($users as $key => $value) { |
659 | 659 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
660 | 660 | } |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | * @return array $roles |
670 | 670 | */ |
671 | 671 | function bigbluebuttonbn_get_roles(context $context = null) { |
672 | - $roles = (array) role_get_names($context); |
|
672 | + $roles = (array)role_get_names($context); |
|
673 | 673 | foreach ($roles as $key => $value) { |
674 | 674 | $roles[$key] = $value->localname; |
675 | 675 | } |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | * @return array $users |
685 | 685 | */ |
686 | 686 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
687 | - $roles = (array) role_get_names($context); |
|
687 | + $roles = (array)role_get_names($context); |
|
688 | 688 | foreach ($roles as $key => $value) { |
689 | 689 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
690 | 690 | } |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | * @return object $role |
700 | 700 | */ |
701 | 701 | function bigbluebuttonbn_get_role($id) { |
702 | - $roles = (array) role_get_names(); |
|
702 | + $roles = (array)role_get_names(); |
|
703 | 703 | if (is_numeric($id)) { |
704 | 704 | return (object)$roles[$id]; |
705 | 705 | } |
@@ -854,7 +854,7 @@ discard block |
||
854 | 854 | if (empty($userroles)) { |
855 | 855 | $userroles = get_user_roles($context, $userid, true); |
856 | 856 | } |
857 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
857 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
858 | 858 | } |
859 | 859 | |
860 | 860 | /** |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | global $DB; |
935 | 935 | if ($voicebridge != 0) { |
936 | 936 | $table = 'bigbluebuttonbn'; |
937 | - $select = 'voicebridge = '.$voicebridge; |
|
937 | + $select = 'voicebridge = ' . $voicebridge; |
|
938 | 938 | if ($DB->get_records_select($table, $select)) { |
939 | 939 | return false; |
940 | 940 | } |
@@ -1006,7 +1006,7 @@ discard block |
||
1006 | 1006 | function bigbluebuttonbn_generate_nonce() { |
1007 | 1007 | $mt = microtime(); |
1008 | 1008 | $rand = mt_rand(); |
1009 | - return md5($mt.$rand); |
|
1009 | + return md5($mt . $rand); |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | /** |
@@ -1032,21 +1032,21 @@ discard block |
||
1032 | 1032 | */ |
1033 | 1033 | function bigbluebuttonbn_events() { |
1034 | 1034 | return array( |
1035 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1036 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1037 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1038 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1039 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1040 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1041 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1042 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1043 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1044 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1045 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1046 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1047 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1048 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1049 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1035 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1036 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1037 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1038 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1039 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1040 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1041 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1042 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1043 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1044 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1045 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1046 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1047 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1048 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1049 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1050 | 1050 | ); |
1051 | 1051 | } |
1052 | 1052 | |
@@ -1057,21 +1057,21 @@ discard block |
||
1057 | 1057 | */ |
1058 | 1058 | function bigbluebuttonbn_events_action() { |
1059 | 1059 | return array( |
1060 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1061 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1062 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1063 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1064 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1065 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1066 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1067 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1068 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1069 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1070 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1071 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1072 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1073 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1074 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1060 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1061 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1062 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1063 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1064 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1065 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1066 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1067 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1068 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1069 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1070 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1071 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1072 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1073 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1074 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1075 | 1075 | ); |
1076 | 1076 | } |
1077 | 1077 | |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | if (array_key_exists('other', $options)) { |
1103 | 1103 | $eventproperties['other'] = $options['other']; |
1104 | 1104 | } |
1105 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
1105 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
1106 | 1106 | array($eventproperties)); |
1107 | 1107 | $event->trigger(); |
1108 | 1108 | } |
@@ -1142,10 +1142,10 @@ discard block |
||
1142 | 1142 | $now = time(); |
1143 | 1143 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1144 | 1144 | // Use the value in the cache. |
1145 | - return (array) json_decode($result['meeting_info']); |
|
1145 | + return (array)json_decode($result['meeting_info']); |
|
1146 | 1146 | } |
1147 | 1147 | // Ping again and refresh the cache. |
1148 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1148 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1149 | 1149 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1150 | 1150 | ); |
1151 | 1151 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | * @return object |
1241 | 1241 | */ |
1242 | 1242 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1243 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1243 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1244 | 1244 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1245 | 1245 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1246 | 1246 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1256,8 +1256,8 @@ discard block |
||
1256 | 1256 | * @return string |
1257 | 1257 | */ |
1258 | 1258 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1259 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1260 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1259 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1260 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1261 | 1261 | return $configxmlparams; |
1262 | 1262 | } |
1263 | 1263 | |
@@ -1271,7 +1271,7 @@ discard block |
||
1271 | 1271 | */ |
1272 | 1272 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1273 | 1273 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1274 | - $configxmlarray = (array) $configxml; |
|
1274 | + $configxmlarray = (array)$configxml; |
|
1275 | 1275 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1276 | 1276 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1277 | 1277 | return ''; |
@@ -1363,7 +1363,7 @@ discard block |
||
1363 | 1363 | global $USER; |
1364 | 1364 | $starttime = $starttime - ($starttime % 1000); |
1365 | 1365 | // Set formatted date. |
1366 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1366 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1367 | 1367 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1368 | 1368 | } |
1369 | 1369 | |
@@ -1479,7 +1479,7 @@ discard block |
||
1479 | 1479 | $visibility = 'hidden '; |
1480 | 1480 | } |
1481 | 1481 | $recordingpreview = html_writer::start_tag('div', |
1482 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
1482 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
1483 | 1483 | foreach ($recording['playbacks'] as $playback) { |
1484 | 1484 | if (isset($playback['preview'])) { |
1485 | 1485 | foreach ($playback['preview'] as $image) { |
@@ -1515,13 +1515,13 @@ discard block |
||
1515 | 1515 | if ($recording['published'] === 'false') { |
1516 | 1516 | $visibility = 'hidden '; |
1517 | 1517 | } |
1518 | - $id = 'playbacks-'.$recording['recordID']; |
|
1518 | + $id = 'playbacks-' . $recording['recordID']; |
|
1519 | 1519 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1520 | 1520 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1521 | 1521 | 'title' => $title, $visibility => $visibility)); |
1522 | 1522 | foreach ($recording['playbacks'] as $playback) { |
1523 | 1523 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1524 | - $playback).' '; |
|
1524 | + $playback) . ' '; |
|
1525 | 1525 | } |
1526 | 1526 | $recordingtypes .= html_writer::end_tag('div'); |
1527 | 1527 | return $recordingtypes; |
@@ -1538,12 +1538,12 @@ discard block |
||
1538 | 1538 | */ |
1539 | 1539 | function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) { |
1540 | 1540 | global $CFG, $OUTPUT; |
1541 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1541 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1542 | 1542 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
1543 | - $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid. |
|
1544 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1543 | + $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid . |
|
1544 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1545 | 1545 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1546 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1546 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1547 | 1547 | } |
1548 | 1548 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID']; |
1549 | 1549 | $linkattributes = array( |
@@ -1677,7 +1677,7 @@ discard block |
||
1677 | 1677 | $linkattributes['class'] = 'disabled'; |
1678 | 1678 | unset($linkattributes['onclick']); |
1679 | 1679 | } |
1680 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1680 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1681 | 1681 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1682 | 1682 | 'moodle', $iconattributes); |
1683 | 1683 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1794,7 +1794,7 @@ discard block |
||
1794 | 1794 | */ |
1795 | 1795 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
1796 | 1796 | $row = new html_table_row(); |
1797 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1797 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1798 | 1798 | $row->attributes['data-imported'] = 'false'; |
1799 | 1799 | $texthead = ''; |
1800 | 1800 | $texttail = ''; |
@@ -1849,9 +1849,9 @@ discard block |
||
1849 | 1849 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
1850 | 1850 | $sender = get_admin(); |
1851 | 1851 | // Prepare message. |
1852 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
1853 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
1854 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1852 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
1853 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
1854 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1855 | 1855 | $context = context_course::instance($bigbluebuttonbn->course); |
1856 | 1856 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
1857 | 1857 | } |
@@ -2049,7 +2049,7 @@ discard block |
||
2049 | 2049 | } |
2050 | 2050 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2051 | 2051 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2052 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2052 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2053 | 2053 | // Include only Create events and exclude those with record not true. |
2054 | 2054 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2055 | 2055 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2180,8 +2180,8 @@ discard block |
||
2180 | 2180 | function bigbluebuttonbn_format_activity_time($time) { |
2181 | 2181 | $activitytime = ''; |
2182 | 2182 | if ($time) { |
2183 | - $activitytime = calendar_day_representation($time).' '. |
|
2184 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2183 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2184 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2185 | 2185 | calendar_time_representation($time); |
2186 | 2186 | } |
2187 | 2187 | return $activitytime; |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | return $output; |
411 | 411 | } |
412 | 412 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
413 | - 'bigbluebuttonbn_view_general_warning')."\n"; |
|
413 | + 'bigbluebuttonbn_view_general_warning')."\n"; |
|
414 | 414 | $output .= ' '.$message."\n"; |
415 | 415 | $output .= ' <div class="singlebutton">'."\n"; |
416 | 416 | if (!empty($href)) { |
@@ -507,12 +507,12 @@ discard block |
||
507 | 507 | $recordings = bigbluebuttonbn_get_recordings( |
508 | 508 | $bbbsession['course']->id, $bigbluebuttonbnid, $enabledfeatures['showroom'], |
509 | 509 | $bbbsession['bigbluebuttonbn']->recordings_deleted |
510 | - ); |
|
510 | + ); |
|
511 | 511 | if ($enabledfeatures['importrecordings']) { |
512 | 512 | // Get recording links. |
513 | 513 | $recordingsimported = bigbluebuttonbn_get_recordings_imported_array( |
514 | 514 | $bbbsession['course']->id, $bigbluebuttonbnid, $enabledfeatures['showroom'] |
515 | - ); |
|
515 | + ); |
|
516 | 516 | /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent |
517 | 517 | * recordings are not included. */ |
518 | 518 | $recordings += $recordingsimported; |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | // JavaScript variables for recordings. |
527 | 527 | $jsvars += array( |
528 | 528 | 'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1', |
529 | - ); |
|
529 | + ); |
|
530 | 530 | // If there are meetings with recordings load the data to the table. |
531 | 531 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
532 | 532 | // Render a plain html table. |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | $jsvars += array( |
537 | 537 | 'columns' => bigbluebuttonbn_get_recording_columns($bbbsession), |
538 | 538 | 'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings), |
539 | - ); |
|
539 | + ); |
|
540 | 540 | // Render a YUI table. |
541 | 541 | return html_writer::div('', '', array('id' => 'bigbluebuttonbn_yui_table')); |
542 | 542 | } |
@@ -556,10 +556,10 @@ discard block |
||
556 | 556 | } |
557 | 557 | $button = html_writer::tag('input', '', |
558 | 558 | array('type' => 'button', |
559 | - 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
560 | - 'class' => 'btn btn-secondary', |
|
561 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
562 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
559 | + 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
|
560 | + 'class' => 'btn btn-secondary', |
|
561 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
562 | + $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
563 | 563 | $output = html_writer::start_tag('br'); |
564 | 564 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
565 | 565 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * @author Fred Dixon (ffdixon [at] blindsidenetworks [dt] com) |
25 | 25 | */ |
26 | 26 | |
27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
29 | 29 | |
30 | 30 | $id = required_param('id', PARAM_INT); |
31 | 31 | $bn = optional_param('n', 0, PARAM_INT); |
@@ -60,19 +60,19 @@ discard block |
||
60 | 60 | if (is_null($serverversion)) { |
61 | 61 | if ($bbbsession['administrator']) { |
62 | 62 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
63 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
63 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
64 | 64 | exit; |
65 | 65 | } |
66 | 66 | if ($bbbsession['moderator']) { |
67 | 67 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
68 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
68 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
69 | 69 | exit; |
70 | 70 | } |
71 | 71 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
72 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
72 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
73 | 73 | exit; |
74 | 74 | } |
75 | -$bbbsession['serverversion'] = (string) $serverversion; |
|
75 | +$bbbsession['serverversion'] = (string)$serverversion; |
|
76 | 76 | |
77 | 77 | // Mark viewed by user (if required). |
78 | 78 | $completion = new completion_info($course); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | // Print the page header. |
82 | 82 | $PAGE->set_context($context); |
83 | -$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
83 | +$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id)); |
|
84 | 84 | $PAGE->set_title(format_string($bigbluebuttonbn->name)); |
85 | 85 | $PAGE->set_cacheable(false); |
86 | 86 | $PAGE->set_heading($course->fullname); |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) { |
91 | 91 | echo $OUTPUT->header(); |
92 | 92 | if (isguestuser()) { |
93 | - echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
94 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
93 | + echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
94 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
95 | 95 | } else { |
96 | - echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'), |
|
97 | - get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id); |
|
96 | + echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'), |
|
97 | + get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id); |
|
98 | 98 | } |
99 | 99 | echo $OUTPUT->footer(); |
100 | 100 | exit; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | // Operation URLs. |
104 | 104 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
105 | -$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id . |
|
105 | +$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . |
|
106 | 106 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
107 | 107 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
108 | 108 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | echo $OUTPUT->footer(); |
123 | 123 | |
124 | 124 | // Shows version as a comment. |
125 | -echo '<!-- '.$bbbsession['originTag'].' -->'."\n"; |
|
125 | +echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n"; |
|
126 | 126 | |
127 | 127 | // Initialize session variable used across views. |
128 | 128 | $SESSION->bigbluebuttonbn_bbbsession = $bbbsession; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass; |
153 | 153 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; |
154 | 154 | // Database info related to the activity. |
155 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
155 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
156 | 156 | $bbbsession['bigbluebuttonbn']->id; |
157 | 157 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
158 | 158 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); |
173 | 173 | } |
174 | 174 | if ($bbbsession['bigbluebuttonbn']->record) { |
175 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
175 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
176 | 176 | } |
177 | 177 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; |
178 | 178 | $bbbsession['closingtime'] = $bbbsession['bigbluebuttonbn']->closingtime; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $bbbsession['originServerName'] = $parsedurl['host']; |
186 | 186 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
187 | 187 | $bbbsession['originServerCommonName'] = ''; |
188 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
188 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
189 | 189 | $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server(); |
190 | 190 | } |
191 | 191 | |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | $groupname = groups_get_group_name($bbbsession['group']); |
258 | 258 | } |
259 | 259 | // Assign group default values. |
260 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
261 | - $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']'; |
|
262 | - $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')'; |
|
260 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
261 | + $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']'; |
|
262 | + $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')'; |
|
263 | 263 | if (count($groups) == 0) { |
264 | 264 | // Only the All participants group exists. |
265 | 265 | bigbluebuttonbn_view_message_box($bbbsession, |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | return; |
272 | 272 | } |
273 | 273 | bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'), 'warning'); |
274 | - $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id; |
|
274 | + $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
|
275 | 275 | groups_print_activity_menu($bbbsession['cm'], $urltoroot); |
276 | 276 | echo '<br><br>'; |
277 | 277 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | * @param boolean $onlymoderator |
286 | 286 | * @return void |
287 | 287 | */ |
288 | -function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type='warning', $onlymoderator=false) { |
|
288 | +function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type = 'warning', $onlymoderator = false) { |
|
289 | 289 | global $OUTPUT; |
290 | 290 | if ($onlymoderator && !$bbbsession['moderator'] && !$bbbsession['administrator']) { |
291 | 291 | return; |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | 'locale' => bigbluebuttonbn_get_localcode(), 'profile_features' => $typeprofiles[0]['features']); |
319 | 319 | // Renders general warning when configured. |
320 | 320 | $cfg = \mod_bigbluebuttonbn\locallib\config::get_options(); |
321 | - $output = ''; |
|
321 | + $output = ''; |
|
322 | 322 | if (bigbluebuttonbn_view_warning_shown($bbbsession)) { |
323 | 323 | $output .= bigbluebuttonbn_view_render_warning( |
324 | 324 | (string)$cfg['general_warning_message'], |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $recordingsdisabled = get_string('view_message_recordings_disabled', 'bigbluebuttonbn'); |
343 | 343 | $output .= bigbluebuttonbn_view_render_warning($recordingsdisabled, 'danger'); |
344 | 344 | } |
345 | - echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br'); |
|
345 | + echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br'); |
|
346 | 346 | $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars)); |
347 | 347 | } |
348 | 348 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | * |
403 | 403 | * @return string |
404 | 404 | */ |
405 | -function bigbluebuttonbn_view_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
405 | +function bigbluebuttonbn_view_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
406 | 406 | global $OUTPUT; |
407 | 407 | $output = "\n"; |
408 | 408 | // Evaluates if config_warning is enabled. |
@@ -410,14 +410,14 @@ discard block |
||
410 | 410 | return $output; |
411 | 411 | } |
412 | 412 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
413 | - 'bigbluebuttonbn_view_general_warning')."\n"; |
|
414 | - $output .= ' '.$message."\n"; |
|
415 | - $output .= ' <div class="singlebutton">'."\n"; |
|
413 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
414 | + $output .= ' ' . $message . "\n"; |
|
415 | + $output .= ' <div class="singlebutton">' . "\n"; |
|
416 | 416 | if (!empty($href)) { |
417 | 417 | $output .= bigbluebuttonbn_view_render_warning_button($href, $text, $class); |
418 | 418 | } |
419 | - $output .= ' </div>'."\n"; |
|
420 | - $output .= $OUTPUT->box_end()."\n"; |
|
419 | + $output .= ' </div>' . "\n"; |
|
420 | + $output .= $OUTPUT->box_end() . "\n"; |
|
421 | 421 | return $output; |
422 | 422 | } |
423 | 423 | |
@@ -437,11 +437,11 @@ discard block |
||
437 | 437 | if ($class == '') { |
438 | 438 | $class = 'btn btn-secondary'; |
439 | 439 | } |
440 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
441 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
442 | - $output .= ' title=""'."\n"; |
|
443 | - $output .= ' >' . $text . '</button>'."\n"; |
|
444 | - $output .= ' </form>'."\n"; |
|
440 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
441 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
442 | + $output .= ' title=""' . "\n"; |
|
443 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
444 | + $output .= ' </form>' . "\n"; |
|
445 | 445 | return $output; |
446 | 446 | } |
447 | 447 | |
@@ -459,12 +459,12 @@ discard block |
||
459 | 459 | // JavaScript variables for room. |
460 | 460 | $openingtime = ''; |
461 | 461 | if ($bbbsession['openingtime']) { |
462 | - $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '. |
|
462 | + $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' . |
|
463 | 463 | userdate($bbbsession['openingtime']); |
464 | 464 | } |
465 | 465 | $closingtime = ''; |
466 | 466 | if ($bbbsession['closingtime']) { |
467 | - $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '. |
|
467 | + $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' . |
|
468 | 468 | userdate($bbbsession['closingtime']); |
469 | 469 | } |
470 | 470 | $jsvars += array( |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | $output .= $OUTPUT->box_end(); |
482 | 482 | // Action button box. |
483 | 483 | $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box'); |
484 | - $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>'."\n"; |
|
484 | + $output .= '<br><br><span id="join_button"></span> <span id="end_button"></span>' . "\n"; |
|
485 | 485 | $output .= $OUTPUT->box_end(); |
486 | 486 | if ($activity == 'ended') { |
487 | 487 | $output .= bigbluebuttonbn_view_ended($bbbsession); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | // If there are meetings with recordings load the data to the table. |
531 | 531 | if ($bbbsession['bigbluebuttonbn']->recordings_html) { |
532 | 532 | // Render a plain html table. |
533 | - return bigbluebuttonbn_output_recording_table($bbbsession, $recordings)."\n"; |
|
533 | + return bigbluebuttonbn_output_recording_table($bbbsession, $recordings) . "\n"; |
|
534 | 534 | } |
535 | 535 | // JavaScript variables for recordings with YUI. |
536 | 536 | $jsvars += array( |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | array('type' => 'button', |
559 | 559 | 'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'), |
560 | 560 | 'class' => 'btn btn-secondary', |
561 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='. |
|
562 | - $bbbsession['bigbluebuttonbn']->id.'\'')); |
|
561 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' . |
|
562 | + $bbbsession['bigbluebuttonbn']->id . '\'')); |
|
563 | 563 | $output = html_writer::start_tag('br'); |
564 | 564 | $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button')); |
565 | 565 | $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table')); |
@@ -578,10 +578,10 @@ discard block |
||
578 | 578 | if (!is_null($bbbsession['presentation']['url'])) { |
579 | 579 | $attributes = array('title' => $bbbsession['presentation']['name']); |
580 | 580 | $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']); |
581 | - return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'. |
|
582 | - $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false). |
|
581 | + return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' . |
|
582 | + $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . |
|
583 | 583 | $OUTPUT->action_link($bbbsession['presentation']['url'], |
584 | - $bbbsession['presentation']['name'], null, $attributes).'<br><br>'; |
|
584 | + $bbbsession['presentation']['name'], null, $attributes) . '<br><br>'; |
|
585 | 585 | } |
586 | 586 | return ''; |
587 | 587 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * are 1=checked, 0=unchecked. |
69 | 69 | **/ |
70 | 70 | |
71 | - /* When the value is set to 0 (unchecked) the all the features for recordings |
|
71 | + /* When the value is set to 0 (unchecked) the all the features for recordings |
|
72 | 72 | * are ignored. Recording features are enabled by default. |
73 | 73 | * $CFG->bigbluebuttonbn['recordings_enabled'] = 1; |
74 | 74 | */ |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * recordings from a different activity even from a different course. |
99 | 99 | **/ |
100 | 100 | |
101 | - /* |
|
101 | + /* |
|
102 | 102 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
103 | 103 | * activities will have the 'import recordings' capability enabled. |
104 | 104 | * $CFG->bigbluebuttonbn['importrecordings_enabled'] = 0; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * 'Join session' button enabled |
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 'wait for moderator' capability enabled by |
125 | 125 | * default. |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * 5. CONFIGURATION FOR "STATIC VOICE BRIDGE" FEATURE |
154 | 154 | * |
155 | 155 | **/ |
156 | - /* |
|
156 | + /* |
|
157 | 157 | * A conference voice bridge number can be permanently assigned to a room |
158 | 158 | * or activity. |
159 | 159 | * $CFG->bigbluebuttonbn['voicebridge_editable'] = 0; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * 6. CONFIGURATION FOR "PRE-UPLOAD PRESENTATION" FEATURE |
164 | 164 | * |
165 | 165 | **/ |
166 | - /* |
|
166 | + /* |
|
167 | 167 | * Since version 0.8, BigBluebutton has an implementation for allowing |
168 | 168 | * preuploading presentation. When this feature is enabled, users creating or |
169 | 169 | * editing a room or activity can upload a PDF or Office document to the |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * applied to each room or activity, or globally. |
181 | 181 | **/ |
182 | 182 | |
183 | - /* |
|
183 | + /* |
|
184 | 184 | * The number of users allowed in a session by default when a new room or |
185 | 185 | * conference is added. If the number is set to 0, no limit is established. |
186 | 186 | * $CFG->bigbluebuttonbn['userlimit_default'] = 0; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * By default only the owner is assigned. |
202 | 202 | **/ |
203 | 203 | |
204 | - /* |
|
204 | + /* |
|
205 | 205 | * The values for this parameter can be '0' (which identifies the owner) and/or any of the role IDs defined in |
206 | 206 | * Moodle (including the custom parameters). The value used will be the key for the role. |
207 | 207 | * [owner=0|manager=1|coursecreator=2|editingteacher=3|teacher=4|student=5|guest=6|user=7|frontpage=8|ANY_CUSTOM_ROLE=xx] |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * 9. CONFIGURATION FOR "NOTIFICATION SENDING" FEATURE |
213 | 213 | * |
214 | 214 | **/ |
215 | - /* |
|
215 | + /* |
|
216 | 216 | * When the value is set to 1 (checked) the 'notification sending' |
217 | 217 | * capability can be used by the user creating or editing the room or |
218 | 218 | * activity. |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * 10. CONFIGURATION FOR "RECORDING READY" FEATURE |
227 | 227 | * |
228 | 228 | **/ |
229 | - /* |
|
229 | + /* |
|
230 | 230 | * When the value is set to 1 (checked) the 'notify users when recording ready' |
231 | 231 | * capability is enabled, meaning that a message will be sent to all enrolled |
232 | 232 | * users in a course when a recording is ready |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | * 12. GENERAL CONFIGURATION FOR RECORDINGS UI |
251 | 251 | * |
252 | 252 | **/ |
253 | - /* |
|
253 | + /* |
|
254 | 254 | * When the value is set to 1 (checked) the bigbluebuttonbn resources |
255 | 255 | * will show the recodings in an html table by default. |
256 | 256 | * $CFG->bigbluebuttonbn['recordings_html_default'] = 0; |
@@ -274,22 +274,22 @@ discard block |
||
274 | 274 | * $CFG->bigbluebuttonbn['recordings_deleted_editable'] = 0; |
275 | 275 | */ |
276 | 276 | |
277 | - /* |
|
277 | + /* |
|
278 | 278 | * When the value is set to 1 (checked) the bigbluebuttonbn resources for recordings |
279 | 279 | * will show only the imported links as part of the list. |
280 | 280 | * $CFG->bigbluebuttonbn['recordings_imported_default'] = 0; |
281 | 281 | */ |
282 | 282 | |
283 | - /* |
|
283 | + /* |
|
284 | 284 | * When the value is set to 1 (checked) the 'show only imported links' |
285 | 285 | * capability can be enabled/disabled by the user creating or editing the resource for recordings. |
286 | 286 | * $CFG->bigbluebuttonbn['recordings_imported_editable'] = 1; |
287 | 287 | */ |
288 | 288 | |
289 | - /* |
|
289 | + /* |
|
290 | 290 | * CONFIGURATION FOR FEATURES OFFERED BY BN SERVERS |
291 | 291 | ** ------------------------------------------------------------------ **/ |
292 | - /* |
|
292 | + /* |
|
293 | 293 | * When general_warning_message value is different than "", the string is shown |
294 | 294 | * as a warning message to privileged users (administrators and Teachers or users allowed to edit). |
295 | 295 | * $CFG->bigbluebuttonbn['general_warning_message'] = "Would you like to record your BigBlueButton sessions for later viewing? "; |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public static function defaultvalues() { |
57 | 57 | return array( |
58 | - 'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
59 | - 'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
58 | + 'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
59 | + 'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
60 | 60 | 'voicebridge_editable' => 'false', |
61 | 61 | 'importrecordings_enabled' => 'false', |
62 | 62 | 'importrecordings_from_deleted_enabled' => 'false', |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | if (isset($CFG->bigbluebuttonbn[$setting])) { |
120 | 120 | return (string)$CFG->bigbluebuttonbn[$setting]; |
121 | 121 | } |
122 | - if (isset($CFG->{'bigbluebuttonbn_'.$setting})) { |
|
123 | - return (string)$CFG->{'bigbluebuttonbn_'.$setting}; |
|
122 | + if (isset($CFG->{'bigbluebuttonbn_' . $setting})) { |
|
123 | + return (string)$CFG->{'bigbluebuttonbn_' . $setting}; |
|
124 | 124 | } |
125 | 125 | return self::defaultvalue($setting); |
126 | 126 | } |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
24 | 24 | */ |
25 | 25 | |
26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
28 | 28 | |
29 | 29 | use \Firebase\JWT\JWT; |
30 | 30 | |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
41 | 41 | |
42 | 42 | if (empty($params['action'])) { |
43 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
43 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
44 | 44 | return; |
45 | 45 | } |
46 | 46 | |
47 | 47 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
48 | 48 | if (!empty($error)) { |
49 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
49 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm); |
131 | 131 | return; |
132 | 132 | } |
133 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
133 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
134 | 134 | return; |
135 | 135 | |
136 | 136 | } catch (Exception $e) { |
137 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
137 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
321 | 321 | $callbackresponse['status'] = true; |
322 | 322 | $callbackresponse['found'] = true; |
323 | - $callbackresponse['published'] = (string) $recording['published']; |
|
323 | + $callbackresponse['published'] = (string)$recording['published']; |
|
324 | 324 | if (!isset($params['meta']) || empty($params['meta'])) { |
325 | 325 | return $callbackresponse; |
326 | 326 | } |
@@ -650,8 +650,8 @@ discard block |
||
650 | 650 | $decodedparameters = JWT::decode($params['signed_parameters'], |
651 | 651 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
652 | 652 | } catch (Exception $e) { |
653 | - $error = 'Caught exception: '.$e->getMessage(); |
|
654 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
653 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
654 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
655 | 655 | return; |
656 | 656 | } |
657 | 657 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -667,8 +667,8 @@ discard block |
||
667 | 667 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
668 | 668 | header('HTTP/1.0 202 Accepted'); |
669 | 669 | } catch (Exception $e) { |
670 | - $error = 'Caught exception: '.$e->getMessage(); |
|
671 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
670 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
671 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
672 | 672 | } |
673 | 673 | } |
674 | 674 | |
@@ -689,13 +689,13 @@ discard block |
||
689 | 689 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
690 | 690 | if (!isset($importrecordings[$params['id']])) { |
691 | 691 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
692 | - header('HTTP/1.0 404 Not found. '.$error); |
|
692 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
693 | 693 | return; |
694 | 694 | } |
695 | 695 | $callbackresponse = array('status' => true); |
696 | 696 | $importrecordings[$params['id']]['imported'] = true; |
697 | 697 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
698 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
698 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
699 | 699 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
700 | 700 | // Moodle event logger: Create an event for recording imported. |
701 | 701 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -721,8 +721,8 @@ discard block |
||
721 | 721 | $decodedparameters = JWT::decode($params['signed_parameters'], |
722 | 722 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
723 | 723 | } catch (Exception $e) { |
724 | - $error = 'Caught exception: '.$e->getMessage(); |
|
725 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
724 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
725 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
726 | 726 | return; |
727 | 727 | } |
728 | 728 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | } |
764 | 764 | $action = strtolower($params['action']); |
765 | 765 | if (!array_key_exists($action, $requiredparams)) { |
766 | - return 'Action '.$params['action'].' can not be performed.'; |
|
766 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
767 | 767 | } |
768 | 768 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
769 | 769 | } |