Completed
Pull Request — v2.2-stable (#68)
by
unknown
01:59
created
classes/privacy/provider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@
 block discarded – undo
212 212
             function($instanceid, $data) use ($user, $instanceidstocmids) {
213 213
                 $context = \context_module::instance($instanceidstocmids[$instanceid]);
214 214
                 $contextdata = helper::get_context_data($context, $user);
215
-                $finaldata = (object) array_merge((array) $contextdata, ['logs' => $data]);
215
+                $finaldata = (object)array_merge((array)$contextdata, ['logs' => $data]);
216 216
                 helper::export_context_files($context, $user);
217 217
                 writer::with_context($context)->export_data([], $finaldata);
218 218
             }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public static function _get_metadata(collection $collection) {
63 63
 
64
-         // The table bigbluebuttonbn stores only the room properties.
65
-         // However, there is a chance that some personal information is stored as metadata.
66
-         // This would be done in the column 'participants' where rules can be set to define BBB roles.
67
-         // It is fair to say that only the userid is stored, which is useless if user is removed.
68
-         // But if this is a concern a refactoring on the way the rules are stored will be required.
64
+            // The table bigbluebuttonbn stores only the room properties.
65
+            // However, there is a chance that some personal information is stored as metadata.
66
+            // This would be done in the column 'participants' where rules can be set to define BBB roles.
67
+            // It is fair to say that only the userid is stored, which is useless if user is removed.
68
+            // But if this is a concern a refactoring on the way the rules are stored will be required.
69 69
         $collection->add_database_table('bigbluebuttonbn', [
70 70
             'participants' => 'privacy:metadata:bigbluebuttonbn:participants',
71 71
         ], 'privacy:metadata:bigbluebuttonbn');
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                     'meetingid' => $record->meetingid,
209 209
                     'log' => $record->log,
210 210
                     'meta' => $record->meta,
211
-                  ];
211
+                    ];
212 212
                 return $carry;
213 213
             },
214 214
             function($instanceid, $data) use ($user, $instanceidstocmids) {
Please login to merge, or discard this patch.
classes/locallib/config.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -152,33 +152,33 @@
 block discarded – undo
152 152
      */
153 153
     public static function get_options() {
154 154
         return array(
155
-               'version_major' => self::get_moodle_version_major(),
156
-               'voicebridge_editable' => self::get('voicebridge_editable'),
157
-               'importrecordings_enabled' => self::get('importrecordings_enabled'),
158
-               'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'),
159
-               'waitformoderator_default' => self::get('waitformoderator_default'),
160
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
161
-               'userlimit_default' => self::get('userlimit_default'),
162
-               'userlimit_editable' => self::get('userlimit_editable'),
163
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
164
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
165
-               'recordings_enabled' => self::get('recordings_enabled'),
166
-               'recordings_html_default' => self::get('recordings_html_default'),
167
-               'recordings_html_editable' => self::get('recordings_html_editable'),
168
-               'recordings_deleted_default' => self::get('recordings_deleted_default'),
169
-               'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
170
-               'recordings_imported_default' => self::get('recordings_imported_default'),
171
-               'recordings_imported_editable' => self::get('recordings_imported_editable'),
172
-               'recordings_preview_default' => self::get('recordings_preview_default'),
173
-               'recordings_preview_editable' => self::get('recordings_preview_editable'),
174
-               'recording_default' => self::get('recording_default'),
175
-               'recording_editable' => self::get('recording_editable'),
176
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
177
-               'general_warning_message' => self::get('general_warning_message'),
178
-               'general_warning_box_type' => self::get('general_warning_box_type'),
179
-               'general_warning_button_text' => self::get('general_warning_button_text'),
180
-               'general_warning_button_href' => self::get('general_warning_button_href'),
181
-               'general_warning_button_class' => self::get('general_warning_button_class'),
182
-          );
155
+                'version_major' => self::get_moodle_version_major(),
156
+                'voicebridge_editable' => self::get('voicebridge_editable'),
157
+                'importrecordings_enabled' => self::get('importrecordings_enabled'),
158
+                'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'),
159
+                'waitformoderator_default' => self::get('waitformoderator_default'),
160
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
161
+                'userlimit_default' => self::get('userlimit_default'),
162
+                'userlimit_editable' => self::get('userlimit_editable'),
163
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
164
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
165
+                'recordings_enabled' => self::get('recordings_enabled'),
166
+                'recordings_html_default' => self::get('recordings_html_default'),
167
+                'recordings_html_editable' => self::get('recordings_html_editable'),
168
+                'recordings_deleted_default' => self::get('recordings_deleted_default'),
169
+                'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
170
+                'recordings_imported_default' => self::get('recordings_imported_default'),
171
+                'recordings_imported_editable' => self::get('recordings_imported_editable'),
172
+                'recordings_preview_default' => self::get('recordings_preview_default'),
173
+                'recordings_preview_editable' => self::get('recordings_preview_editable'),
174
+                'recording_default' => self::get('recording_default'),
175
+                'recording_editable' => self::get('recording_editable'),
176
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
177
+                'general_warning_message' => self::get('general_warning_message'),
178
+                'general_warning_box_type' => self::get('general_warning_box_type'),
179
+                'general_warning_button_text' => self::get('general_warning_button_text'),
180
+                'general_warning_button_href' => self::get('general_warning_button_href'),
181
+                'general_warning_button_class' => self::get('general_warning_button_class'),
182
+            );
183 183
     }
