Completed
Push — master ( 87b1fe...8fafcf )
by Jesus
02:39
created
locallib.php 1 patch
Spacing   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
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
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     if (isset($meta)) {
77 77
         $log->meta = $meta;
78 78
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
79
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
79
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
80 80
     }
81 81
 
82 82
     $DB->insert_record('bigbluebuttonbn_logs', $log);
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 
122 122
     if (!is_null($pname) && !is_null($purl)) {
123 123
         $method = BIGBLUEBUTTONBN_METHOD_POST;
124
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='".
125
-            $purl."' /></module></modules>";
124
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='" .
125
+            $purl . "' /></module></modules>";
126 126
     }
127 127
 
128 128
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                                 'moderatorPW' => $meeting->moderatorPW,
168 168
                                 'attendeePW' => $meeting->attendeePW,
169 169
                                 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded,
170
-                                'running' => $meeting->running, );
170
+                                'running' => $meeting->running,);
171 171
         }
172 172
 
173 173
         return $meetings;
@@ -308,12 +308,12 @@  discard block
 block discarded – undo
308 308
 function bigbluebuttonbn_get_recordings_imported_array($courseid, $bigbluebuttonbnid = null, $subset = true) {
309 309
     global $DB;
310 310
 
311
-    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
312
-        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
311
+    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
312
+        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
313 313
     if ($bigbluebuttonbnid === null) {
314
-        $select = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
314
+        $select = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
315 315
     } else if ($subset) {
316
-        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
316
+        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
317 317
     }
318 318
     $recordsimported = $DB->get_records_select('bigbluebuttonbn_logs', $select);
319 319
 
@@ -340,37 +340,37 @@  discard block
 block discarded – undo
340 340
 function bigbluebuttonbn_get_default_config_xml_array() {
341 341
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
342 342
 
343
-    return (array) $defaultconfigxml;
343
+    return (array)$defaultconfigxml;
344 344
 }
345 345
 
346 346
 function bigbluebuttonbn_get_recording_array_value($recording) {
347 347
     // Add formats.
348 348
     $playbackarray = array();
349 349
     foreach ($recording->playback->format as $format) {
350
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
351
-            'url' => (string) $format->url, 'length' => (string) $format->length);
350
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
351
+            'url' => (string)$format->url, 'length' => (string)$format->length);
352 352
         // Add preview per format when existing.
353 353
         if ($format->preview) {
354 354
             $imagesarray = array();
355 355
             foreach ($format->preview->images->image as $image) {
356
-                $imagearray = array('url' => (string) $image);
356
+                $imagearray = array('url' => (string)$image);
357 357
                 foreach ($image->attributes() as $attkey => $attvalue) {
358
-                    $imagearray[$attkey] = (string) $attvalue;
358
+                    $imagearray[$attkey] = (string)$attvalue;
359 359
                 }
360 360
                 array_push($imagesarray, $imagearray);
361 361
             }
362
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
362
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
363 363
         }
364 364
     }
365 365
 
366 366
     // Add the metadata to the recordings array.
367 367
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
368
-    $recordingarray = array('recordID' => (string) $recording->recordID,
369
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
370
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
371
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
368
+    $recordingarray = array('recordID' => (string)$recording->recordID,
369
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
370
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
371
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
372 372
     if (isset($recording->protected)) {
373
-        $recordingarray['protected'] = (string) $recording->protected;
373
+        $recordingarray['protected'] = (string)$recording->protected;
374 374
     }
375 375
     // Force protected.
376 376
     $recordingarray['protected'] = 'false';
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         if (is_object($value)) {
384 384
             $value = '';
385 385
         }
386
-        $metadataarray['meta_'.$key] = $value;
386
+        $metadataarray['meta_' . $key] = $value;
387 387
     }
388 388
     return $metadataarray;
389 389
 }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     $ids = explode(',', $recordids);
442 442
     foreach ($ids as $id) {
443 443
         $xml = bigbluebuttonbn_wrap_xml_load_file(
444
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
444
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
445 445
           );
446 446
         if ($xml && $xml->returncode != 'SUCCESS') {
447 447
             return false;
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
             return $xml;
562 562
         } catch (Exception $e) {
563 563
             libxml_use_internal_errors($previous);
564
-            $error = 'Caught exception: '.$e->getMessage();
564
+            $error = 'Caught exception: ' . $e->getMessage();
565 565
             debugging($error, DEBUG_DEVELOPER);
566 566
             return null;
567 567
         }
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
574 574
         return $response;
575 575
     } catch (Exception $e) {
576
-        $error = 'Caught exception: '.$e->getMessage();
576
+        $error = 'Caught exception: ' . $e->getMessage();
577 577
         debugging($error, DEBUG_DEVELOPER);
578 578
         libxml_use_internal_errors($previous);
579 579
         return null;
@@ -591,8 +591,8 @@  discard block
 block discarded – undo
591 591
 
592 592
         $options = array();
593 593
         $options['CURLOPT_HTTPHEADER'] = array(
594
-                 'Content-Type: '.$contenttype,
595
-                 'Content-Length: '.strlen($data),
594
+                 'Content-Type: ' . $contenttype,
595
+                 'Content-Length: ' . strlen($data),
596 596
                  'Content-Language: en-US',
597 597
                );
598 598
 
@@ -609,9 +609,9 @@  discard block
 block discarded – undo
609 609
     if ($userroles) {
610 610
         $where = '';
611 611
         foreach ($userroles as $value) {
612
-            $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid;
612
+            $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid;
613 613
         }
614
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
614
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
615 615
     }
616 616
 
617 617
     return $userroles;
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 }
625 625
 
