Completed
Push — master ( e66db5...3ed694 )
by Jesus
13s
created
bbb_broker.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
23 23
  */
24 24
 
25
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
26
-require_once(dirname(__FILE__).'/locallib.php');
25
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
26
+require_once(dirname(__FILE__) . '/locallib.php');
27 27
 
28 28
 use \Firebase\JWT\JWT;
29 29
 
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
 $params['meta'] = optional_param('meta', '', PARAM_TEXT);
40 40
 
41 41
 if (empty($params['action'])) {
42
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
42
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
43 43
     return;
44 44
 }
45 45
 
46 46
 $error = bigbluebuttonbn_broker_validate_parameters($params);
47 47
 if (!empty($error)) {
48
-    header('HTTP/1.0 400 Bad Request. '.$error);
48
+    header('HTTP/1.0 400 Bad Request. ' . $error);
49 49
     return;
50 50
 }
51 51
 
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
         return;
140 140
     }
141 141
 
142
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
142
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
143 143
     return;
144 144
 
145 145
 } catch (Exception $e) {
146
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
146
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
147 147
     return;
148 148
 }
149 149
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
284 284
     $callbackresponse['status'] = true;
285 285
     $callbackresponse['found'] = true;
286
-    $callbackresponse['published'] = (string) $recording['published'];
286
+    $callbackresponse['published'] = (string)$recording['published'];
287 287
     if (!isset($params['meta']) || empty($params['meta'])) {
288 288
         return $callbackresponse;
289 289
     }
@@ -545,8 +545,8 @@  discard block
 block discarded – undo
545 545
         $decodedparameters = JWT::decode($params['signed_parameters'], (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'),
546 546
             array('HS256'));
547 547
     } catch (Exception $e) {
548
-        $error = 'Caught exception: '.$e->getMessage();
549
-        header('HTTP/1.0 400 Bad Request. '.$error);
548
+        $error = 'Caught exception: ' . $e->getMessage();
549
+        header('HTTP/1.0 400 Bad Request. ' . $error);
550 550
         return;
551 551
     }
552 552
 
@@ -564,8 +564,8 @@  discard block
 block discarded – undo
564 564
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
565 565
         header('HTTP/1.0 202 Accepted');
566 566
     } catch (Exception $e) {
567
-        $error = 'Caught exception: '.$e->getMessage();
568
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
567
+        $error = 'Caught exception: ' . $e->getMessage();
568
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
569 569
     }
570 570
 }
571 571
 
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
581 581
     if (!isset($importrecordings[$params['id']])) {
582 582
         $error = "Recording {$params['id']} could not be found. It can not be imported";
583
-        header('HTTP/1.0 404 Not found. '.$error);
583
+        header('HTTP/1.0 404 Not found. ' . $error);
584 584
         return;
585 585
     }
586 586
 
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 
589 589
     $importrecordings[$params['id']]['imported'] = true;
590 590
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
591
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
591
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
592 592
     bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
593 593
     // Moodle event logger: Create an event for recording imported.
594 594
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -606,8 +606,8 @@  discard block
 block discarded – undo
606 606
         $decodedparameters = JWT::decode($params['signed_parameters'], (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'),
607 607
             array('HS256'));
608 608
     } catch (Exception $e) {
609
-        $error = 'Caught exception: '.$e->getMessage();
610
-        header('HTTP/1.0 400 Bad Request. '.$error);
609
+        $error = 'Caught exception: ' . $e->getMessage();
610
+        header('HTTP/1.0 400 Bad Request. ' . $error);
611 611
         return;
612 612
     }
613 613
 
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 
646 646
     $action = strtolower($params['action']);
647 647
     if (!array_key_exists($action, $requiredparams)) {
648
-        return 'Action '.$params['action'].' can not be performed.';
648
+        return 'Action ' . $params['action'] . ' can not be performed.';
649 649
     }
650 650
 
651 651
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
Please login to merge, or discard this patch.
locallib.php 2 patches
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
  */
95 95
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
96 96
     $data = ['meetingID' => $meetingid,
97
-              'fullName' => $username,
98
-              'password' => $pw,
99
-              'logoutURL' => $logouturl,
97
+                'fullName' => $username,
98
+                'password' => $pw,
99
+                'logoutURL' => $logouturl,
100 100
             ];
101 101
     if (!is_null($configtoken)) {
102 102
         $data['configToken'] = $configtoken;
@@ -177,23 +177,23 @@  discard block
 block discarded – undo
177 177
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
178 178
     $xml = bigbluebuttonbn_wrap_xml_load_file(
179 179
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
180
-      );
180
+        );
181 181
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
182 182
         // Meeting info was returned.
183 183
         return array('returncode' => $xml->returncode,
184
-                     'meetingID' => $xml->meetingID,
185
-                     'moderatorPW' => $xml->moderatorPW,
186
-                     'attendeePW' => $xml->attendeePW,
187
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
188
-                     'running' => $xml->running,
189
-                     'recording' => $xml->recording,
190
-                     'startTime' => $xml->startTime,
191
-                     'endTime' => $xml->endTime,
192
-                     'participantCount' => $xml->participantCount,
193
-                     'moderatorCount' => $xml->moderatorCount,
194
-                     'attendees' => $xml->attendees,
195
-                     'metadata' => $xml->metadata,
196
-                   );
184
+                        'meetingID' => $xml->meetingID,
185
+                        'moderatorPW' => $xml->moderatorPW,
186
+                        'attendeePW' => $xml->attendeePW,
187
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
188
+                        'running' => $xml->running,
189
+                        'recording' => $xml->recording,
190
+                        'startTime' => $xml->startTime,
191
+                        'endTime' => $xml->endTime,
192
+                        'participantCount' => $xml->participantCount,
193
+                        'moderatorCount' => $xml->moderatorCount,
194
+                        'attendees' => $xml->attendees,
195
+                        'metadata' => $xml->metadata,
196
+                    );
197 197
     }
198 198
     if ($xml) {
199 199
         // Either failure or success without meeting info.
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         // Do getRecordings is executed using a method GET (supported by all versions of BBB).
250 250
         $xml = bigbluebuttonbn_wrap_xml_load_file(
251 251
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getRecordings', ['meetingID' => implode(',', $mids)])
252
-          );
252
+            );
253 253
         if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
254 254
             // If there were meetings already created.
255 255
             foreach ($xml->recordings->recording as $recording) {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 function bigbluebuttonbn_get_default_config_xml() {
310 310
     $xml = bigbluebuttonbn_wrap_xml_load_file(
311 311
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
312
-      );
312
+        );
313 313
     return $xml;
314 314
 }