184 184
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public static function defaultvalues() {
57 57
         return array(
58
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
59
-            'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
58
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
59
+            'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
60 60
             'voicebridge_editable' => 'false',
61 61
             'importrecordings_enabled' => 'false',
62 62
             'importrecordings_from_deleted_enabled' => 'false',
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
         if (isset($CFG->bigbluebuttonbn[$setting])) {
122 122
             return (string)$CFG->bigbluebuttonbn[$setting];
123 123
         }
124
-        if (isset($CFG->{'bigbluebuttonbn_'.$setting})) {
125
-            return (string)$CFG->{'bigbluebuttonbn_'.$setting};
124
+        if (isset($CFG->{'bigbluebuttonbn_' . $setting})) {
125
+            return (string)$CFG->{'bigbluebuttonbn_' . $setting};
126 126
         }
127 127
         return self::defaultvalue($setting);
128 128
     }
Please login to merge, or discard this patch.
locallib.php 3 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
  */
121 121
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
122 122
     $data = ['meetingID' => $meetingid,
123
-              'fullName' => $username,
124
-              'password' => $pw,
125
-              'logoutURL' => $logouturl,
123
+                'fullName' => $username,
124
+                'password' => $pw,
125
+                'logoutURL' => $logouturl,
126 126
             ];
127 127
     if (!is_null($configtoken)) {
128 128
         $data['configToken'] = $configtoken;
@@ -174,23 +174,23 @@  discard block
 block discarded – undo
174 174
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
175 175
     $xml = bigbluebuttonbn_wrap_xml_load_file(
176 176
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
177
-      );
177
+        );
178 178
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
179 179
         // Meeting info was returned.
180 180
         return array('returncode' => $xml->returncode,
181
-                     'meetingID' => $xml->meetingID,
182
-                     'moderatorPW' => $xml->moderatorPW,
183
-                     'attendeePW' => $xml->attendeePW,
184
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
185
-                     'running' => $xml->running,
186
-                     'recording' => $xml->recording,
187
-                     'startTime' => $xml->startTime,
188
-                     'endTime' => $xml->endTime,
189
-                     'participantCount' => $xml->participantCount,
190
-                     'moderatorCount' => $xml->moderatorCount,
191
-                     'attendees' => $xml->attendees,
192
-                     'metadata' => $xml->metadata,
193
-                   );
181
+                        'meetingID' => $xml->meetingID,
182
+                        'moderatorPW' => $xml->moderatorPW,
183
+                        'attendeePW' => $xml->attendeePW,
184
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
185
+                        'running' => $xml->running,
186
+                        'recording' => $xml->recording,
187
+                        'startTime' => $xml->startTime,
188
+                        'endTime' => $xml->endTime,
189
+                        'participantCount' => $xml->participantCount,
190
+                        'moderatorCount' => $xml->moderatorCount,
191
+                        'attendees' => $xml->attendees,
192
+                        'metadata' => $xml->metadata,
193
+                    );
194 194
     }
195 195
     if ($xml) {
196 196
         // Either failure or success without meeting info.
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 function bigbluebuttonbn_get_default_config_xml() {
327 327
     $xml = bigbluebuttonbn_wrap_xml_load_file(
328 328
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
329
-      );
329
+        );
330 330
     return $xml;
331 331
 }
332 332
 
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
     foreach ($ids as $id) {
428 428
         $xml = bigbluebuttonbn_wrap_xml_load_file(
429 429
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
430
-          );
430
+            );
431 431
         if ($xml && $xml->returncode != 'SUCCESS') {
432 432
             return false;
433 433
         }
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
     foreach ($ids as $id) {
447 447
         $xml = bigbluebuttonbn_wrap_xml_load_file(
448 448
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
449
-          );
449
+            );
450 450
         if ($xml && $xml->returncode != 'SUCCESS') {
451 451
             return false;
452 452
         }
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
     foreach ($ids as $id) {
466 466
         $xml = bigbluebuttonbn_wrap_xml_load_file(
467 467
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
468
-          );
468
+            );
469 469
         if ($xml && $xml->returncode != 'SUCCESS') {
470 470
             return false;
471 471
         }
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
483 483
     $xml = bigbluebuttonbn_wrap_xml_load_file(
484 484
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
485
-      );
485
+        );
486 486
     if ($xml) {
487 487
         // If the xml packet returned failure it displays the message to the user.
488 488
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 function bigbluebuttonbn_get_server_version() {
500 500
     $xml = bigbluebuttonbn_wrap_xml_load_file(
501 501
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
502
-      );
502
+        );
503 503
     if ($xml && $xml->returncode == 'SUCCESS') {
504 504
         return $xml->version;
505 505
     }
@@ -566,10 +566,10 @@  discard block
 block discarded – undo
566 566
         }
567 567
         $options = array();
568 568
         $options['CURLOPT_HTTPHEADER'] = array(
569
-                 'Content-Type: '.$contenttype,
570
-                 'Content-Length: '.strlen($data),
571
-                 'Content-Language: en-US',
572
-               );
569
+                    'Content-Type: '.$contenttype,
570
+                    'Content-Length: '.strlen($data),
571
+                    'Content-Language: en-US',
572
+                );
573 573
 
574 574
         return $c->post($url, $data, $options);
575 575
     }
@@ -716,16 +716,16 @@  discard block
 block discarded – undo
716 716
         'all' => array(
717 717
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
718 718
             'children' => []
719
-          )
720
-      );
719
+            )
720
+        );
721 721
     $data['role'] = array(
722 722
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
723 723
         'children' => bigbluebuttonbn_get_roles_select($context)
724
-      );
724
+        );
725 725
     $data['user'] = array(
726 726
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
727 727
         'children' => bigbluebuttonbn_get_users_select($context)
728
-      );
728
+        );
729 729
     return $data;
730 730
 }
731 731
 
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
         'selectiontype' => 'all',
767 767
         'selectionid' => 'all',
768 768
         'role' => BIGBLUEBUTTONBN_ROLE_VIEWER
769
-      );
769
+        );
770 770
     $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default'));
771 771
     foreach ($defaultrules as $defaultrule) {
772 772
         if ($defaultrule == '0') {
@@ -779,9 +779,9 @@  discard block
 block discarded – undo
779 779
             continue;
780 780
         }
781 781
         $participantlist[] = array(
782
-              'selectiontype' => 'role',
783
-              'selectionid' => $defaultrule,
784
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
782
+                'selectiontype' => 'role',
783
+                'selectionid' => $defaultrule,
784
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
785 785
     }
786 786
     return $participantlist;
787 787
 }
@@ -820,11 +820,11 @@  discard block
 block discarded – undo
820 820
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
821 821
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
822 822
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
823
-          ],
823
+            ],
824 824
         'type_selected' => 'all',
825 825
         'options' => ['all' => '---------------'],
826 826
         'selected' => 'all',