626 626
 function bigbluebuttonbn_get_users(context $context = null) {
627
-    $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
627
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
628 628
     foreach ($users as $key => $value) {
629 629
         $users[$key] = fullname($value);
630 630
     }
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 }
633 633
 
634 634
 function bigbluebuttonbn_get_users_select(context $context = null) {
635
-    $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
635
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
636 636
     foreach ($users as $key => $value) {
637 637
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
638 638
     }
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 }
641 641
 
642 642
 function bigbluebuttonbn_get_roles(context $context = null) {
643
-    $roles = (array) role_get_names($context);
643
+    $roles = (array)role_get_names($context);
644 644
     foreach ($roles as $key => $value) {
645 645
         $roles[$key] = $value->localname;
646 646
     }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 }
649 649
 
650 650
 function bigbluebuttonbn_get_roles_select(context $context = null) {
651
-    $roles = (array) role_get_names($context);
651
+    $roles = (array)role_get_names($context);
652 652
     foreach ($roles as $key => $value) {
653 653
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
654 654
     }
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 }
657 657
 
658 658
 function bigbluebuttonbn_get_role($id) {
659
-    $roles = (array) role_get_names();
659
+    $roles = (array)role_get_names();
660 660
     if (is_numeric($id)) {
661 661
         return $roles[$id];
662 662
     }
@@ -820,9 +820,9 @@  discard block
 block discarded – undo
820 820
     $isunique = true;
821 821
     if ($voicebridge != 0) {
822 822
         $table = 'bigbluebuttonbn';
823
-        $select = 'voicebridge = '.$voicebridge;
823
+        $select = 'voicebridge = ' . $voicebridge;
824 824
         if ($id) {
825
-            $select .= ' AND id <> '.$id;
825
+            $select .= ' AND id <> ' . $id;
826 826
         }
827 827
         if ($DB->get_records_select($table, $select)) {
828 828
             $isunique = false;
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
     $mt = microtime();
891 891
     $rand = mt_rand();
892 892
 
893
-    return md5($mt.$rand);
893
+    return md5($mt . $rand);
894 894
 }
895 895
 
896 896
 function bigbluebuttonbn_random_password($length = 8) {
@@ -902,41 +902,41 @@  discard block
 block discarded – undo
902 902
 
903 903
 function bigbluebuttonbn_events() {
904 904
     return array(
905
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
906
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
907
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
908
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
909
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
910
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
911
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
912
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
913
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
914
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
915
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
916
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
917
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
918
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
919
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
905
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
906
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
907
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
908
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
909
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
910
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
911
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
912
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
913
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
914
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
915
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
916
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
917
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
918
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
919
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
920 920
     );
921 921
 }
922 922
 
923 923
 function bigbluebuttonbn_events_action() {
924 924
     return array(
925
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
926
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
927
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
928
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
929
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
930
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
931
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
932
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
933
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
934
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
935
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
936
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
937
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
938
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
939
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
925
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
926
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
927
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
928
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
929
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
930
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
931
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
932
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
933
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
934
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
935
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
936
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
937
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
938
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
939
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
940 940
     );
941 941
 }
942 942
 
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
         $eventproperties['other'] = $options['other'];
961 961
     }
962 962
 
963
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
963
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
964 964
       array($eventproperties));
965 965
     $event->trigger();
966 966
 }
@@ -1003,11 +1003,11 @@  discard block
 block discarded – undo
1003 1003
     $now = time();
1004 1004
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1005 1005
         // Use the value in the cache.
1006
-        return (array) json_decode($result['meeting_info']);
1006
+        return (array)json_decode($result['meeting_info']);
1007 1007
     }
1008 1008
 
1009 1009
     // Ping again and refresh the cache.
1010
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1010
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1011 1011
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1012 1012
       );
1013 1013
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1065,8 +1065,8 @@  discard block
 block discarded – undo
1065 1065
  * @param string $configxml
1066 1066
  */
1067 1067
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1068
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1069
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1068
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1069
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1070 1070
 