315 315
 
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
     foreach ($ids as $id) {
379 379
         $xml = bigbluebuttonbn_wrap_xml_load_file(
380 380
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
381
-          );
381
+            );
382 382
         if ($xml && $xml->returncode != 'SUCCESS') {
383 383
             return false;
384 384
         }
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
     foreach ($ids as $id) {
396 396
         $xml = bigbluebuttonbn_wrap_xml_load_file(
397 397
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
398
-          );
398
+            );
399 399
         if ($xml && $xml->returncode != 'SUCCESS') {
400 400
             return false;
401 401
         }
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
     foreach ($ids as $id) {
413 413
         $xml = bigbluebuttonbn_wrap_xml_load_file(
414 414
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
415
-          );
415
+            );
416 416
         if ($xml && $xml->returncode != 'SUCCESS') {
417 417
             return false;
418 418
         }
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
428 428
     $xml = bigbluebuttonbn_wrap_xml_load_file(
429 429
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
430
-      );
430
+        );
431 431
     if ($xml) {
432 432
         // If the xml packet returned failure it displays the message to the user.
433 433
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 function bigbluebuttonbn_is_meeting_running($meetingid) {
443 443
     $xml = bigbluebuttonbn_wrap_xml_load_file(
444 444
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('isMeetingRunning', ['meetingID' => $meetingid])
445
-      );
445
+        );
446 446
     if ($xml && $xml->returncode == 'SUCCESS') {
447 447
         return ($xml->running == 'true');
448 448
     }
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 function bigbluebuttonbn_get_server_version() {
453 453
     $xml = bigbluebuttonbn_wrap_xml_load_file(
454 454
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
455
-      );
455
+        );
456 456
     if ($xml && $xml->returncode == 'SUCCESS') {
457 457
         return $xml->version;
458 458
     }
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
 
508 508
         $options = array();
509 509
         $options['CURLOPT_HTTPHEADER'] = array(
510
-                 'Content-Type: '.$contenttype,
511
-                 'Content-Length: '.strlen($data),
512
-                 'Content-Language: en-US',
513
-               );
510
+                    'Content-Type: '.$contenttype,
511
+                    'Content-Length: '.strlen($data),
512
+                    'Content-Language: en-US',
513
+                );
514 514
 
515 515
         return $c->post($url, $data, $options);
516 516
     }
@@ -581,13 +581,13 @@  discard block
 block discarded – undo
581 581
 
582 582
 function bigbluebuttonbn_role_unknown() {
583 583
     return array(
584
-              "id" => "0",
585
-              "name" => "",
586
-              "shortname" => "unknown",
587
-              "description" => "",
588
-              "sortorder" => "0",
589
-              "archetype" => "guest",
590
-              "localname" => "Unknown"
584
+                "id" => "0",
585
+                "name" => "",
586
+                "shortname" => "unknown",
587
+                "description" => "",
588
+                "sortorder" => "0",
589
+                "archetype" => "guest",
590
+                "localname" => "Unknown"
591 591
             );
592 592
 }
593 593
 
@@ -596,16 +596,16 @@  discard block
 block discarded – undo
596 596
         'all' => array(
597 597
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
598 598
             'children' => []
599
-          )
600
-      );
599
+            )
600
+        );
601 601
     $data['role'] = array(
602 602
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
603 603
         'children' => bigbluebuttonbn_get_roles_select($context)
604
-      );
604
+        );
605 605
     $data['user'] = array(
606 606
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
607 607
         'children' => bigbluebuttonbn_get_users_select($context)
608
-      );
608
+        );
609 609
     return $data;
610 610
 }
611 611
 
@@ -635,9 +635,9 @@  discard block
 block discarded – undo
635 635
             continue;
636 636
         }
637 637
         $participantlistarray[] = array(
638
-              'selectiontype' => 'role',
639
-              'selectionid' => $moderatordefault,
640
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
638
+                'selectiontype' => 'role',
639
+                'selectionid' => $moderatordefault,
640
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
641 641
     }
642 642
     return $participantlistarray;
643 643
 }
@@ -668,11 +668,11 @@  discard block
 block discarded – undo
668 668
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
669 669
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
670 670
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
671
-          ],
671
+            ],
672 672
         'type_selected' => 'all',
673 673
         'options' => ['all' => '---------------'],
674 674
         'selected' => 'all',
675
-      ];
675
+        ];
676 676
 }
677 677
 
678 678
 function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) {
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
         $eventproperties['other'] = $options['other'];
863 863
     }
864 864
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
865
-      array($eventproperties));
865
+        array($eventproperties));
866 866
     $event->trigger();
867 867
 }
868 868
 
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
     // Ping again and refresh the cache.
908 908
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
909 909
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
910
-      );
910
+        );
911 911
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
912 912
     return $meetinginfo;
913 913
 }
@@ -1143,8 +1143,8 @@  discard block
 block discarded – undo
1143 1143
     }
1144 1144
     $id = 'playbacks-'.$recording['recordID'];
1145 1145
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1146
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1147
-          'title' => $title, $visibility => $visibility));
1146
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1147
+            'title' => $title, $visibility => $visibility));
1148 1148
     foreach ($recording['playbacks'] as $playback) {
1149 1149
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid,
1150 1150
             $playback).' ';
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
     $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1159 1159
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1160 1160
     $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid.
1161
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1161
+        '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1162 1162
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1163 1163
         $href .= '&href='.urlencode(trim($playback['url']));
1164 1164
     }
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
         'data-target' => $playback['type'],
1171 1171
         'data-href' => $href,
1172 1172
         'class' => 'btn btn-sm btn-default'
1173
-      );
1173
+        );
1174 1174
     return $OUTPUT->action_link('#', $title, null, $linkattributes);
1175 1175
 }
1176 1176
 
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
             'onclick' => $onclick,
1255 1255
             'data-action' => $data['action'],
1256 1256
             'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID'])
1257
-          );
1257
+            );
1258 1258
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
1259 1259
     }
1260 1260
     // With text for $manageaction.
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
         $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1360 1360
         $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1361 1361
         $rowdata->duration_formatted
1362
-      );
1362
+        );
1363 1363
     if ($bbbsession['managerecordings']) {
1364 1364
         $row->cells[] = $rowdata->actionbar;
1365 1365
     }
@@ -1601,8 +1601,8 @@  discard block
 block discarded – undo
1601 1601
     $activitytime = '';