827
-      ];
827
+        ];
828 828
 }
829 829
 
830 830
 /**
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
         $eventproperties['other'] = $options['other'];
1102 1102
     }
1103 1103
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1104
-      array($eventproperties));
1104
+        array($eventproperties));
1105 1105
     $event->trigger();
1106 1106
 }
1107 1107
 
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
     // Ping again and refresh the cache.
1146 1146
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1147 1147
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1148
-      );
1148
+        );
1149 1149
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1150 1150
     return $meetinginfo;
1151 1151
 }
@@ -1557,8 +1557,8 @@  discard block
 block discarded – undo
1557 1557
     }
1558 1558
     $id = 'playbacks-'.$recording['recordID'];
1559 1559
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1560
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1561
-          'title' => $title, $visibility => $visibility));
1560
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1561
+            'title' => $title, $visibility => $visibility));
1562 1562
     foreach ($recording['playbacks'] as $playback) {
1563 1563
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback);
1564 1564
     }
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
     }
1583 1583
     $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1584 1584
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1585
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1585
+        '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1586 1586
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1587 1587
         $href .= '&href='.urlencode(trim($playback['url']));
1588 1588
     }
@@ -1593,7 +1593,7 @@  discard block
 block discarded – undo
1593 1593
         'data-action' => 'play',
1594 1594
         'data-target' => $playback['type'],
1595 1595
         'data-href' => $href,
1596
-      );
1596
+        );
1597 1597
     if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) {
1598 1598
         $linkattributes['class'] = 'btn btn-sm btn-warning';
1599 1599
         $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn');
@@ -1743,10 +1743,10 @@  discard block
 block discarded – undo
1743 1743
             'id' => $id,
1744 1744
             'onclick' => $onclick,
1745 1745
             'data-action' => $data['action']
1746
-          );
1746
+            );
1747 1747
         if (!isset($recording['imported'])) {
1748 1748
             $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(
1749
-              $recording['recordID']);
1749
+                $recording['recordID']);
1750 1750
         }
1751 1751
         if (isset($data['disabled'])) {
1752 1752
             $iconattributes['class'] .= ' fa-' . $data['disabled'];
@@ -2287,8 +2287,8 @@  discard block
 block discarded – undo
2287 2287
     $activitytime = '';
2288 2288
     if ($time) {
2289 2289
         $activitytime = calendar_day_representation($time).' '.
2290
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2291
-          calendar_time_representation($time);
2290
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2291
+            calendar_time_representation($time);
2292 2292
     }
2293 2293
     return $activitytime;
2294 2294
 }
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
     global $BIGBLUEBUTTONBN_CFG;
2385 2385
     if (isset($BIGBLUEBUTTONBN_CFG)) {
2386 2386
         $renderer->render_warning_message('general_warning',
2387
-             get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn'));
2387
+                get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn'));
2388 2388
     }
2389 2389
 }
2390 2390
 
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
         $renderer->render_group_element('participant_moderator_default',
2593 2593
             $renderer->render_group_element_configmultiselect('participant_moderator_default',
2594 2594
                 array_keys($owner), array_merge($owner, $roles))
2595
-          );
2595
+            );
2596 2596
     }
2597 2597
 }
2598 2598
 
@@ -2696,7 +2696,7 @@  discard block
 block discarded – undo
2696 2696
         return $output;
2697 2697
     }
2698 2698
     $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in',
2699
-      'bigbluebuttonbn_view_general_warning') . "\n";
2699
+        'bigbluebuttonbn_view_general_warning') . "\n";
2700 2700
     $output .= '    ' . $message . "\n";
2701 2701
     $output .= '  <div class="singlebutton pull-right">' . "\n";
2702 2702
     if (!empty($href)) {
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once(dirname(__FILE__).'/lib.php');
31
+require_once(dirname(__FILE__) . '/lib.php');
32 32
 
33 33
 /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */
34 34
 const BIGBLUEBUTTONBN_UPDATE_CACHE = true;
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
     $data = null;
119 119
     if (!is_null($pname) && !is_null($purl)) {
120 120
         $method = 'POST';
121
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
122
-            $purl."' /></module></modules>";
121
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
122
+            $purl . "' /></module></modules>";
123 123
     }
124 124
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
125 125
     if ($xml) {
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         // Override imported flag with actual ID.
281 281
         $recording['imported'] = $recordimported->id;
282 282
         if (isset($recordimported->protected)) {
283
-            $recording['protected'] = (string) $recordimported->protected;
283
+            $recording['protected'] = (string)$recordimported->protected;
284 284
         }
285 285
         $recordsimportedarray[$recording['recordID']] = $recording;
286 286
     }
@@ -310,21 +310,21 @@  discard block
 block discarded – undo
310 310
     // Add formats.
311 311
     $playbackarray = array();
312 312
     foreach ($recording->playback->format as $format) {
313
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
314
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
313
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
314
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
315 315
         // Add preview per format when existing.
316 316
         if ($format->preview) {
317
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
317
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
318 318
         }
319 319
     }
320 320
     // Add the metadata to the recordings array.
321 321
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
322
-    $recordingarray = array('recordID' => (string) $recording->recordID,
323
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
324
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
325
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
322
+    $recordingarray = array('recordID' => (string)$recording->recordID,
323
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
324
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
325
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
326 326
     if (isset($recording->protected)) {
327
-        $recordingarray['protected'] = (string) $recording->protected;
327
+        $recordingarray['protected'] = (string)$recording->protected;
328 328
     }
329 329
     return $recordingarray + $metadataarray;
330 330
 }
@@ -339,9 +339,9 @@  discard block
 block discarded – undo
339 339
 function bigbluebuttonbn_get_recording_preview_images($preview) {
340 340
     $imagesarray = array();
341 341
     foreach ($preview->images->image as $image) {
342
-        $imagearray = array('url' => trim((string) $image));
342
+        $imagearray = array('url' => trim((string)$image));
343 343
         foreach ($image->attributes() as $attkey => $attvalue) {
344
-            $imagearray[$attkey] = (string) $attvalue;
344
+            $imagearray[$attkey] = (string)$attvalue;
345 345
         }
346 346
         array_push($imagesarray, $imagearray);
347 347
     }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         if (is_object($value)) {
362 362
             $value = '';
363 363
         }
364
-        $metadataarray['meta_'.$key] = $value;
364
+        $metadataarray['meta_' . $key] = $value;
365 365
     }
366 366
     return $metadataarray;
367 367
 }
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
     $ids = explode(',', $recordids);