1071 1071
     return $configxmlparams;
1072 1072
 }
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
  * @param string $configxml
1077 1077
  */
1078 1078
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1079
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1079
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1080 1080
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1081 1081
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
1082 1082
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1092 1092
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1093
-    $configxmlarray = (array) $configxml;
1093
+    $configxmlarray = (array)$configxml;
1094 1094
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1095 1095
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1096 1096
         return '';
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
         $starttime = $starttime - ($starttime % 1000);
1128 1128
 
1129 1129
         // Set formatted date.
1130
-        $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1130
+        $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1131 1131
         $row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1132 1132
 
1133 1133
         // Set formatted duration.
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
     }
1199 1199
 
1200 1200
     $recordingpreview = html_writer::start_tag('div',
1201
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1201
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1202 1202
     foreach ($recording['playbacks'] as $playback) {
1203 1203
         if (isset($playback['preview'])) {
1204 1204
             foreach ($playback['preview'] as $image) {
@@ -1231,19 +1231,19 @@  discard block
 block discarded – undo
1231 1231
         $visibility = 'hidden ';
1232 1232
     }
1233 1233
 
1234
-    $id = 'playbacks-'.$recording['recordID'];
1234
+    $id = 'playbacks-' . $recording['recordID'];
1235 1235
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1236 1236
           'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'],
1237 1237
           'title' => $title, $visibility => $visibility));
1238 1238
     foreach ($recording['playbacks'] as $playback) {
1239 1239
         $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1240
-        $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid.
1241
-            '&href='.urlencode($playback['url']).'&rid='.$recording['recordID'];
1242
-        $linkattributes = array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'),
1240
+        $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn=' . $bigbluebuttonbnid .
1241
+            '&href=' . urlencode($playback['url']) . '&rid=' . $recording['recordID'];
1242
+        $linkattributes = array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'),
1243 1243
             'class' => 'btn btn-sm btn-default', 'onclick' => $onclick,
1244 1244
             'data-action' => 'play', 'data-href' => $href);
1245
-        $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_'.$playback['type'],
1246
-            'bigbluebuttonbn'), null, $linkattributes).'&#32;';
1245
+        $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_' . $playback['type'],
1246
+            'bigbluebuttonbn'), null, $linkattributes) . '&#32;';
1247 1247
     }
1248 1248
     $recordingtypes .= html_writer::end_tag('div');
1249 1249
 
@@ -1328,11 +1328,11 @@  discard block
 block discarded – undo
1328 1328
         $target .= '-' . $data['target'];
1329 1329
     }
1330 1330
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1331
-    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);';
1331
+    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);';
1332 1332
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1333 1333
         // With icon for $manageaction.
