@@ -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 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | if (isset($meta)) { |
83 | 83 | $log->meta = $meta; |
84 | 84 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
85 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
85 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | |
127 | 127 | if (!is_null($pname) && !is_null($purl)) { |
128 | 128 | $method = BIGBLUEBUTTONBN_METHOD_POST; |
129 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
130 | - $purl."' /></module></modules>"; |
|
129 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
130 | + $purl . "' /></module></modules>"; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | 'moderatorPW' => $meeting->moderatorPW, |
173 | 173 | 'attendeePW' => $meeting->attendeePW, |
174 | 174 | 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, |
175 | - 'running' => $meeting->running, ); |
|
175 | + 'running' => $meeting->running,); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | return $meetings; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | // Override imported flag with actual ID. |
330 | 330 | $recording['imported'] = $recordimported->id; |
331 | 331 | if (isset($recordimported->protected)) { |
332 | - $recording['protected'] = (string) $recordimported->protected; |
|
332 | + $recording['protected'] = (string)$recordimported->protected; |
|
333 | 333 | } |
334 | 334 | $recordsimportedarray[$recording['recordID']] = $recording; |
335 | 335 | } |
@@ -348,37 +348,37 @@ discard block |
||
348 | 348 | function bigbluebuttonbn_get_default_config_xml_array() { |
349 | 349 | $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML(); |
350 | 350 | |
351 | - return (array) $defaultconfigxml; |
|
351 | + return (array)$defaultconfigxml; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | function bigbluebuttonbn_get_recording_array_value($recording) { |
355 | 355 | // Add formats. |
356 | 356 | $playbackarray = array(); |
357 | 357 | foreach ($recording->playback->format as $format) { |
358 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
359 | - 'url' => (string) $format->url, 'length' => (string) $format->length); |
|
358 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
359 | + 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
360 | 360 | // Add preview per format when existing. |
361 | 361 | if ($format->preview) { |
362 | 362 | $imagesarray = array(); |
363 | 363 | foreach ($format->preview->images->image as $image) { |
364 | - $imagearray = array('url' => (string) $image); |
|
364 | + $imagearray = array('url' => (string)$image); |
|
365 | 365 | foreach ($image->attributes() as $attkey => $attvalue) { |
366 | - $imagearray[$attkey] = (string) $attvalue; |
|
366 | + $imagearray[$attkey] = (string)$attvalue; |
|
367 | 367 | } |
368 | 368 | array_push($imagesarray, $imagearray); |
369 | 369 | } |
370 | - $playbackarray[(string) $format->type]['preview'] = $imagesarray; |
|
370 | + $playbackarray[(string)$format->type]['preview'] = $imagesarray; |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
374 | 374 | // Add the metadata to the recordings array. |
375 | 375 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
376 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
377 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
378 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
379 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
376 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
377 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
378 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
379 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
380 | 380 | if (isset($recording->protected)) { |
381 | - $recordingarray['protected'] = (string) $recording->protected; |
|
381 | + $recordingarray['protected'] = (string)$recording->protected; |
|
382 | 382 | } |
383 | 383 | return $recordingarray + $metadataarray; |
384 | 384 | } |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | if (is_object($value)) { |
390 | 390 | $value = ''; |
391 | 391 | } |
392 | - $metadataarray['meta_'.$key] = $value; |
|
392 | + $metadataarray['meta_' . $key] = $value; |
|
393 | 393 | } |
394 | 394 | return $metadataarray; |
395 | 395 | } |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | $ids = explode(',', $recordids); |
448 | 448 | foreach ($ids as $id) { |
449 | 449 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
450 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
450 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
451 | 451 | ); |
452 | 452 | if ($xml && $xml->returncode != 'SUCCESS') { |
453 | 453 | return false; |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | return $xml; |
525 | 525 | } catch (Exception $e) { |
526 | 526 | libxml_use_internal_errors($previous); |
527 | - $error = 'Caught exception: '.$e->getMessage(); |
|
527 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
528 | 528 | debugging($error, DEBUG_DEVELOPER); |
529 | 529 | return null; |
530 | 530 | } |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
537 | 537 | return $response; |
538 | 538 | } catch (Exception $e) { |
539 | - $error = 'Caught exception: '.$e->getMessage(); |
|
539 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
540 | 540 | debugging($error, DEBUG_DEVELOPER); |
541 | 541 | libxml_use_internal_errors($previous); |
542 | 542 | return null; |
@@ -554,8 +554,8 @@ discard block |
||
554 | 554 | |
555 | 555 | $options = array(); |
556 | 556 | $options['CURLOPT_HTTPHEADER'] = array( |
557 | - 'Content-Type: '.$contenttype, |
|
558 | - 'Content-Length: '.strlen($data), |
|
557 | + 'Content-Type: ' . $contenttype, |
|
558 | + 'Content-Length: ' . strlen($data), |
|
559 | 559 | 'Content-Language: en-US', |
560 | 560 | ); |
561 | 561 | |
@@ -572,9 +572,9 @@ discard block |
||
572 | 572 | if ($userroles) { |
573 | 573 | $where = ''; |
574 | 574 | foreach ($userroles as $value) { |
575 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$value->roleid; |
|
575 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $value->roleid; |
|
576 | 576 | } |
577 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
577 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
578 | 578 | } |
579 | 579 | |
580 | 580 | return $userroles; |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | } |
588 | 588 | |
589 | 589 | function bigbluebuttonbn_get_users(context $context = null) { |
590 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
590 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
591 | 591 | foreach ($users as $key => $value) { |
592 | 592 | $users[$key] = fullname($value); |
593 | 593 | } |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | } |
596 | 596 | |
597 | 597 | function bigbluebuttonbn_get_users_select(context $context = null) { |
598 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
598 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
599 | 599 | foreach ($users as $key => $value) { |
600 | 600 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
601 | 601 | } |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | } |
604 | 604 | |
605 | 605 | function bigbluebuttonbn_get_roles(context $context = null) { |
606 | - $roles = (array) role_get_names($context); |
|
606 | + $roles = (array)role_get_names($context); |
|
607 | 607 | foreach ($roles as $key => $value) { |
608 | 608 | $roles[$key] = $value->localname; |
609 | 609 | } |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | } |
612 | 612 | |
613 | 613 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
614 | - $roles = (array) role_get_names($context); |
|
614 | + $roles = (array)role_get_names($context); |
|
615 | 615 | foreach ($roles as $key => $value) { |
616 | 616 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
617 | 617 | } |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | } |
620 | 620 | |
621 | 621 | function bigbluebuttonbn_get_role($id) { |
622 | - $roles = (array) role_get_names(); |
|
622 | + $roles = (array)role_get_names(); |
|
623 | 623 | if (is_numeric($id)) { |
624 | 624 | return (object)$roles[$id]; |
625 | 625 | } |
@@ -699,11 +699,11 @@ discard block |
||
699 | 699 | return array(); |
700 | 700 | } |
701 | 701 | foreach ($rules as $key => $rule) { |
702 | - if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) { |
|
702 | + if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) { |
|
703 | 703 | continue; |
704 | 704 | } |
705 | 705 | $role = bigbluebuttonbn_get_role($rule['selectionid']); |
706 | - if ( $role == null ) { |
|
706 | + if ($role == null) { |
|
707 | 707 | unset($rules[$key]); |
708 | 708 | continue; |
709 | 709 | } |
@@ -742,10 +742,10 @@ discard block |
||
742 | 742 | if (empty($userroles)) { |
743 | 743 | $userroles = get_user_roles($context, $userid, true); |
744 | 744 | } |
745 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
745 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
746 | 746 | } |
747 | 747 | |
748 | -function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) { |
|
748 | +function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) { |
|
749 | 749 | // Iterate participant rules. |
750 | 750 | foreach ($participantlist as $participant) { |
751 | 751 | if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) { |
@@ -790,9 +790,9 @@ discard block |
||
790 | 790 | $isunique = true; |
791 | 791 | if ($voicebridge != 0) { |
792 | 792 | $table = 'bigbluebuttonbn'; |
793 | - $select = 'voicebridge = '.$voicebridge; |
|
793 | + $select = 'voicebridge = ' . $voicebridge; |
|
794 | 794 | if ($id) { |
795 | - $select .= ' AND id <> '.$id; |
|
795 | + $select .= ' AND id <> ' . $id; |
|
796 | 796 | } |
797 | 797 | if ($DB->get_records_select($table, $select)) { |
798 | 798 | $isunique = false; |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | function bigbluebuttonbn_generate_nonce() { |
850 | 850 | $mt = microtime(); |
851 | 851 | $rand = mt_rand(); |
852 | - return md5($mt.$rand); |
|
852 | + return md5($mt . $rand); |
|
853 | 853 | } |
854 | 854 | |
855 | 855 | function bigbluebuttonbn_random_password($length = 8) { |
@@ -860,41 +860,41 @@ discard block |
||
860 | 860 | |
861 | 861 | function bigbluebuttonbn_events() { |
862 | 862 | return array( |
863 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
864 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
865 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
866 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
867 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
868 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
869 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
870 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
871 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
872 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
873 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
874 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
875 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
876 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
877 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
863 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
864 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
865 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
866 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
867 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
868 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
869 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
870 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
871 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
872 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
873 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
874 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
875 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
876 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
877 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
878 | 878 | ); |
879 | 879 | } |
880 | 880 | |
881 | 881 | function bigbluebuttonbn_events_action() { |
882 | 882 | return array( |
883 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
884 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
885 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
886 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
887 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
888 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
889 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
890 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
891 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
892 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
893 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
894 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
895 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
896 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
897 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
883 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
884 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
885 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
886 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
887 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
888 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
889 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
890 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
891 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
892 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
893 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
894 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
895 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
896 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
897 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
898 | 898 | ); |
899 | 899 | } |
900 | 900 | |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | if (array_key_exists('other', $options)) { |
916 | 916 | $eventproperties['other'] = $options['other']; |
917 | 917 | } |
918 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
918 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
919 | 919 | array($eventproperties)); |
920 | 920 | $event->trigger(); |
921 | 921 | } |
@@ -956,10 +956,10 @@ discard block |
||
956 | 956 | $now = time(); |
957 | 957 | if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
958 | 958 | // Use the value in the cache. |
959 | - return (array) json_decode($result['meeting_info']); |
|
959 | + return (array)json_decode($result['meeting_info']); |
|
960 | 960 | } |
961 | 961 | // Ping again and refresh the cache. |
962 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
962 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
963 | 963 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
964 | 964 | ); |
965 | 965 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1034,8 +1034,8 @@ discard block |
||
1034 | 1034 | * @param string $configxml |
1035 | 1035 | */ |
1036 | 1036 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1037 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1038 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1037 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1038 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1039 | 1039 | return $configxmlparams; |
1040 | 1040 | } |
1041 | 1041 | |
@@ -1044,7 +1044,7 @@ discard block |
||
1044 | 1044 | * @param string $configxml |
1045 | 1045 | */ |
1046 | 1046 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1047 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1047 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1048 | 1048 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1049 | 1049 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST, |
1050 | 1050 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | */ |
1058 | 1058 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1059 | 1059 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1060 | - $configxmlarray = (array) $configxml; |
|
1060 | + $configxmlarray = (array)$configxml; |
|
1061 | 1061 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1062 | 1062 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1063 | 1063 | return ''; |
@@ -1107,7 +1107,7 @@ discard block |
||
1107 | 1107 | global $USER; |
1108 | 1108 | $starttime = $starttime - ($starttime % 1000); |
1109 | 1109 | // Set formatted date. |
1110 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1110 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1111 | 1111 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1112 | 1112 | } |
1113 | 1113 | |
@@ -1123,7 +1123,7 @@ discard block |
||
1123 | 1123 | function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) { |
1124 | 1124 | $actionbar = ''; |
1125 | 1125 | foreach ($tools as $tool) { |
1126 | - if ( $tool == 'protect' && !isset($recording['protected']) ) { |
|
1126 | + if ($tool == 'protect' && !isset($recording['protected'])) { |
|
1127 | 1127 | continue; |
1128 | 1128 | } |
1129 | 1129 | $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool); |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | $visibility = 'hidden '; |
1168 | 1168 | } |
1169 | 1169 | $recordingpreview = html_writer::start_tag('div', |
1170 | - array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility)); |
|
1170 | + array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility)); |
|
1171 | 1171 | foreach ($recording['playbacks'] as $playback) { |
1172 | 1172 | if (isset($playback['preview'])) { |
1173 | 1173 | foreach ($playback['preview'] as $image) { |
@@ -1195,13 +1195,13 @@ discard block |
||
1195 | 1195 | if ($recording['published'] === 'false') { |
1196 | 1196 | $visibility = 'hidden '; |
1197 | 1197 | } |
1198 | - $id = 'playbacks-'.$recording['recordID']; |
|
1198 | + $id = 'playbacks-' . $recording['recordID']; |
|
1199 | 1199 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1200 | 1200 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1201 | 1201 | 'title' => $title, $visibility => $visibility)); |
1202 | 1202 | foreach ($recording['playbacks'] as $playback) { |
1203 | 1203 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, |
1204 | - $playback).' '; |
|
1204 | + $playback) . ' '; |
|
1205 | 1205 | } |
1206 | 1206 | $recordingtypes .= html_writer::end_tag('div'); |
1207 | 1207 | return $recordingtypes; |
@@ -1209,12 +1209,12 @@ discard block |
||
1209 | 1209 | |
1210 | 1210 | function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) { |
1211 | 1211 | global $CFG, $OUTPUT; |
1212 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1212 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1213 | 1213 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);'; |
1214 | - $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid. |
|
1215 | - '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type']; |
|
1214 | + $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn=' . $bigbluebuttonbnid . |
|
1215 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1216 | 1216 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1217 | - $href .= '&href='.urlencode($playback['url']); |
|
1217 | + $href .= '&href=' . urlencode($playback['url']); |
|
1218 | 1218 | } |
1219 | 1219 | $linkattributes = array('title' => $title, |
1220 | 1220 | 'class' => 'btn btn-sm btn-default', 'onclick' => $onclick, |
@@ -1302,11 +1302,11 @@ discard block |
||
1302 | 1302 | $target .= '-' . $data['target']; |
1303 | 1303 | } |
1304 | 1304 | $id = 'recording-' . $target . '-' . $recording['recordID']; |
1305 | - $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);'; |
|
1305 | + $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);'; |
|
1306 | 1306 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) { |
1307 | 1307 | // With icon for $manageaction. |
1308 | 1308 | $iconattributes = array('id' => $id, 'class' => 'iconsmall'); |
1309 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1309 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1310 | 1310 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1311 | 1311 | 'moodle', $iconattributes); |
1312 | 1312 | $linkattributes = array( |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { |
1398 | 1398 | // There are recordings for this meeting. |
1399 | 1399 | foreach ($recordings as $recording) { |
1400 | - if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) { |
|
1400 | + if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
|
1401 | 1401 | continue; |
1402 | 1402 | } |
1403 | 1403 | bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table); |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | } |
1416 | 1416 | |
1417 | 1417 | $row = new html_table_row(); |
1418 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1418 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1419 | 1419 | $row->attributes['data-imported'] = 'false'; |
1420 | 1420 | $texthead = ''; |
1421 | 1421 | $texttail = ''; |
@@ -1439,7 +1439,7 @@ discard block |
||
1439 | 1439 | } |
1440 | 1440 | |
1441 | 1441 | function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) { |
1442 | - if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) { |
|
1442 | + if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) { |
|
1443 | 1443 | return true; |
1444 | 1444 | } |
1445 | 1445 | return false; |
@@ -1454,9 +1454,9 @@ discard block |
||
1454 | 1454 | // Build the message_body. |
1455 | 1455 | $msg->activity_type = ''; |
1456 | 1456 | $msg->activity_title = $bigbluebuttonbn->name; |
1457 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '. |
|
1458 | - $msg->activity_type.' "'.$msg->activity_title.'" '. |
|
1459 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1457 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . |
|
1458 | + $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
1459 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1460 | 1460 | |
1461 | 1461 | bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext); |
1462 | 1462 | } |
@@ -1554,15 +1554,15 @@ discard block |
||
1554 | 1554 | |
1555 | 1555 | function bigbluebuttonbn_get_recordings_sql_selectdeleted($courseid, $bigbluebuttonbnid = null, $subset = true) { |
1556 | 1556 | if ($bigbluebuttonbnid === null) { |
1557 | - return "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1557 | + return "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1558 | 1558 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1559 | 1559 | } |
1560 | 1560 | if ($subset) { |
1561 | - return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE. |
|
1561 | + return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . |
|
1562 | 1562 | "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
1563 | 1563 | } |
1564 | - return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '". |
|
1565 | - BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1564 | + return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" . |
|
1565 | + BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'"; |
|
1566 | 1566 | } |
1567 | 1567 | |
1568 | 1568 | function bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid = null, $subset = true, |
@@ -1611,7 +1611,7 @@ discard block |
||
1611 | 1611 | |
1612 | 1612 | // Prepare select for loading records based on existent bigbluebuttonbns. |
1613 | 1613 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
1614 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
1614 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
1615 | 1615 | // Include only Create events and exclude those with record not true. |
1616 | 1616 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
1617 | 1617 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -1695,8 +1695,8 @@ discard block |
||
1695 | 1695 | function bigbluebuttonbn_format_activity_time($time) { |
1696 | 1696 | $activitytime = ''; |
1697 | 1697 | if ($time) { |
1698 | - $activitytime = calendar_day_representation($time).' '. |
|
1699 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
1698 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
1699 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
1700 | 1700 | calendar_time_representation($time); |
1701 | 1701 | } |
1702 | 1702 |