434 434
     foreach ($ids as $id) {
435 435
         $xml = bigbluebuttonbn_wrap_xml_load_file(
436
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
436
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
437 437
           );
438 438
         if ($xml && $xml->returncode != 'SUCCESS') {
439 439
             return false;
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             return $xml;
499 499
         } catch (Exception $e) {
500 500
             libxml_use_internal_errors($previous);
501
-            $error = 'Caught exception: '.$e->getMessage();
501
+            $error = 'Caught exception: ' . $e->getMessage();
502 502
             debugging($error, DEBUG_DEVELOPER);
503 503
             return null;
504 504
         }
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
510 510
         return $response;
511 511
     } catch (Exception $e) {
512
-        $error = 'Caught exception: '.$e->getMessage();
512
+        $error = 'Caught exception: ' . $e->getMessage();
513 513
         debugging($error, DEBUG_DEVELOPER);
514 514
         libxml_use_internal_errors($previous);
515 515
         return null;
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
         }
536 536
         $options = array();
537 537
         $options['CURLOPT_HTTPHEADER'] = array(
538
-                 'Content-Type: '.$contenttype,
539
-                 'Content-Length: '.strlen($data),
538
+                 'Content-Type: ' . $contenttype,
539
+                 'Content-Length: ' . strlen($data),
540 540
                  'Content-Language: en-US',
541 541
                );
542 542
 
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
  * @return void
558 558
  */
559 559
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
560
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
560
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
561 561
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
562 562
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
563 563
     }
@@ -577,9 +577,9 @@  discard block
 block discarded – undo
577 577
     if ($userroles) {
578 578
         $where = '';
579 579
         foreach ($userroles as $userrole) {
580
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid;
580
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid;
581 581
         }
582
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
582
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
583 583
     }
584 584
     return $userroles;
585 585
 }
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
  * @return array $users
603 603
  */
604 604
 function bigbluebuttonbn_get_users(context $context = null) {
605
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
605
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
606 606
     foreach ($users as $key => $value) {
607 607
         $users[$key] = fullname($value);
608 608
     }
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
  * @return array $users
618 618
  */
619 619
 function bigbluebuttonbn_get_users_select(context $context = null) {
620
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
620
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
621 621
     foreach ($users as $key => $value) {
622 622
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
623 623
     }
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
  * @return array $roles
633 633
  */
634 634
 function bigbluebuttonbn_get_roles(context $context = null) {
635
-    $roles = (array) role_get_names($context);
635
+    $roles = (array)role_get_names($context);
636 636
     foreach ($roles as $key => $value) {
637 637
         $roles[$key] = $value->localname;
638 638
     }
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
  * @return array $users
648 648
  */
649 649
 function bigbluebuttonbn_get_roles_select(context $context = null) {
650
-    $roles = (array) role_get_names($context);
650
+    $roles = (array)role_get_names($context);
651 651
     foreach ($roles as $key => $value) {
652 652
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
653 653
     }
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
  * @return object $role
663 663
  */
664 664
 function bigbluebuttonbn_get_role($id) {
665
-    $roles = (array) role_get_names();
665
+    $roles = (array)role_get_names();
666 666
     if (is_numeric($id) && isset($roles[$id])) {
667 667
         return (object)$roles[$id];
668 668
     }
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
     if (!isguestuser()) {
820 820
         $userroles = bigbluebuttonbn_get_user_roles($context, $userid);
821 821
     }
822
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
822
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
823 823
 }
824 824
 
825 825
 /**
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
 function bigbluebuttonbn_generate_nonce() {
976 976
     $mt = microtime();
977 977
     $rand = mt_rand();
978
-    return md5($mt.$rand);
978
+    return md5($mt . $rand);
979 979
 }
980 980
 
981 981
 /**
@@ -1001,21 +1001,21 @@  discard block
 block discarded – undo
1001 1001
  */
1002 1002
 function bigbluebuttonbn_events() {
1003 1003
     return array(
1004
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1005
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1006
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1007
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1008
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1009
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1010
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1011
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1012
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1013
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1014
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1015
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1016
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1017
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1018
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1004
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1005
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1006
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1007
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1008
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1009
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1010
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1011
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1012
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1013
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1014
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1015
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1016
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1017
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1018
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1019 1019
     );
1020 1020
 }
1021 1021
 
@@ -1026,21 +1026,21 @@  discard block
 block discarded – undo
1026 1026
  */
1027 1027
 function bigbluebuttonbn_events_action() {
1028 1028
     return array(
1029
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1030
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1031
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1032
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1033
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1034
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1035
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1036
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1037
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1038
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1039
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1040
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1041
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1042
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1043
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1029
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1030
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1031
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1032
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1033
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1034
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1035
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1036
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1037
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1038
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1039
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1040
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1041
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1042
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1043
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1044 1044
     );
1045 1045
 }
1046 1046
 
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
     if (array_key_exists('other', $options)) {
1072 1072
         $eventproperties['other'] = $options['other'];
1073 1073
     }
1074
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1074
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
1075 1075
       array($eventproperties));
1076 1076
     $event->trigger();
1077 1077
 }
@@ -1111,10 +1111,10 @@  discard block
 block discarded – undo
1111 1111
     $now = time();
1112 1112
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1113 1113
         // Use the value in the cache.
1114
-        return (array) json_decode($result['meeting_info']);
1114
+        return (array)json_decode($result['meeting_info']);
1115 1115
     }
1116 1116
     // Ping again and refresh the cache.
1117
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1117
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1118 1118
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1119 1119
       );
1120 1120
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1225,7 +1225,7 @@  discard block
 block discarded – undo
1225 1225
  * @return object
1226 1226
  */
1227 1227
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1228
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1228
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1229 1229
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1230 1230
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST',
1231 1231
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1241,8 +1241,8 @@  discard block
 block discarded – undo