1602 1602
     if ($time) {
1603 1603
         $activitytime = calendar_day_representation($time).' '.
1604
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1605
-          calendar_time_representation($time);
1604
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1605
+            calendar_time_representation($time);
1606 1606
     }
1607 1607
     return $activitytime;
1608 1608
 }
@@ -1739,7 +1739,7 @@  discard block
 block discarded – undo
1739 1739
         $owner = array('0' => get_string('mod_form_field_participant_list_type_owner', 'bigbluebuttonbn'));
1740 1740
         $renderer->render_group_element('participant_moderator_default',
1741 1741
             $renderer->render_group_element_configmultiselect('participant_moderator_default', array_keys($owner), array_merge($owner, $roles))
1742
-          );
1742
+            );
1743 1743
     }
1744 1744
     // Configuration for "send notifications" feature.
1745 1745
     if ((boolean)\mod_bigbluebuttonbn\settings\renderer::section_send_notifications_shown()) {
Please login to merge, or discard this 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
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     if (isset($meta)) {
80 80
         $log->meta = $meta;
81 81
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
82
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
82
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
83 83
     }
84 84
     $DB->insert_record('bigbluebuttonbn_logs', $log);
85 85
 }
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
     $data = null;
120 120
     if (!is_null($pname) && !is_null($purl)) {
121 121
         $method = BIGBLUEBUTTONBN_METHOD_POST;
122
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
123
-            $purl."' /></module></modules>";
122
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
123
+            $purl . "' /></module></modules>";
124 124
     }
125 125
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
126 126
     if ($xml) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                                 'moderatorPW' => $meeting->moderatorPW,
160 160
                                 'attendeePW' => $meeting->attendeePW,
161 161
                                 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded,
162
-                                'running' => $meeting->running, );
162
+                                'running' => $meeting->running,);
163 163
         }
164 164
         return $meetings;
165 165
     }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
         // Override imported flag with actual ID.
300 300
         $recording['imported'] = $recordimported->id;
301 301
         if (isset($recordimported->protected)) {
302
-            $recording['protected'] = (string) $recordimported->protected;
302
+            $recording['protected'] = (string)$recordimported->protected;
303 303
         }
304 304
         $recordsimportedarray[$recording['recordID']] = $recording;
305 305
     }
@@ -315,36 +315,36 @@  discard block
 block discarded – undo
315 315
 
316 316
 function bigbluebuttonbn_get_default_config_xml_array() {
317 317
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
318
-    return (array) $defaultconfigxml;
318
+    return (array)$defaultconfigxml;
319 319
 }
320 320
 
321 321
 function bigbluebuttonbn_get_recording_array_value($recording) {
322 322
     // Add formats.
323 323
     $playbackarray = array();
324 324
     foreach ($recording->playback->format as $format) {
325
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
326
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
325
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
326
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
327 327
         // Add preview per format when existing.
328 328
         if ($format->preview) {
329 329
             $imagesarray = array();
330 330
             foreach ($format->preview->images->image as $image) {
331
-                $imagearray = array('url' => trim((string) $image));
331
+                $imagearray = array('url' => trim((string)$image));
332 332
                 foreach ($image->attributes() as $attkey => $attvalue) {
333
-                    $imagearray[$attkey] = (string) $attvalue;
333
+                    $imagearray[$attkey] = (string)$attvalue;
334 334
                 }
335 335
                 array_push($imagesarray, $imagearray);
336 336
             }
337
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
337
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
338 338
         }
339 339
     }
340 340
     // Add the metadata to the recordings array.
341 341
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
342
-    $recordingarray = array('recordID' => (string) $recording->recordID,
343
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
344
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
345
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
342
+    $recordingarray = array('recordID' => (string)$recording->recordID,
343
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
344
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
345
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
346 346
     if (isset($recording->protected)) {
347
-        $recordingarray['protected'] = (string) $recording->protected;
347
+        $recordingarray['protected'] = (string)$recording->protected;
348 348
     }
349 349
     return $recordingarray + $metadataarray;
350 350
 }
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         if (is_object($value)) {
356 356
             $value = '';
357 357
         }
358
-        $metadataarray['meta_'.$key] = $value;
358
+        $metadataarray['meta_' . $key] = $value;
359 359
     }
360 360
     return $metadataarray;
361 361
 }
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
     $ids = explode(',', $recordids);
412 412
     foreach ($ids as $id) {
413 413
         $xml = bigbluebuttonbn_wrap_xml_load_file(
414
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
414
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
415 415
           );
416 416
         if ($xml && $xml->returncode != 'SUCCESS') {
417 417
             return false;
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
             return $xml;
479 479
         } catch (Exception $e) {
480 480
             libxml_use_internal_errors($previous);
481
-            $error = 'Caught exception: '.$e->getMessage();
481
+            $error = 'Caught exception: ' . $e->getMessage();
482 482
             debugging($error, DEBUG_DEVELOPER);
483 483
             return null;
484 484
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
490 490
         return $response;
491 491
     } catch (Exception $e) {
492
-        $error = 'Caught exception: '.$e->getMessage();
492
+        $error = 'Caught exception: ' . $e->getMessage();
493 493
         debugging($error, DEBUG_DEVELOPER);
494 494
         libxml_use_internal_errors($previous);
495 495
         return null;
@@ -507,8 +507,8 @@  discard block
 block discarded – undo
507 507
 
508 508
         $options = array();
509 509
         $options['CURLOPT_HTTPHEADER'] = array(
510
-                 'Content-Type: '.$contenttype,
511
-                 'Content-Length: '.strlen($data),
510
+                 'Content-Type: ' . $contenttype,
511
+                 'Content-Length: ' . strlen($data),
512 512
                  'Content-Language: en-US',
513 513
                );
514 514
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 
520 520
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
521 521
     // End the session associated with this instance (if it's running).
522
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
522
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
523 523
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
524 524
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
525 525
     }
@@ -531,9 +531,9 @@  discard block
 block discarded – undo
531 531
     if ($userroles) {
532 532
         $where = '';
533 533
         foreach ($userroles as $value) {
534
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$value->roleid;
534
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $value->roleid;
535 535
         }
536
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
536
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
537 537
     }
538 538
     return $userroles;
539 539
 }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 }
545 545
 
546 546
 function bigbluebuttonbn_get_users(context $context = null) {
547
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
547
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
548 548
     foreach ($users as $key => $value) {
549 549
         $users[$key] = fullname($value);
550 550
     }
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 }
553 553
 