1334 1334
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1335
-        $icon = new pix_icon('i/'.$data['tag'],
1335
+        $icon = new pix_icon('i/' . $data['tag'],
1336 1336
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1337 1337
             'moodle', $iconattributes);
1338 1338
         $linkattributes = array(
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
     if (isset($recordings) && !array_key_exists('messageKey', $recordings)) {
1423 1423
         // There are recordings for this meeting.
1424 1424
         foreach ($recordings as $recording) {
1425
-            if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) {
1425
+            if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
1426 1426
                 continue;
1427 1427
             }
1428 1428
             bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table);
@@ -1434,7 +1434,7 @@  discard block
 block discarded – undo
1434 1434
 
1435 1435
 function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, &$table) {
1436 1436
     $row = new html_table_row();
1437
-    $row->id = 'recording-td-'.$recording['recordID'];
1437
+    $row->id = 'recording-td-' . $recording['recordID'];
1438 1438
     $row->attributes['data-imported'] = 'false';
1439 1439
     $texthead = '';
1440 1440
     $texttail = '';
@@ -1448,9 +1448,9 @@  discard block
 block discarded – undo
1448 1448
     $rowdata = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools);
1449 1449
     if ($rowdata != null) {
1450 1450
         $rowdata->date_formatted = str_replace(' ', '&nbsp;', $rowdata->date_formatted);
1451
-        $row->cells = array($texthead.$rowdata->recording.$texttail,
1452
-            $texthead.$rowdata->activity.$texttail, $texthead.$rowdata->description.$texttail,
1453
-            $rowdata->preview, $texthead.$rowdata->date_formatted.$texttail,
1451
+        $row->cells = array($texthead . $rowdata->recording . $texttail,
1452
+            $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1453
+            $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1454 1454
             $rowdata->duration_formatted);
1455 1455
         if ($bbbsession['managerecordings']) {
1456 1456
             $row->cells[] = $rowdata->actionbar;
@@ -1460,7 +1460,7 @@  discard block
 block discarded – undo
1460 1460
 }
1461 1461
 
1462 1462
 function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) {
1463
-    return !( !isset($recording['imported']) && isset($bbbsession['group']) && $recording['meetingID'] != $bbbsession['meetingid'] );
1463
+    return !(!isset($recording['imported']) && isset($bbbsession['group']) && $recording['meetingID'] != $bbbsession['meetingid']);
1464 1464
 }
1465 1465
 
1466 1466
 function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) {
@@ -1472,9 +1472,9 @@  discard block
 block discarded – undo
1472 1472
     // Build the message_body.
1473 1473
     $msg->activity_type = '';
1474 1474
     $msg->activity_title = $bigbluebuttonbn->name;
1475
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1476
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1477
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1475
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1476
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1477
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1478 1478
 
1479 1479
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1480 1480
 }
@@ -1567,15 +1567,15 @@  discard block
 block discarded – undo
1567 1567
 
1568 1568
     // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'.
1569 1569
     $select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'";
1570
-    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
1571
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1570
+    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
1571
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1572 1572
     if ($bigbluebuttonbnid === null) {
1573 1573
         $select = "course = '{$courseid}'";
1574
-        $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1574
+        $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1575 1575
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1576 1576
     } else if ($subset) {
1577 1577
         $select = "id = '{$bigbluebuttonbnid}'";
1578
-        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1578
+        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1579 1579
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1580 1580
     }
1581 1581
     $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid');
@@ -1597,7 +1597,7 @@  discard block
 block discarded – undo
1597 1597
     if (!empty($bigbluebuttonbns)) {
1598 1598
         // Prepare select for loading records based on existent bigbluebuttonbns.
1599 1599
         $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
1600
-        $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
1600
+        $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
1601 1601
         // Include only Create events and exclude those with record not true.
1602 1602
         $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
1603 1603
         // Execute select for loading records based on existent bigbluebuttonbns.
@@ -1689,8 +1689,8 @@  discard block
 block discarded – undo
1689 1689
 function bigbluebuttonbn_format_activity_time($time) {
1690 1690
     $activitytime = '';
1691 1691
     if ($time) {
1692
-        $activitytime = calendar_day_representation($time).' '.
1693
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1692
+        $activitytime = calendar_day_representation($time) . ' ' .
1693
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
1694 1694
           calendar_time_representation($time);
1695 1695
     }
1696 1696
 
@@ -1716,7 +1716,7 @@  discard block
 block discarded – undo
1716 1716
 
1717 1717
 function bigbluebuttonbn_get_moderator_email($context) {
1718 1718
     $moderatoremails = array();
1719
-    $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
1719
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
1720 1720
     $counter = 0;
1721 1721
     foreach ($users as $key => $user) {
1722 1722
         if ($counter == 5) {
Please login to merge, or discard this patch.
classes/locallib/config.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -122,23 +122,23 @@
 block discarded – undo
122 122
      */
123 123
     public static function get_options() {
124 124
         return [
125
-               'version_major' => self::get_moodle_version_major(),
126
-               'voicebridge_editable' => self::get('voicebridge_editable'),
127
-               'recording_default' => self::get('recording_default'),
128
-               'recording_editable' => self::get('recording_editable'),
129
-               'waitformoderator_default' => self::get('waitformoderator_default'),
130
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
131
-               'userlimit_default' => self::get('userlimit_default'),
132
-               'userlimit_editable' => self::get('userlimit_editable'),
133
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
134
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
135
-               'recordings_html_default' => self::get('recordings_html_default'),
136
-               'recordings_html_editable' => self::get('recordings_html_editable'),
137
-               'recordings_deleted_activities_default' => self::get('recordings_deleted_activities_default'),
138
-               'recordings_deleted_activities_editable' => self::get('recordings_deleted_activities_editable'),
139
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
140
-               'instance_type_enabled' => self::recordings_enabled(),
141
-               'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
142
-          ];
125
+                'version_major' => self::get_moodle_version_major(),
126
+                'voicebridge_editable' => self::get('voicebridge_editable'),
127
+                'recording_default' => self::get('recording_default'),
128
+                'recording_editable' => self::get('recording_editable'),
129
+                'waitformoderator_default' => self::get('waitformoderator_default'),
130
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
131
+                'userlimit_default' => self::get('userlimit_default'),
132
+                'userlimit_editable' => self::get('userlimit_editable'),
133
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
134
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
135
+                'recordings_html_default' => self::get('recordings_html_default'),
136
+                'recordings_html_editable' => self::get('recordings_html_editable'),
137
+                'recordings_deleted_activities_default' => self::get('recordings_deleted_activities_default'),
138
+                'recordings_deleted_activities_editable' => self::get('recordings_deleted_activities_editable'),
139
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
140
+                'instance_type_enabled' => self::recordings_enabled(),
141
+                'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
142
+            ];
143 143
     }
144 144
 }
Please login to merge, or discard this patch.