1241 1241
  * @return string
1242 1242
  */
1243 1243
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1244
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1245
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1244
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1245
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1246 1246
     return $configxmlparams;
1247 1247
 }
1248 1248
 
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
  */
1257 1257
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1258 1258
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1259
-    $configxmlarray = (array) $configxml;
1259
+    $configxmlarray = (array)$configxml;
1260 1260
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1261 1261
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1262 1262
         return '';
@@ -1348,7 +1348,7 @@  discard block
 block discarded – undo
1348 1348
     global $USER;
1349 1349
     $starttime = $starttime - ($starttime % 1000);
1350 1350
     // Set formatted date.
1351
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1351
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1352 1352
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1353 1353
 }
1354 1354
 
@@ -1464,7 +1464,7 @@  discard block
 block discarded – undo
1464 1464
  * @return string
1465 1465
  */
1466 1466
 function bigbluebuttonbn_get_recording_data_row_preview($recording) {
1467
-    $options = array('id' => 'preview-'.$recording['recordID']);
1467
+    $options = array('id' => 'preview-' . $recording['recordID']);
1468 1468
     if ($recording['published'] === 'false') {
1469 1469
         $options['hidden'] = 'hidden';
1470 1470
     }
@@ -1526,7 +1526,7 @@  discard block
 block discarded – undo
1526 1526
     if ($recording['published'] === 'false') {
1527 1527
         $visibility = 'hidden ';
1528 1528
     }
1529
-    $id = 'playbacks-'.$recording['recordID'];
1529
+    $id = 'playbacks-' . $recording['recordID'];
1530 1530
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1531 1531
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1532 1532
           'title' => $title, $visibility => $visibility));
@@ -1551,11 +1551,11 @@  discard block
 block discarded – undo
1551 1551
     if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) {
1552 1552
         return '';
1553 1553
     }
1554
-    $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1554
+    $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1555 1555
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1556
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1556
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1557 1557
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1558
-        $href .= '&href='.urlencode(trim($playback['url']));
1558
+        $href .= '&href=' . urlencode(trim($playback['url']));
1559 1559
     }
1560 1560
     $linkattributes = array(
1561 1561
         'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'],
@@ -1724,7 +1724,7 @@  discard block
 block discarded – undo
1724 1724
             $linkattributes['class'] = 'disabled';
1725 1725
             unset($linkattributes['onclick']);
1726 1726
         }
1727
-        $icon = new pix_icon('i/'.$data['tag'],
1727
+        $icon = new pix_icon('i/' . $data['tag'],
1728 1728
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1729 1729
             'moodle', $iconattributes);
1730 1730
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
@@ -1841,7 +1841,7 @@  discard block
 block discarded – undo
1841 1841
  */
1842 1842
 function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) {
1843 1843
     $row = new html_table_row();
1844
-    $row->id = 'recording-tr-'.$recording['recordID'];
1844
+    $row->id = 'recording-tr-' . $recording['recordID'];
1845 1845
     $row->attributes['data-imported'] = 'false';
1846 1846
     $texthead = '';
1847 1847
     $texttail = '';
@@ -1901,9 +1901,9 @@  discard block
 block discarded – undo
1901 1901
 function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) {
1902 1902
     $sender = get_admin();
1903 1903
     // Prepare message.
1904
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
1905
-        ' "' . $bigbluebuttonbn->name . '" '.
1906
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1904
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') .
1905
+        ' "' . $bigbluebuttonbn->name . '" ' .
1906
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1907 1907
     $context = context_course::instance($bigbluebuttonbn->course);
1908 1908
     \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext);
1909 1909
 }
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
     }
2126 2126
     // Prepare select for loading records based on existent bigbluebuttonbns.
2127 2127
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
2128
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
2128
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
2129 2129
     // Include only Create events and exclude those with record not true.
2130 2130
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
2131 2131
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -2257,8 +2257,8 @@  discard block
 block discarded – undo
2257 2257
 function bigbluebuttonbn_format_activity_time($time) {
2258 2258
     $activitytime = '';
2259 2259
     if ($time) {
2260
-        $activitytime = calendar_day_representation($time).' '.
2261
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2260
+        $activitytime = calendar_day_representation($time) . ' ' .
2261
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2262 2262
           calendar_time_representation($time);
2263 2263
     }
2264 2264
     return $activitytime;
@@ -2659,7 +2659,7 @@  discard block
 block discarded – undo
2659 2659
  *
2660 2660
  * @return string
2661 2661
  */
2662
-function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') {
2662
+function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') {
2663 2663
     global $OUTPUT;
2664 2664
     $output = "\n";
2665 2665
     // Evaluates if config_warning is enabled.
@@ -2698,11 +2698,11 @@  discard block
 block discarded – undo
2698 2698
     if ($class == '') {
2699 2699
         $class = 'btn btn-secondary';
2700 2700
     }
2701
-    $output  = '  <form method="post" action="' . $href . '" class="form-inline">'."\n";
2702
-    $output .= '      <button type="submit" class="' . $class . '"'."\n";
2703
-    $output .= '          title="' . $title . '"'."\n";
2704
-    $output .= '          >' . $text . '</button>'."\n";
2705
-    $output .= '  </form>'."\n";
2701
+    $output  = '  <form method="post" action="' . $href . '" class="form-inline">' . "\n";
2702
+    $output .= '      <button type="submit" class="' . $class . '"' . "\n";
2703
+    $output .= '          title="' . $title . '"' . "\n";
2704
+    $output .= '          >' . $text . '</button>' . "\n";
2705
+    $output .= '  </form>' . "\n";
2706 2706
     return $output;
2707 2707
 }
2708 2708
 
Please login to merge, or discard this patch.
Doc Comments   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
  * Helper function to retrieve recordings from a BigBlueButton server.
174 174
  *
175 175
  * @param string|array $meetingids   list of meetingIDs "mid1,mid2,mid3" or array("mid1","mid2","mid3")
176
- * @param string|array $recordingids list of $recordingids "rid1,rid2,rid3" or array("rid1","rid2","rid3") for filtering
176
+ * @param string $recordingids list of $recordingids "rid1,rid2,rid3" or array("rid1","rid2","rid3") for filtering
177 177
  *