554 554
 function bigbluebuttonbn_get_users_select(context $context = null) {
555
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
555
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
556 556
     foreach ($users as $key => $value) {
557 557
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
558 558
     }
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 }
561 561
 
562 562
 function bigbluebuttonbn_get_roles(context $context = null) {
563
-    $roles = (array) role_get_names($context);
563
+    $roles = (array)role_get_names($context);
564 564
     foreach ($roles as $key => $value) {
565 565
         $roles[$key] = $value->localname;
566 566
     }
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 }
569 569
 
570 570
 function bigbluebuttonbn_get_roles_select(context $context = null) {
571
-    $roles = (array) role_get_names($context);
571
+    $roles = (array)role_get_names($context);
572 572
     foreach ($roles as $key => $value) {
573 573
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
574 574
     }
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 }
577 577
 
578 578
 function bigbluebuttonbn_get_role($id) {
579
-    $roles = (array) role_get_names();
579
+    $roles = (array)role_get_names();
580 580
     if (is_numeric($id)) {
581 581
         return (object)$roles[$id];
582 582
     }
@@ -656,11 +656,11 @@  discard block
 block discarded – undo
656 656
         return array();
657 657
     }
658 658
     foreach ($rules as $key => $rule) {
659
-        if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) {
659
+        if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) {
660 660
             continue;
661 661
         }
662 662
         $role = bigbluebuttonbn_get_role($rule['selectionid']);
663
-        if ( $role == null ) {
663
+        if ($role == null) {
664 664
             unset($rules[$key]);
665 665
             continue;
666 666
         }
@@ -699,10 +699,10 @@  discard block
 block discarded – undo
699 699
     if (empty($userroles)) {
700 700
         $userroles = get_user_roles($context, $userid, true);
701 701
     }
702
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
702
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
703 703
 }
704 704
 
705
-function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) {
705
+function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) {
706 706
     // Iterate participant rules.
707 707
     foreach ($participantlist as $participant) {
708 708
         if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) {
@@ -747,9 +747,9 @@  discard block
 block discarded – undo
747 747
     $isunique = true;
748 748
     if ($voicebridge != 0) {
749 749
         $table = 'bigbluebuttonbn';
750
-        $select = 'voicebridge = '.$voicebridge;
750
+        $select = 'voicebridge = ' . $voicebridge;
751 751
         if ($id) {
752
-            $select .= ' AND id <> '.$id;
752
+            $select .= ' AND id <> ' . $id;
753 753
         }
754 754
         if ($DB->get_records_select($table, $select)) {
755 755
             $isunique = false;
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 function bigbluebuttonbn_generate_nonce() {
804 804
     $mt = microtime();
805 805
     $rand = mt_rand();
806
-    return md5($mt.$rand);
806
+    return md5($mt . $rand);
807 807
 }
808 808
 
809 809
 function bigbluebuttonbn_random_password($length = 8) {
@@ -814,41 +814,41 @@  discard block
 block discarded – undo
814 814
 
815 815
 function bigbluebuttonbn_events() {
816 816
     return array(
817
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
818
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
819
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
820
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
821
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
822
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
823
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
824
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
825
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
826
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
827
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
828
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
829
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
830
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
831
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
817
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
818
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
819
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
820
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
821
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
822
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
823
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
824
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
825
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
826
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
827
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
828
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
829
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
830
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
831
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
832 832
     );
833 833
 }
834 834
 
835 835
 function bigbluebuttonbn_events_action() {
836 836
     return array(
837
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
838
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
839
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
840
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
841
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
842
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
843
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
844
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
845
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
846
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
847
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
848
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
849
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
850
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
851
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
837
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
838
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
839
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
840
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
841
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
842
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
843
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
844
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
845
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
846
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
847
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
848
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
849
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
850
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
851
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
852 852
     );
853 853
 }
854 854
 
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
     if (array_key_exists('other', $options)) {
870 870
         $eventproperties['other'] = $options['other'];
871 871
     }
872
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
872
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
873 873
       array($eventproperties));
874 874
     $event->trigger();
875 875
 }
@@ -910,10 +910,10 @@  discard block
 block discarded – undo
910 910
     $now = time();
911 911
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
912 912
         // Use the value in the cache.
913
-        return (array) json_decode($result['meeting_info']);
913
+        return (array)json_decode($result['meeting_info']);
914 914
     }
915 915
     // Ping again and refresh the cache.
916
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
916
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
917 917
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
918 918
       );
919 919
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -988,8 +988,8 @@  discard block
 block discarded – undo
988 988
  * @param string $configxml
989 989
  */
990 990
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
991
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
992
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
991
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
992
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
993 993
     return $configxmlparams;
994 994
 }
995 995
 
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
  * @param string $configxml
999 999
  */
1000 1000
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1001
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1001
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1002 1002
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1003 1003
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
1004 1004
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
  */
1012 1012
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1013 1013
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1014
-    $configxmlarray = (array) $configxml;
1014
+    $configxmlarray = (array)$configxml;
1015 1015
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1016 1016
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1017 1017
         return '';
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
     global $USER;
1062 1062
     $starttime = $starttime - ($starttime % 1000);
1063 1063
     // Set formatted date.
1064
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1064
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1065 1065
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1066 1066
 }
1067 1067
 
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
 function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) {
1078 1078
     $actionbar = '';
1079 1079
     foreach ($tools as $tool) {
1080
-        if ( $tool == 'protect' && !isset($recording['protected']) ) {
1080
+        if ($tool == 'protect' && !isset($recording['protected'])) {
1081 1081
             continue;
1082 1082
         }
1083 1083
         $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool);
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
         $visibility = 'hidden ';
1122 1122
     }
1123 1123
     $recordingpreview = html_writer::start_tag('div',
1124
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1124
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1125 1125
     foreach ($recording['playbacks'] as $playback) {
1126 1126
         if (isset($playback['preview'])) {
1127 1127
             foreach ($playback['preview'] as $image) {
@@ -1149,13 +1149,13 @@  discard block
 block discarded – undo
1149 1149
     if ($recording['published'] === 'false') {
1150 1150
         $visibility = 'hidden ';
1151 1151
     }
1152
-    $id = 'playbacks-'.$recording['recordID'];
1152
+    $id = 'playbacks-' . $recording['recordID'];
1153 1153
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1154 1154
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1155 1155
           'title' => $title, $visibility => $visibility));
1156 1156
     foreach ($recording['playbacks'] as $playback) {
1157 1157
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid,
1158
-            $playback).'&#32;';
1158
+            $playback) . '&#32;';
1159 1159
     }
1160 1160
     $recordingtypes .= html_writer::end_tag('div');
1161 1161
     return $recordingtypes;
@@ -1163,12 +1163,12 @@  discard block
 block discarded – undo
1163 1163
 
1164 1164
 function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) {
1165 1165
     global $CFG, $OUTPUT;
1166
-    $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1166
+    $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1167 1167
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1168
-    $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid.
1169
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1168
+    $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid .
1169
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1170 1170
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1171
-        $href .= '&href='.urlencode(trim($playback['url']));
1171
+        $href .= '&href=' . urlencode(trim($playback['url']));
1172 1172
     }