178
- * @return associative array with recordings indexed by recordID, each recording is a non sequential associative array
178
+ * @return string array with recordings indexed by recordID, each recording is a non sequential associative array
179 179
  */
180 180
 function bigbluebuttonbn_get_recordings_array($meetingids, $recordingids = []) {
181 181
     $meetingidsarray = $meetingids;
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
  * Helper function to retrieve imported recordings from the Moodle database.
263 263
  * The references are stored as events in bigbluebuttonbn_logs.
264 264
  *
265
- * @param string $courseid
265
+ * @param integer $courseid
266 266
  * @param string $bigbluebuttonbnid
267 267
  * @param bool   $subset
268 268
  *
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 /**
291 291
  * Helper function to retrive the default config.xml file.
292 292
  *
293
- * @return string
293
+ * @return null|SimpleXMLElement
294 294
  */
295 295
 function bigbluebuttonbn_get_default_config_xml() {
296 296
     $xml = bigbluebuttonbn_wrap_xml_load_file(
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
  * @param object $a
373 373
  * @param object $b
374 374
  *
375
- * @return array
375
+ * @return integer
376 376
  */
377 377
 function bigbluebuttonbn_recording_build_sorter($a, $b) {
378 378
     if ($a['startTime'] < $b['startTime']) {
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
  * @param string $data
484 484
  * @param string $contenttype
485 485
  *
486
- * @return object
486
+ * @return null|SimpleXMLElement
487 487
  */
488 488
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
489 489
     if (extension_loaded('curl')) {
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
  * @param string $data
525 525
  * @param string $contenttype
526 526
  *
527
- * @return object
527
+ * @return string
528 528
  */
529 529
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
530 530
     $c = new curl();
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
  * @param integer $instance
895 895
  * @param integer $voicebridge
896 896
  *
897
- * @return string
897
+ * @return boolean
898 898
  */
899 899
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
900 900
     global $DB;
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
 /**
998 998
  * Helper returns an array with all possible bigbluebuttonbn events.
999 999
  *
1000
- * @return array
1000
+ * @return string[]
1001 1001
  */
1002 1002
 function bigbluebuttonbn_events() {
1003 1003
     return array(
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
  * @param string $meetingid
1224 1224
  * @param string $configxml
1225 1225
  *
1226
- * @return object
1226
+ * @return null|SimpleXMLElement
1227 1227
  */
1228 1228
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1229 1229
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
@@ -1272,7 +1272,7 @@  discard block
 block discarded – undo
1272 1272
  * @param array $recording
1273 1273
  * @param array $tools
1274 1274
  *
1275
- * @return array
1275
+ * @return null|stdClass
1276 1276
  */
1277 1277
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1278 1278
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
  *
1837 1837
  * @param array $bbbsession
1838 1838
  * @param array $recording
1839
- * @param object $rowdata
1839
+ * @param stdClass $rowdata
1840 1840
  *
1841 1841
  * @return object
1842 1842
  */
@@ -2031,7 +2031,7 @@  discard block
 block discarded – undo
2031 2031
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2032 2032
  * in the getRecordings request considering only those that belong to deleted activities.
2033 2033
  *
2034
- * @param string $courseid
2034
+ * @param integer $courseid
2035 2035
  * @param string $bigbluebuttonbnid
2036 2036
  * @param bool   $subset
2037 2037
  *
@@ -2055,7 +2055,7 @@  discard block
 block discarded – undo
2055 2055
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2056 2056
  * in the getRecordings request considering only those that belong to imported recordings.
2057 2057
  *
2058
- * @param string $courseid
2058
+ * @param integer $courseid
2059 2059
  * @param string $bigbluebuttonbnid
2060 2060
  * @param bool   $subset
2061 2061
  *
@@ -2078,7 +2078,7 @@  discard block
 block discarded – undo
2078 2078
 /**
2079 2079
  * Helper function to get recordings  and imported recordings together.
2080 2080
  *
2081
- * @param string $courseid
2081
+ * @param integer $courseid
2082 2082
  * @param string $bigbluebuttonbnid
2083 2083
  * @param bool   $subset
2084 2084
  * @param bool   $includedeleted
@@ -2096,7 +2096,7 @@  discard block
 block discarded – undo
2096 2096
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2097 2097
  * in bigbluebuttonbn_logs.
2098 2098
  *
2099
- * @param string $courseid
2099
+ * @param integer $courseid
2100 2100
  * @param string $bigbluebuttonbnid
2101 2101
  * @param bool   $subset
2102 2102
  * @param bool   $includedeleted
Please login to merge, or discard this patch.
classes/locallib/notifier.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public static function notification_process($context, $bigbluebuttonbn, $action) {
48 48
         global $USER;
49 49
         // Prepare message.
50
-        $msg = (object) array();
50
+        $msg = (object)array();
51 51
         // Build the message_body.
52 52
         $msg->action = $action;
53 53
         $msg->activity_type = '';
@@ -72,26 +72,26 @@  discard block
 block discarded – undo
72 72
      * @return string
73 73
      */
74 74
     public static function notification_msg_html($msg) {
75
-        $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.
76
-            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
77
-        $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.
78
-            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
79
-        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
80
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
81
-            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
82
-        $messagetext .= $msg->activity_title.'</td></tr>'."\n";
83
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
84
-            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
85
-        $messagetext .= $msg->activity_description.'</td></tr>'."\n";
86
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
87
-            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
88
-        $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";
89
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
90
-            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
91
-        $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";
92
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.
93
-            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
94
-        $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
75
+        $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' .
76
+            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
77
+        $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .
78
+            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
79
+        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
80
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
81
+            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
82
+        $messagetext .= $msg->activity_title . '</td></tr>' . "\n";
83
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
84
+            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
85
+        $messagetext .= $msg->activity_description . '</td></tr>' . "\n";
86
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
87
+            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
88
+        $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";
89
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
90
+            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
91
+        $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";
92
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .
93
+            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
94
+        $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
95 95
         return $messagetext;
96 96
     }
97 97
 
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
         global $DB;
109 109
         $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
110 110
         // Complete message.
111
-        $msg = (object) array();
111
+        $msg = (object)array();
112 112
         $msg->user_name = fullname($sender);
113 113
         $msg->user_email = $sender->email;
114 114
         $msg->course_name = "$course->fullname";
115
-        $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.
116
-            $msg->user_name.'('.$msg->user_email.') ';
117
-        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
118
-        $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
115
+        $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' .
116
+            $msg->user_name . '(' . $msg->user_email . ') ';
117
+        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
118
+        $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
119 119
         foreach ($users as $user) {
120 120
             if ($user->id != $sender->id) {
121 121
                 message_post_message($sender, $user, $message, FORMAT_MOODLE);
Please login to merge, or discard this patch.
bbb_broker.php 3 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -440,26 +440,26 @@  discard block
 block discarded – undo
440 440
             return array(
441 441
                 'status' => false,
442 442
                 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn')
443
-              );
443
+                );
444 444
         }
445 445
         if ($realrecordings[$params['id']]['published'] !== 'true') {
446 446
             return array(
447 447
                 'status' => false,
448 448
                 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn')
449
-              );
449
+                );
450 450
         }
451 451
         return array(
452 452
             'status' => bigbluebuttonbn_publish_recording_imported(
453 453
                 $recordings[$params['id']]['imported'], true
454 454
             )
455
-          );
455
+            );
456 456
     }
457 457
     // As the recordingid was not identified as imported recording link, execute actual publish.
458 458
     return array(
459 459
         'status' => bigbluebuttonbn_publish_recordings(
460 460
             $params['id'], 'true'
461 461
         )
462
-      );
462
+        );
463 463
 }
464 464
 
465 465
 /**
@@ -480,26 +480,26 @@  discard block
 block discarded – undo
480 480
             return array(
481 481
                 'status' => false,
482 482
                 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn')
483
-              );
483
+                );
484 484
         }
485 485
         if ($realrecordings[$params['id']]['protected'] === 'true') {
486 486
             return array(
487 487
                 'status' => false,
488 488
                 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn')
489
-              );
489
+                );
490 490
         }
491 491
         return array(
492 492
             'status' => bigbluebuttonbn_protect_recording_imported(
493 493
                 $recordings[$params['id']]['imported'], false
494 494
             )
495
-          );
495
+            );
496 496
     }
497 497
     // As the recordingid was not identified as imported recording link, execute actual uprotect.
498 498
     return array(
499 499
         'status' => bigbluebuttonbn_update_recordings(
500 500
             $params['id'], array('protect' => 'false')
501 501
         )
502
-      );
502
+        );
503 503
 }
504 504
 
505 505
 /**
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
             'status' => bigbluebuttonbn_publish_recording_imported(
519 519
                 $recordings[$params['id']]['imported'], false
520 520
             )
521
-          );
521
+            );
522 522
     }
523 523
     // As the recordingid was not identified as imported recording link, execute unpublish on a real recording.
524 524
     // First: Unpublish imported links associated to the recording.
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
         'status' => bigbluebuttonbn_publish_recordings(
537 537
             $params['id'], 'false'
538 538
         )
539
-      );
539
+        );
540 540
 }
541 541
 
542 542
 /**
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
             'status' => bigbluebuttonbn_protect_recording_imported(
556 556
                 $recordings[$params['id']]['imported'], true
557 557
             )
558
-          );
558
+            );
559 559
     }
560 560
     // As the recordingid was not identified as imported recording link, execute protect on a real recording.
561 561
     // First: Protect imported links associated to the recording.
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         'status' => bigbluebuttonbn_update_recordings(
574 574
             $params['id'], array('protect' => 'true')
575 575
         )
576
-      );
576
+        );
577 577
 }
578 578
 
579 579
 /**
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
             'status' => bigbluebuttonbn_delete_recording_imported(
593 593
                 $recordings[$params['id']]['imported']
594 594
             )
595
-          );
595
+            );
596 596
     }
597 597
     // As the recordingid was not identified as imported recording link, execute delete on a real recording.
598 598
     // First: Delete imported links associated to the recording.
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
     // Second: Execute the actual delete.
607 607
     return array(
608 608
         'status' => bigbluebuttonbn_delete_recordings($params['id'])
609
-      );
609
+        );
610 610
 }
611 611
 
612 612
 /**
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
             'status' => bigbluebuttonbn_update_recording_imported(
625 625
                 $recordings[$params['id']]['imported'], json_decode($params['meta'], true)
626 626
             )
627
-          );
627
+            );
628 628
     }
629 629
 
630 630
     // As the recordingid was not identified as imported recording link, execute update on a real recording.
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
         'status' => bigbluebuttonbn_update_recordings(
635 635
             $params['id'], json_decode($params['meta'])
636 636
         )
637
-      );
637
+        );
638 638
 }
639 639
 
640 640
 /**
@@ -666,14 +666,14 @@  discard block
 block discarded – undo
666 666
     }
667 667
     // Sends the messages.
668 668
     try {
669
-      //That if was for trying to workaround the several emails sent for one record ready
670
-      if(bigbluebuttonbn_get_count_callback_event_log($decodedparameters->record_id) == 0)){
669
+        //That if was for trying to workaround the several emails sent for one record ready
670
+        if(bigbluebuttonbn_get_count_callback_event_log($decodedparameters->record_id) == 0)){
671 671
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
672
-      }
673
-      $overrides = array('meetingid' => $bigbluebuttonbn->meetingid);
674
-      $meta = '{"recordID":'.$decodedparameters->record_id.'}';
675
-      bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
676
-      header('HTTP/1.0 202 Accepted');
672
+        }
673
+        $overrides = array('meetingid' => $bigbluebuttonbn->meetingid);
674
+        $meta = '{"recordID":'.$decodedparameters->record_id.'}';
675
+        bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
676
+        header('HTTP/1.0 202 Accepted');
677 677
     } catch (Exception $e) {
678 678
         $error = 'Caught exception: '.$e->getMessage();
679 679
         header('HTTP/1.0 503 Service Unavailable. '.$error);
@@ -807,11 +807,11 @@  discard block
 block discarded – undo
807 807
     $params['recording_ready'] = [
808 808
             'bigbluebuttonbn' => 'An id for the bigbluebuttonbn instance should be included.',
809 809
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
810
-          ];
810
+            ];
811 811
     $params['live_session_events'] = [
812 812
             'bigbluebuttonbn' => 'An id for the bigbluebuttonbn instance should be included.',
813 813
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
814
-          ];
814
+            ];
815 815
     return $params;
816 816
 }
817 817
 
@@ -822,9 +822,9 @@  discard block
 block discarded – undo
822 822
  */
823 823
 function bigbluebuttonbn_broker_required_parameters_default($id) {
824 824
     return [
825
-              'id' => "The {$id} must be specified.",
826
-              'callback' => 'This call must include a javascript callback.'
827
-           ];
825
+                'id' => "The {$id} must be specified.",
826
+                'callback' => 'This call must include a javascript callback.'
827
+            ];
828 828
 }
829 829
 
830 830
 /**
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
  */
25 25
 
26 26
 
27
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
28
-require_once(dirname(__FILE__).'/locallib.php');
27
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
28
+require_once(dirname(__FILE__) . '/locallib.php');
29 29
 
30 30
 use \Firebase\JWT\JWT;
31 31
 
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 $params['meta'] = optional_param('meta', '', PARAM_TEXT);
42 42
 
43 43
 if (empty($params['action'])) {
44
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
44
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
45 45
     return;
46 46
 }
47 47
 
48 48
 $error = bigbluebuttonbn_broker_validate_parameters($params);
49 49
 if (!empty($error)) {
50
-    header('HTTP/1.0 400 Bad Request. '.$error);
50
+    header('HTTP/1.0 400 Bad Request. ' . $error);
51 51
     return;
52 52
 }
53 53
 
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
         bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm);
133 133
         return;
134 134
     }
135
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
135
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
136 136
     return;
137 137
 
138 138
 } catch (Exception $e) {
139
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
139
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
140 140
     return;
141 141
 }
142 142
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
323 323
     $callbackresponse['status'] = true;
324 324
     $callbackresponse['found'] = true;
325
-    $callbackresponse['published'] = (string) $recording['published'];
325
+    $callbackresponse['published'] = (string)$recording['published'];
326 326
     if (!isset($params['meta']) || empty($params['meta'])) {
327 327
         return $callbackresponse;
328 328
     }
@@ -651,8 +651,8 @@  discard block
 block discarded – undo
651 651
         $decodedparameters = JWT::decode($params['signed_parameters'],
652 652
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
653 653
     } catch (Exception $e) {
654
-        $error = 'Caught exception: '.$e->getMessage();
655
-        header('HTTP/1.0 400 Bad Request. '.$error);
654
+        $error = 'Caught exception: ' . $e->getMessage();
655
+        header('HTTP/1.0 400 Bad Request. ' . $error);
656 656
         return;
657 657
     }
658 658
 
@@ -667,16 +667,16 @@  discard block
 block discarded – undo
667 667
     // Sends the messages.
668 668
     try {
669 669
       //That if was for trying to workaround the several emails sent for one record ready
670
-      if(bigbluebuttonbn_get_count_callback_event_log($decodedparameters->record_id) == 0)){
670
+      if (bigbluebuttonbn_get_count_callback_event_log($decodedparameters->record_id) == 0)){
671 671
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
672 672
       }