1173 1173
     $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID'];
1174 1174
     $linkattributes = array(
@@ -1250,11 +1250,11 @@  discard block
 block discarded – undo
1250 1250
         $target .= '-' . $data['target'];
1251 1251
     }
1252 1252
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1253
-    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);';
1253
+    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);';
1254 1254
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1255 1255
         // With icon for $manageaction.
1256 1256
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1257
-        $icon = new pix_icon('i/'.$data['tag'],
1257
+        $icon = new pix_icon('i/' . $data['tag'],
1258 1258
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1259 1259
             'moodle', $iconattributes);
1260 1260
         $linkattributes = array(
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
     if (isset($recordings) && !array_key_exists('messageKey', $recordings)) {
1337 1337
         // There are recordings for this meeting.
1338 1338
         foreach ($recordings as $recording) {
1339
-            if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) {
1339
+            if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
1340 1340
                 continue;
1341 1341
             }
1342 1342
             bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table);
@@ -1351,7 +1351,7 @@  discard block
 block discarded – undo
1351 1351
         return;
1352 1352
     }
1353 1353
     $row = new html_table_row();
1354
-    $row->id = 'recording-td-'.$recording['recordID'];
1354
+    $row->id = 'recording-td-' . $recording['recordID'];
1355 1355
     $row->attributes['data-imported'] = 'false';
1356 1356
     $texthead = '';
1357 1357
     $texttail = '';
@@ -1375,7 +1375,7 @@  discard block
 block discarded – undo
1375 1375
 }
1376 1376
 
1377 1377
 function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) {
1378
-    if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) {
1378
+    if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) {
1379 1379
         return true;
1380 1380
     }
1381 1381
     return false;
@@ -1388,9 +1388,9 @@  discard block
 block discarded – undo
1388 1388
     // Build the message_body.
1389 1389
     $msg->activity_type = '';
1390 1390
     $msg->activity_title = $bigbluebuttonbn->name;
1391
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1392
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1393
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1391
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1392
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1393
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1394 1394
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1395 1395
 }
1396 1396
 
@@ -1480,15 +1480,15 @@  discard block
 block discarded – undo
1480 1480
 
1481 1481
 function bigbluebuttonbn_get_recordings_sql_selectdeleted($courseid, $bigbluebuttonbnid = null, $subset = true) {
1482 1482
     if ($bigbluebuttonbnid === null) {
1483
-        return "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1483
+        return "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1484 1484
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1485 1485
     }
1486 1486
     if ($subset) {
1487
-        return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1487
+        return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1488 1488
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1489 1489
     }
1490
-    return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
1491
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1490
+    return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
1491
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1492 1492
 }
1493 1493
 
1494 1494
 function bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid = null, $subset = true,
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
     }
1534 1534
     // Prepare select for loading records based on existent bigbluebuttonbns.
1535 1535
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
1536
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
1536
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
1537 1537
     // Include only Create events and exclude those with record not true.
1538 1538
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
1539 1539
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -1608,8 +1608,8 @@  discard block
 block discarded – undo