673 673
       $overrides = array('meetingid' => $bigbluebuttonbn->meetingid);
674
-      $meta = '{"recordID":'.$decodedparameters->record_id.'}';
674
+      $meta = '{"recordID":' . $decodedparameters->record_id . '}';
675 675
       bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
676 676
       header('HTTP/1.0 202 Accepted');
677 677
     } catch (Exception $e) {
678
-        $error = 'Caught exception: '.$e->getMessage();
679
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
678
+        $error = 'Caught exception: ' . $e->getMessage();
679
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
680 680
     }
681 681
 }
682 682
 
@@ -697,13 +697,13 @@  discard block
 block discarded – undo
697 697
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
698 698
     if (!isset($importrecordings[$params['id']])) {
699 699
         $error = "Recording {$params['id']} could not be found. It can not be imported";
700
-        header('HTTP/1.0 404 Not found. '.$error);
700
+        header('HTTP/1.0 404 Not found. ' . $error);
701 701
         return;
702 702
     }
703 703
     $callbackresponse = array('status' => true);
704 704
     $importrecordings[$params['id']]['imported'] = true;
705 705
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
706
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
706
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
707 707
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
708 708
     // Moodle event logger: Create an event for recording imported.
709 709
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -729,8 +729,8 @@  discard block
 block discarded – undo
729 729
         $decodedparameters = JWT::decode($params['signed_parameters'],
730 730
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
731 731
     } catch (Exception $e) {
732
-        $error = 'Caught exception: '.$e->getMessage();
733
-        header('HTTP/1.0 400 Bad Request. '.$error);
732
+        $error = 'Caught exception: ' . $e->getMessage();
733
+        header('HTTP/1.0 400 Bad Request. ' . $error);
734 734
         return;
735 735
     }
736 736
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
     $requiredparams = bigbluebuttonbn_broker_required_parameters();
766 766
     $action = strtolower($params['action']);
767 767
     if (!array_key_exists($action, $requiredparams)) {
768
-        return 'Action '.$params['action'].' can not be performed.';
768
+        return 'Action ' . $params['action'] . ' can not be performed.';
769 769
     }
770 770
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
771 771
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -667,9 +667,11 @@
 block discarded – undo
667 667
     // Sends the messages.
668 668
     try {
669 669
       //That if was for trying to workaround the several emails sent for one record ready
670
-      if(bigbluebuttonbn_get_count_callback_event_log($decodedparameters->record_id) == 0)){
670
+      if(bigbluebuttonbn_get_count_callback_event_log($decodedparameters->record_id) == 0) {
671
+          ){
671 672
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
672 673
       }
674
+      }
673 675
       $overrides = array('meetingid' => $bigbluebuttonbn->meetingid);
674 676
       $meta = '{"recordID":'.$decodedparameters->record_id.'}';
675 677
       bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
Please login to merge, or discard this patch.