1608 1608
 function bigbluebuttonbn_format_activity_time($time) {
1609 1609
     $activitytime = '';
1610 1610
     if ($time) {
1611
-        $activitytime = calendar_day_representation($time).' '.
1612
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1611
+        $activitytime = calendar_day_representation($time) . ' ' .
1612
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
1613 1613
           calendar_time_representation($time);
1614 1614
     }
1615 1615
     return $activitytime;
@@ -1716,7 +1716,7 @@  discard block
 block discarded – undo
1716 1716
         // This feature only works if curl is installed.
1717 1717
         $preuploaddescripion = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn');
1718 1718
         if (!extension_loaded('curl')) {
1719
-            $preuploaddescripion .= '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>';
1719
+            $preuploaddescripion .= '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>';
1720 1720
         }
1721 1721
         $renderer->render_group_header('preuploadpresentation', null, $preuploaddescripion);
1722 1722
         if (extension_loaded('curl')) {
Please login to merge, or discard this patch.
classes/locallib/config.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -119,28 +119,28 @@
 block discarded – undo
119 119
      */
120 120
     public static function get_options() {
121 121
         return [
122
-               'version_major' => self::get_moodle_version_major(),
123
-               'voicebridge_editable' => self::get('voicebridge_editable'),
124
-               'waitformoderator_default' => self::get('waitformoderator_default'),
125
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
126
-               'userlimit_default' => self::get('userlimit_default'),
127
-               'userlimit_editable' => self::get('userlimit_editable'),
128
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
129
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
130
-               'recordings_enabled' => self::get('recordings_enabled'),
131
-               'recordings_html_default' => self::get('recordings_html_default'),
132
-               'recordings_html_editable' => self::get('recordings_html_editable'),
133
-               'recordings_deleted_default' => self::get('recordings_deleted_default'),
134
-               'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
135
-               'recordings_imported_default' => self::get('recordings_imported_default'),
136
-               'recordings_imported_editable' => self::get('recordings_imported_editable'),
137
-               'recording_default' => self::get('recording_default'),
138
-               'recording_editable' => self::get('recording_editable'),
139
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
140
-               'general_warning_message' => self::get('general_warning_message'),
141
-               'general_warning_button_text' => self::get('general_warning_button_text'),
142
-               'general_warning_button_href' => self::get('general_warning_button_href'),
143
-               'general_warning_button_class' => self::get('general_warning_button_class'),
144
-          ];
122
+                'version_major' => self::get_moodle_version_major(),
123
+                'voicebridge_editable' => self::get('voicebridge_editable'),
124
+                'waitformoderator_default' => self::get('waitformoderator_default'),
125
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
126
+                'userlimit_default' => self::get('userlimit_default'),
127
+                'userlimit_editable' => self::get('userlimit_editable'),
128
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
129
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
130
+                'recordings_enabled' => self::get('recordings_enabled'),
131
+                'recordings_html_default' => self::get('recordings_html_default'),
132
+                'recordings_html_editable' => self::get('recordings_html_editable'),
133
+                'recordings_deleted_default' => self::get('recordings_deleted_default'),
134
+                'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
135
+                'recordings_imported_default' => self::get('recordings_imported_default'),
136
+                'recordings_imported_editable' => self::get('recordings_imported_editable'),
137
+                'recording_default' => self::get('recording_default'),
138
+                'recording_editable' => self::get('recording_editable'),
139
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
140
+                'general_warning_message' => self::get('general_warning_message'),
141
+                'general_warning_button_text' => self::get('general_warning_button_text'),
142
+                'general_warning_button_href' => self::get('general_warning_button_href'),
143
+                'general_warning_button_class' => self::get('general_warning_button_class'),
144
+            ];
145 145
     }
146 146
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public static function defaultvalues() {
46 46
         return array(
47
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
48
-            'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
47
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
48
+            'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
49 49
             'importrecordings_enabled' => 'false',
50 50
             'voicebridge_editable' => 'false',
51 51
             'importrecordings_enabled' => 'false',
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
     public static function get($setting) {
100 100
         global $CFG;
101 101
         if (isset($CFG->bigbluebuttonbn[$setting])) {
102
-            return (string) $CFG->bigbluebuttonbn[$setting];
102
+            return (string)$CFG->bigbluebuttonbn[$setting];
103 103
         }
104
-        if (isset($CFG->{'bigbluebuttonbn_'.$setting})) {
105
-            return (string)$CFG->{'bigbluebuttonbn_'.$setting};
104
+        if (isset($CFG->{'bigbluebuttonbn_' . $setting})) {
105
+            return (string)$CFG->{'bigbluebuttonbn_' . $setting};
106 106
         }
107 107
         return  self::defaultvalue($setting);
108 108
     }
Please login to merge, or discard this patch.
classes/settings/renderer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 defined('MOODLE_INTERNAL') || die();
28 28
 
29 29
 require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
30
-require_once($CFG->libdir.'/adminlib.php');
30
+require_once($CFG->libdir . '/adminlib.php');
31 31
 
32 32
 class renderer {
33 33
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             $itemname = get_string('config_' . $name, 'bigbluebuttonbn');
46 46
         }
47 47
         if ($itemdescription == null) {
48
-            $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn');
48
+            $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn');
49 49
         }
50 50
         $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription);
51 51
         $this->settings->add($item);
Please login to merge, or discard this patch.
config-dist.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
  * recordings from a different activity even from a different course.
95 95
  **/
96 96
 
97
- /*
97
+    /*
98 98
  * When the value is set to 1 (checked) the bigbluebuttonbn rooms or
99 99
  * activities will have the 'import recordings' capability enabled.
100 100
  */
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
  * 'Join session' button enabled
116 116
  **/
117 117
 
118
- /*
118
+    /*
119 119
  * When the value is set to 1 (checked) the bigbluebuttonbn rooms or
120 120
  * activities will have the 'wait for moderator' capability enabled by
121 121
  * default.
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
  * 5. CONFIGURATION FOR "STATIC VOICE BRIDGE" FEATURE
150 150
  *
151 151
  **/
152
- /*
152
+    /*
153 153
  * A conference voice bridge number can be permanently assigned to a room
154 154
  * or activity.
155 155
  */
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
  * 6. CONFIGURATION FOR "PRE-UPLOAD PRESENTATION" FEATURE
160 160
  *
161 161
  **/
162
- /*
162
+    /*
163 163
  * Since version 0.8, BigBluebutton has an implementation for allowing
164 164
  * preuploading presentation. When this feature is enabled, users creating or
165 165
  * editing a room or activity can upload a PDF or Office document to the
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
  * applied to each room or activity, or globally.
177 177
  **/
178 178
 
179
- /*
179
+    /*
180 180
  * The number of users allowed in a session by default when a new room or
181 181
  * conference is added. If the number is set to 0, no limit is established.
182 182
  * $CFG->bigbluebuttonbn['userlimit_default'] = 0;
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
  * By default only the owner is assigned.
198 198
  **/
199 199
 
200
- /*
200
+    /*
201 201
  * The values for this parameter can be 'owner' and/or any of the roles defined in
202 202
  * Moodle (including the custom parameters). The value used will be the key for the role.
203 203
  * [owner|manager|coursecreator|editingteacher|teacher|student|guest|user|frontpage|ANY_CUSTOM_ROLE]
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
  * 9. CONFIGURATION FOR "NOTIFICATION SENDING" FEATURE
209 209
  *
210 210
  **/
211
- /*
211
+    /*
212 212
  * When the value is set to 1 (checked) the 'notification sending'
213 213
  * capability can be used by the user creating or editing the room or
214 214
  * activity.
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
  * 10. CONFIGURATION FOR "RECORDING READY" FEATURE
223 223
  *
224 224
  **/
225
- /*
225
+    /*
226 226
  * When the value is set to 1 (checked) the 'notify users when recording ready'
227 227
  * capability is enabled, meaning that a message will be sent to all enrolled
228 228
  * users in a course when a recording is ready
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
  * 12. GENERAL CONFIGURATION FOR RECORDINGS UI
247 247
  *
248 248
  **/
249
- /*
249
+    /*
250 250
  * When the value is set to 1 (checked) the bigbluebuttonbn resources
251 251
  * will show the recodings in an html table by default.
252 252
  * $CFG->bigbluebuttonbn['recordings_html_default'] = 0;
@@ -270,22 +270,22 @@  discard block
 block discarded – undo
270 270
  * $CFG->bigbluebuttonbn['recordings_deleted_editable'] = 0;
271 271
  */
272 272
 
273
- /*
273
+    /*
274 274
   * When the value is set to 1 (checked) the bigbluebuttonbn resources for recordings
275 275
   * will show only the imported links as part of the list.
276 276
   * $CFG->bigbluebuttonbn['recordings_imported_default'] = 0;
277 277
   */
278 278
 
279
- /*
279
+    /*
280 280
   * When the value is set to 1 (checked) the 'show only imported links'
281 281
   * capability can be enabled/disabled by the user creating or editing the resource for recordings.
282 282
   * $CFG->bigbluebuttonbn['recordings_imported_editable'] = 1;
283 283
   */
284 284
 
285
-  /*
285
+    /*
286 286
    *  CONFIGURATION FOR FEATURES OFFERED BY BN SERVERS
287 287
   ** ------------------------------------------------------------------ **/
288
-  /*
288
+    /*
289 289
    * When general_warning_message value is different than "", the string is shown
290 290
    * as a warning message to privileged users (administrators and Teachers or users allowed to edit).
291 291
    * $CFG->bigbluebuttonbn['general_warning_message'] = "This will may have recordings enabled when upgraded to premium.";
Please login to merge, or discard this patch.
bbb_view.php 2 patches
Switch Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -61,104 +61,104 @@
 block discarded – undo
61 61
 }
62 62
 
63 63
 switch (strtolower($action)) {
64
-    case 'logout':
65
-        if (isset($errors) && $errors != '') {
66
-            bigbluebutton_bbb_view_errors($errors, $id);
67
-            break;
68
-        }
69
-
70
-        if (is_null($bbbsession)) {
71
-            bigbluebutton_bbb_view_close_window_manually();
72
-            break;
73
-        }
64
+        case 'logout':
65
+            if (isset($errors) && $errors != '') {
66
+                bigbluebutton_bbb_view_errors($errors, $id);
67
+                break;
68
+            }
74 69
 
75
-        // Moodle event logger: Create an event for meeting left.
76
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
70
+            if (is_null($bbbsession)) {
71
+                bigbluebutton_bbb_view_close_window_manually();
72
+                break;
73
+            }
77 74
 
78
-        // Update the cache.
79
-        $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
75
+            // Moodle event logger: Create an event for meeting left.
76
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
80 77
 
81
-        // Close the tab or window where BBB was opened.
82
-        bigbluebutton_bbb_view_close_window();
83
-        break;
84
-    case 'join':
85
-        if (is_null($bbbsession)) {
86
-            print_error('view_error_unable_join', 'bigbluebuttonbn');
87
-            break;
88
-        }
78
+            // Update the cache.
79
+            $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
89 80
 
90
-        // See if the session is in progress.
91
-        if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
92
-            // Since the meeting is already running, we just join the session.
93
-            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
81
+            // Close the tab or window where BBB was opened.
82
+            bigbluebutton_bbb_view_close_window();
94 83
             break;
95
-        }
84
+        case 'join':
85
+            if (is_null($bbbsession)) {
86
+                print_error('view_error_unable_join', 'bigbluebuttonbn');
87
+                break;
88
+            }
96 89
 
97
-        // If user is not administrator nor moderator (user is steudent) and waiting is required.
98
-        if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
99
-            header('Location: '.$bbbsession['logoutURL']);
100
-            break;
101
-        }
90
+            // See if the session is in progress.
91
+            if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
92
+                // Since the meeting is already running, we just join the session.
93
+                bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
94
+                break;
95
+            }
102 96
 
103
-        // As the meeting doesn't exist, try to create it.
104
-        $response = bigbluebuttonbn_get_create_meeting_array(
105
-            bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
106
-            bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
107
-            $bbbsession['presentation']['name'],
108
-            $bbbsession['presentation']['url']
109
-        );
110
-
111
-        if (!$response) {
112
-            // The server is unreachable.
113
-            if ($bbbsession['administrator']) {
114
-                print_error('view_error_unable_join', 'bigbluebuttonbn',
115
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
97
+            // If user is not administrator nor moderator (user is steudent) and waiting is required.
98
+            if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
99
+                header('Location: '.$bbbsession['logoutURL']);
116 100
                 break;
117 101
             }
118
-            if ($bbbsession['moderator']) {
119
-                print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
102
+
103
+            // As the meeting doesn't exist, try to create it.
104
+            $response = bigbluebuttonbn_get_create_meeting_array(
105
+                bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
106
+                bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
107
+                $bbbsession['presentation']['name'],
108
+                $bbbsession['presentation']['url']
109
+            );
110
+
111
+            if (!$response) {
112
+                // The server is unreachable.
113
+                if ($bbbsession['administrator']) {
114
+                    print_error('view_error_unable_join', 'bigbluebuttonbn',
115
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
116
+                    break;
117
+                }
118
+                if ($bbbsession['moderator']) {
119
+                    print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
120
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
121
+                    break;
122
+                }
123
+
124
+                print_error('view_error_unable_join_student', 'bigbluebuttonbn',
120 125
                     $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
121 126
                 break;
122 127
             }
123 128
 
124
-            print_error('view_error_unable_join_student', 'bigbluebuttonbn',
125
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
126
-            break;
127
-        }
129
+            if ($response['returncode'] == 'FAILED') {
130
+                // The meeting was not created.
131
+                if (!$printerrorkey) {
132
+                    print_error($response['message'], 'bigbluebuttonbn');
133
+                    break;
134
+                }
135
+                $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
136
+                print_error($printerrorkey, 'bigbluebuttonbn');
137
+                break;
138
+            }
128 139
 
129
-        if ($response['returncode'] == 'FAILED') {
130
-            // The meeting was not created.
131
-            if (!$printerrorkey) {
132
-                print_error($response['message'], 'bigbluebuttonbn');
140
+            if ($response['hasBeenForciblyEnded'] == 'true') {
141
+                print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
133 142
                 break;
134 143
             }
135
-            $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
136
-            print_error($printerrorkey, 'bigbluebuttonbn');
137
-            break;
138
-        }
139 144
 
140
-        if ($response['hasBeenForciblyEnded'] == 'true') {
141
-            print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
145
+            // Moodle event logger: Create an event for meeting created.
146
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
147
+            // Internal logger: Insert a record with the meeting created.
148
+            bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
149
+            // Since the meeting is already running, we just join the session.
150
+            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
142 151
             break;
143
-        }
152
+        case 'play':
153
+            $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
144 154
 
145
-        // Moodle event logger: Create an event for meeting created.
146
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
147
-        // Internal logger: Insert a record with the meeting created.
148
-        bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
149
-        // Since the meeting is already running, we just join the session.
150
-        bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
151
-        break;
152
-    case 'play':
153
-        $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
154
-
155
-        // Moodle event logger: Create an event for meeting left.
156
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
157
-        // Execute the redirect.
158
-        header('Location: '.urldecode($href));
159
-        break;
160
-    default:
161
-        bigbluebutton_bbb_view_close_window();
155
+            // Moodle event logger: Create an event for meeting left.
156
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
157
+            // Execute the redirect.
158
+            header('Location: '.urldecode($href));
159
+            break;
160
+        default:
161
+            bigbluebutton_bbb_view_close_window();
162 162
 }
163 163
 
164 164
 function bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype) {
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -195,10 +195,10 @@  discard block
 block discarded – undo
195 195
 
196 196
 function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession, $bigbluebuttonbn) {
197 197
     $data = ['meetingID' => $bbbsession['meetingid'],
198
-              'name' => $bbbsession['meetingname'],
199
-              'attendeePW' => $bbbsession['viewerPW'],
200
-              'moderatorPW' => $bbbsession['modPW'],
201
-              'logoutURL' => $bbbsession['logoutURL'],
198
+                'name' => $bbbsession['meetingname'],
199
+                'attendeePW' => $bbbsession['viewerPW'],
200
+                'moderatorPW' => $bbbsession['modPW'],
201
+                'logoutURL' => $bbbsession['logoutURL'],
202 202
             ];
203 203
     $data['record'] = bigbluebutton_bbb_view_create_meeting_data_record($bbbsession['record']);
204 204
     $data['welcome'] = trim($bbbsession['welcome']);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             '%duration%',
213 213
             (string) $durationtime,
214 214
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
215
-          );
215
+            );
216 216
     }
217 217
 
218 218
     $voicebridge = intval($bbbsession['voicebridge']);
@@ -246,14 +246,14 @@  discard block
 block discarded – undo
246 246
     global $USER;
247 247
 
248 248
     $metadata = ['bbb-origin' => $bbbsession['origin'],
249
-                 'bbb-origin-version' => $bbbsession['originVersion'],
250
-                 'bbb-origin-server-name' => $bbbsession['originServerName'],
251
-                 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
252
-                 'bbb-origin-tag' => $bbbsession['originTag'],
253
-                 'bbb-context' => $bbbsession['course']->fullname,
254
-                 'bbb-recording-name' => $bbbsession['meetingname'],
255
-                 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
256
-                 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
249
+                    'bbb-origin-version' => $bbbsession['originVersion'],
250
+                    'bbb-origin-server-name' => $bbbsession['originServerName'],
251
+                    'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
252
+                    'bbb-origin-tag' => $bbbsession['originTag'],
253
+                    'bbb-context' => $bbbsession['course']->fullname,
254
+                    'bbb-recording-name' => $bbbsession['meetingname'],
255
+                    'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
256
+                    'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
257 257
                 ];
258 258
 
259 259
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
             array(
262 262
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
263 263
                 'context' => $bbbsession['bigbluebuttonbnURL']
264
-              )
265
-          );
264
+                )
265
+            );
266 266
     }
267 267
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
268 268
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
Please login to merge, or discard this patch.
settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once(dirname(__FILE__).'/locallib.php');
30
+require_once(dirname(__FILE__) . '/locallib.php');
31 31
 
32 32
 if ($ADMIN->fulltree) {
33 33
     // Configuration for BigBlueButton.
Please login to merge, or discard this patch.
mod_form.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
 defined('MOODLE_INTERNAL') || die();
28 28
 
29
-require_once(dirname(__FILE__).'/locallib.php');
30
-require_once($CFG->dirroot.'/course/moodleform_mod.php');
29
+require_once(dirname(__FILE__) . '/locallib.php');
30
+require_once($CFG->dirroot . '/course/moodleform_mod.php');
31 31
 
32 32
 class mod_bigbluebuttonbn_mod_form extends moodleform_mod {
33 33
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $serverversion = bigbluebuttonbn_get_server_version();
38 38
         if (is_null($serverversion)) {
39 39
             print_error('general_error_unable_connect', 'bigbluebuttonbn',
40
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
40
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
41 41
             return;
42 42
         }
43 43
         // Context.
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 );
111 111
                 $defaultvalues['presentation'] = $draftitemid;
112 112
             } catch (Exception $e) {
113
-                debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER);
113
+                debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER);
114 114
                 return null;
115 115
             }
116 116
         }
@@ -282,10 +282,10 @@  discard block
 block discarded – undo
282 282
             html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type',
283 283
                 $participantselection['type_selected'], array(),
284 284
                 array('id' => 'bigbluebuttonbn_participant_selection_type',
285
-                      'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).'&nbsp;&nbsp;'.
285
+                      'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')) . '&nbsp;&nbsp;' .
286 286
             html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
287 287
                 $participantselection['selected'], array(),
288
-                array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).'&nbsp;&nbsp;'.
288
+                array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')) . '&nbsp;&nbsp;' .
289 289
             html_writer::tag('input', '', array('id' => 'id_addselectionid', 'type' => 'button', 'class' => 'btn btn-secondary',
290 290
                 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'),
291 291
                 'onclick' => 'M.mod_bigbluebuttonbn.modform.participant_add(); return 0;'
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         // Render elements for participant list.
303 303
         $htmllist = html_writer::tag('div',
304 304
             html_writer::label(get_string('mod_form_field_participant_list', 'bigbluebuttonbn'),
305
-                'bigbluebuttonbn_participant_list').
305
+                'bigbluebuttonbn_participant_list') .
306 306
             html_writer::table($table)
307 307
         );
308 308
         $mform->addElement('html', "\n\n");
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
             return;
333 333
         }
334 334
         $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options);
335
-        if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) {
335
+        if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) {
336 336
             $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn');
337 337
         }
338 338
         if (!empty($rule)) {
Please login to merge, or discard this patch.
db/upgrade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@
 block discarded – undo
85 85
         // Migrate settings.
86 86
         unset_config('recordingtagging_default', 'mod_bigbluebuttonbn');
87 87
         unset_config('recordingtagging_editable', 'mod_bigbluebuttonbn');
88
-        $cfgvalue =  get_config('mod_bigbluebuttonbn', 'importrecordings_from_deleted_activities_enabled');
88
+        $cfgvalue = get_config('mod_bigbluebuttonbn', 'importrecordings_from_deleted_activities_enabled');
89 89
         set_config('importrecordings_from_deleted_enabled', $cfgvalue, 'mod_bigbluebuttonbn');
90 90
         unset_config('importrecordings_from_deleted_activities_enabled', 'mod_bigbluebuttonbn');
91
-        $cfgvalue =  get_config('mod_bigbluebuttonbn', 'moderator_default');
91
+        $cfgvalue = get_config('mod_bigbluebuttonbn', 'moderator_default');
92 92
         set_config('participant_moderator_default', $cfgvalue, 'mod_bigbluebuttonbn');
93 93
         unset_config('moderator_default', 'mod_bigbluebuttonbn');
94 94
         // Update db version tag.
Please login to merge, or discard this patch.