Completed
Pull Request — master (#40)
by Jesus
02:10
created
mod_form.php 2 patches
Spacing   +5 added lines, -5 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
         }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
             return;
326 326
         }
327 327
         $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options);
328
-        if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) {
328
+        if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) {
329 329
             $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn');
330 330
         }
331 331
         if (!empty($rule)) {
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 'alt' => $contents,
94 94
                 'title' => $contents,
95 95
                 'src' => $jsvars['pix_icon_delete']
96
-              );
96
+                );
97 97
             $jsvars['pix_icon_delete'] = html_writer::tag('img', '', $options);
98 98
         }
99 99
         $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-modform',
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
181 181
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6],
182 182
                 ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'),
183
-                 'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
184
-              );
183
+                    'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
184
+                );
185 185
         } else {
186 186
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
187 187
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
     private function bigbluebuttonbn_mform_add_block_room_recordings($mform, $cfg) {
214 214
         $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT,
215
-                  'description_key' => null];
215
+                    'description_key' => null];
216 216
         if ($cfg['recordings_html_editable']) {
217 217
             $field['type'] = 'checkbox';
218 218
             $field['description_key'] = 'mod_form_field_recordings_html';
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $field['description_key'], $cfg['recordings_html_default']);
222 222
 
223 223
         $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT,
224
-                  'description_key' => null];
224
+                    'description_key' => null];
225 225
         if ($cfg['recordings_deleted_editable']) {
226 226
             $field['type'] = 'checkbox';
227 227
             $field['description_key'] = 'mod_form_field_recordings_deleted';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             $field['description_key'], $cfg['recordings_deleted_default']);
231 231
 
232 232
         $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT,
233
-                  'description_key' => null];
233
+                    'description_key' => null];
234 234
         if ($cfg['recordings_imported_editable']) {
235 235
             $field['type'] = 'checkbox';
236 236
             $field['description_key'] = 'mod_form_field_recordings_imported';
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         $htmlselectiontype = html_writer::select($participantselection['type_options'],
279 279
             'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(),
280 280
             array('id' => 'bigbluebuttonbn_participant_selection_type',
281
-                  'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;'));
281
+                    'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;'));
282 282
         $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
283 283
             $participantselection['selected'], array(),
284 284
             array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled'));
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             'type' => 'button', 'class' => 'btn btn-secondary',
287 287
             'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'),
288 288
             'onclick' => 'M.mod_bigbluebuttonbn.modform.participant_add(); return 0;'
289
-          ));
289
+            ));
290 290
         $htmladdparticipant = html_writer::tag('div',
291 291
             $htmlselectiontype . '  ' . $htmlselectionoptions . '  ' . $htmlselectioninput, null);
292 292
         $mform->addElement('html', "\n\n");
Please login to merge, or discard this patch.
bbb_view.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 
183 183
 function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession, $bigbluebuttonbn) {
184 184
     $data = ['meetingID' => $bbbsession['meetingid'],
185
-              'name' => $bbbsession['meetingname'],
186
-              'attendeePW' => $bbbsession['viewerPW'],
187
-              'moderatorPW' => $bbbsession['modPW'],
188
-              'logoutURL' => $bbbsession['logoutURL'],
185
+                'name' => $bbbsession['meetingname'],
186
+                'attendeePW' => $bbbsession['viewerPW'],
187
+                'moderatorPW' => $bbbsession['modPW'],
188
+                'logoutURL' => $bbbsession['logoutURL'],
189 189
             ];
190 190
     $data['record'] = bigbluebutton_bbb_view_create_meeting_data_record($bbbsession['record']);
191 191
     $data['welcome'] = trim($bbbsession['welcome']);
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
             '%duration%',
199 199
             (string) $durationtime,
200 200
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
201
-          );
201
+            );
202 202
     }
203 203
     $voicebridge = intval($bbbsession['voicebridge']);
204 204
     if ($voicebridge > 0 && $voicebridge < 79999) {
@@ -228,22 +228,22 @@  discard block
 block discarded – undo
228 228
 function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) {
229 229
     global $USER;
230 230
     $metadata = ['bbb-origin' => $bbbsession['origin'],
231
-                 'bbb-origin-version' => $bbbsession['originVersion'],
232
-                 'bbb-origin-server-name' => $bbbsession['originServerName'],
233
-                 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
234
-                 'bbb-origin-tag' => $bbbsession['originTag'],
235
-                 'bbb-context' => $bbbsession['course']->fullname,
236
-                 'bbb-recording-name' => $bbbsession['meetingname'],
237
-                 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
238
-                 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
231
+                    'bbb-origin-version' => $bbbsession['originVersion'],
232
+                    'bbb-origin-server-name' => $bbbsession['originServerName'],
233
+                    'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
234
+                    'bbb-origin-tag' => $bbbsession['originTag'],
235
+                    'bbb-context' => $bbbsession['course']->fullname,
236
+                    'bbb-recording-name' => $bbbsession['meetingname'],
237
+                    'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
238
+                    'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
239 239
                 ];
240 240
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
241 241
         $metadata["bn-recording-status"] = json_encode(
242 242
             array(
243 243
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
244 244
                 'context' => $bbbsession['bigbluebuttonbnURL']
245
-              )
246
-          );
245
+                )
246
+            );
247 247
     }
248 248
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
249 249
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
Please login to merge, or discard this patch.
Switch Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -61,91 +61,91 @@
 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
-        if (is_null($bbbsession)) {
70
-            bigbluebutton_bbb_view_close_window_manually();
71
-            break;
72
-        }
73
-        // Moodle event logger: Create an event for meeting left.
74
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
75
-        // Update the cache.
76
-        $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
77
-        // Close the tab or window where BBB was opened.
78
-        bigbluebutton_bbb_view_close_window();
79
-        break;
80
-    case 'join':
81
-        if (is_null($bbbsession)) {
82
-            print_error('view_error_unable_join', 'bigbluebuttonbn');
83
-            break;
84
-        }
85
-        // See if the session is in progress.
86
-        if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
87
-            // Since the meeting is already running, we just join the session.
88
-            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
89
-            break;
90
-        }
91
-        // If user is not administrator nor moderator (user is steudent) and waiting is required.
92
-        if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
93
-            header('Location: '.$bbbsession['logoutURL']);
64
+        case 'logout':
65
+            if (isset($errors) && $errors != '') {
66
+                bigbluebutton_bbb_view_errors($errors, $id);
67
+                break;
68
+            }
69
+            if (is_null($bbbsession)) {
70
+                bigbluebutton_bbb_view_close_window_manually();
71
+                break;
72
+            }
73
+            // Moodle event logger: Create an event for meeting left.
74
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
75
+            // Update the cache.
76
+            $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
77
+            // Close the tab or window where BBB was opened.
78
+            bigbluebutton_bbb_view_close_window();
94 79
             break;
95
-        }
96
-        // As the meeting doesn't exist, try to create it.
97
-        $response = bigbluebuttonbn_get_create_meeting_array(
98
-            bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
99
-            bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
100
-            $bbbsession['presentation']['name'],
101
-            $bbbsession['presentation']['url']
102
-        );
103
-        if (empty($response)) {
104
-            // The server is unreachable.
105
-            if ($bbbsession['administrator']) {
106
-                print_error('view_error_unable_join', 'bigbluebuttonbn',
107
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
80
+        case 'join':
81
+            if (is_null($bbbsession)) {
82
+                print_error('view_error_unable_join', 'bigbluebuttonbn');
83
+                break;
84
+            }
85
+            // See if the session is in progress.
86
+            if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
87
+                // Since the meeting is already running, we just join the session.
88
+                bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
108 89
                 break;
109 90
             }
110
-            if ($bbbsession['moderator']) {
111
-                print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
91
+            // If user is not administrator nor moderator (user is steudent) and waiting is required.
92
+            if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
93
+                header('Location: '.$bbbsession['logoutURL']);
94
+                break;
95
+            }
96
+            // As the meeting doesn't exist, try to create it.
97
+            $response = bigbluebuttonbn_get_create_meeting_array(
98
+                bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
99
+                bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
100
+                $bbbsession['presentation']['name'],
101
+                $bbbsession['presentation']['url']
102
+            );
103
+            if (empty($response)) {
104
+                // The server is unreachable.
105
+                if ($bbbsession['administrator']) {
106
+                    print_error('view_error_unable_join', 'bigbluebuttonbn',
107
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
108
+                    break;
109
+                }
110
+                if ($bbbsession['moderator']) {
111
+                    print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
112
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
113
+                    break;
114
+                }
115
+                print_error('view_error_unable_join_student', 'bigbluebuttonbn',
112 116
                     $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
113 117
                 break;
114 118
             }
115
-            print_error('view_error_unable_join_student', 'bigbluebuttonbn',
116
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
117
-            break;
118
-        }
119
-        if ($response['returncode'] == 'FAILED') {
120
-            // The meeting was not created.
121
-            if (!$printerrorkey) {
122
-                print_error($response['message'], 'bigbluebuttonbn');
119
+            if ($response['returncode'] == 'FAILED') {
120
+                // The meeting was not created.
121
+                if (!$printerrorkey) {
122
+                    print_error($response['message'], 'bigbluebuttonbn');
123
+                    break;
124
+                }
125
+                $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
126
+                print_error($printerrorkey, 'bigbluebuttonbn');
127
+                break;
128
+            }
129
+            if ($response['hasBeenForciblyEnded'] == 'true') {
130
+                print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
123 131
                 break;
124 132
             }
125
-            $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
126
-            print_error($printerrorkey, 'bigbluebuttonbn');
133
+            // Moodle event logger: Create an event for meeting created.
134
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
135
+            // Internal logger: Insert a record with the meeting created.
136
+            bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
137
+            // Since the meeting is already running, we just join the session.
138
+            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
127 139
             break;
128
-        }
129
-        if ($response['hasBeenForciblyEnded'] == 'true') {
130
-            print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
140
+        case 'play':
141
+            $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
142
+            // Moodle event logger: Create an event for meeting left.
143
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
144
+            // Execute the redirect.
145
+            header('Location: '.urldecode($href));
131 146
             break;
132
-        }
133
-        // Moodle event logger: Create an event for meeting created.
134
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
135
-        // Internal logger: Insert a record with the meeting created.
136
-        bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
137
-        // Since the meeting is already running, we just join the session.
138
-        bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
139
-        break;
140
-    case 'play':
141
-        $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
142
-        // Moodle event logger: Create an event for meeting left.
143
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
144
-        // Execute the redirect.
145
-        header('Location: '.urldecode($href));
146
-        break;
147
-    default:
148
-        bigbluebutton_bbb_view_close_window();
147
+        default:
148
+            bigbluebutton_bbb_view_close_window();
149 149
 }
150 150
 
151 151
 function bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype) {
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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
 $action = required_param('action', PARAM_TEXT);
29 29
 $id = optional_param('id', 0, PARAM_INT);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         }
91 91
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
92 92
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
93
-            header('Location: '.$bbbsession['logoutURL']);
93
+            header('Location: ' . $bbbsession['logoutURL']);
94 94
             break;
95 95
         }
96 96
         // As the meeting doesn't exist, try to create it.
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
             // The server is unreachable.
105 105
             if ($bbbsession['administrator']) {
106 106
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
107
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
107
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
108 108
                 break;
109 109
             }
110 110
             if ($bbbsession['moderator']) {
111 111
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
112
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
112
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
113 113
                 break;
114 114
             }
115 115
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
116
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
116
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
117 117
             break;
118 118
         }
119 119
         if ($response['returncode'] == 'FAILED') {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         // Moodle event logger: Create an event for meeting left.
143 143
         bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
144 144
         // Execute the redirect.
145
-        header('Location: '.urldecode($href));
145
+        header('Location: ' . urldecode($href));
146 146
         break;
147 147
     default:
148 148
         bigbluebutton_bbb_view_close_window();
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         $data['welcome'] .= '<br><br>';
197 197
         $data['welcome'] .= str_replace(
198 198
             '%duration%',
199
-            (string) $durationtime,
199
+            (string)$durationtime,
200 200
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
201 201
           );
202 202
     }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
260 260
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
261 261
         // No more users allowed to join.
262
-        header('Location: '.$bbbsession['logoutURL']);
262
+        header('Location: ' . $bbbsession['logoutURL']);
263 263
         return;
264 264
     }
265 265
     // Build the URL.
@@ -277,18 +277,18 @@  discard block
 block discarded – undo
277 277
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
278 278
         ($bbbsession['administrator'] || $bbbsession['moderator']));
279 279
     // Execute the redirect.
280
-    header('Location: '.$joinurl);
280
+    header('Location: ' . $joinurl);
281 281
 }
282 282
 
283 283
 function bigbluebutton_bbb_view_errors($serrors, $id) {
284 284
     global $CFG, $OUTPUT;
285
-    $errors = (array) json_decode(urldecode($serrors));
285
+    $errors = (array)json_decode(urldecode($serrors));
286 286
     $msgerrors = '';
287 287
     foreach ($errors as $error) {
288
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
288
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
289 289
     }
290 290
     echo $OUTPUT->header();
291 291
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
292
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
292
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
293 293
     echo $OUTPUT->footer();
294 294
 }
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
24 24
  */
25 25
 
26
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
27
-require_once(dirname(__FILE__).'/locallib.php');
26
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
27
+require_once(dirname(__FILE__) . '/locallib.php');
28 28
 
29 29
 $id = required_param('id', PARAM_INT);
30 30
 $a = optional_param('a', 0, PARAM_INT);
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
     if ($moderator || $administrator) {
88 88
         bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $cm);
89 89
         echo get_string('index_ending', 'bigbluebuttonbn');
90
-        $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
90
+        $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
91 91
         if ($g != '0') {
92
-            $meetingid .= '['.$g.']';
92
+            $meetingid .= '[' . $g . ']';
93 93
         }
94 94
         bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingid));
95
-        redirect('index.php?id='.$id);
95
+        redirect('index.php?id=' . $id);
96 96
     }
97 97
 }
98 98
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         // Add a the data for the bigbluebuttonbn instance.
107 107
         $groupobj = null;
108 108
         if (groups_get_activity_groupmode($cm) > 0) {
109
-            $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants'));
109
+            $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants'));
110 110
         }
111 111
         $table->data[] = bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj);
112 112
         // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any.
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 
125 125
 // Functions.
126 126
 function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
127
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
127
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
128 128
     $paramgroup = '';
129 129
     $groupname = '';
130 130
     if ($groupobj) {
131
-        $meetingid .= '['.$groupobj->id.']';
132
-        $paramgroup = '&group='.$groupobj->id;
131
+        $meetingid .= '[' . $groupobj->id . ']';
132
+        $paramgroup = '&group=' . $groupobj->id;
133 133
         $groupname = $groupobj->name;
134 134
     }
135 135
     $meetinginfo = bigbluebuttonbn_get_meeting_info_array($meetingid);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         return;
145 145
     }
146 146
     // Output Users in the meeting.
147
-    $joinurl = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramgroup.'">'.format_string($bigbluebuttonbn->name).'</a>';
147
+    $joinurl = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramgroup . '">' . format_string($bigbluebuttonbn->name) . '</a>';
148 148
     $group = $groupname;
149 149
     $users = '';
150 150
     $viewerlist = '';
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $attendeecount = 0;
177 177
         foreach ($meetinginfo['attendees']->attendee as $attendee) {
178 178
             if ($attendee->role == $role) {
179
-                $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName;
179
+                $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName;
180 180
             }
181 181
         }
182 182
     }
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
196 196
     $actions = '';
197 197
     if ($moderator) {
198
-        $actions .= '<form name="form1" method="post" action="">'.'/n';
199
-        $actions .= '  <INPUT type="hidden" name="id" value="'.$course->id.'">'.'/n';
200
-        $actions .= '  <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'.'/n';
198
+        $actions .= '<form name="form1" method="post" action="">' . '/n';
199
+        $actions .= '  <INPUT type="hidden" name="id" value="' . $course->id . '">' . '/n';
200
+        $actions .= '  <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . '/n';
201 201
         if ($groupobj != null) {
202
-            $actions .= '  <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'.'/n';
202
+            $actions .= '  <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . '/n';
203 203
         }
204
-        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\''.
205
-            get_string('index_confirm_end', 'bigbluebuttonbn').'\')">'.'/n';
206
-        $actions .= '</form>'.'/n';
204
+        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' .
205
+            get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . '/n';
206
+        $actions .= '</form>' . '/n';
207 207
     }
208 208
     return $actions;
209 209
 }
Please login to merge, or discard this patch.
lib.php 3 patches
Doc Comments   +11 added lines, -1 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
  * $return->time = the time they did it
219 219
  * $return->info = a short text description.
220 220
  *
221
- * @return bool
221
+ * @return string
222 222
  */
223 223
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
224 224
     global $DB;
@@ -513,6 +513,10 @@  discard block
 block discarded – undo
513 513
     send_stored_file($file, 0, 0, $forcedownload, $options); // download MUST be forced - security!
514 514
 }
515 515
 
516
+/**
517
+ * @param stdClass $context
518
+ * @param string $filearea
519
+ */
516 520
 function bigbluebuttonbn_pluginfile_valid($context, $filearea) {
517 521
     if ($context->contextlevel != CONTEXT_MODULE) {
518 522
         return false;
@@ -529,6 +533,12 @@  discard block
 block discarded – undo
529 533
     return true;
530 534
 }
531 535
 
536
+/**
537
+ * @param stdClass $course
538
+ * @param stdClass $cm
539
+ * @param stdClass $context
540
+ * @param string $filearea
541
+ */
532 542
 function bigbluebuttonbn_pluginfile_file($course, $cm, $context, $filearea, $args) {
533 543
     $filename = bigbluebuttonbn_pluginfile_filename($course, $cm, $context, $args);
534 544
     if (!$filename) {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -301,12 +301,12 @@
 block discarded – undo
301 301
     $str  = '<div class="bigbluebuttonbn overview">'."\n";
302 302
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
303 303
     $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
304
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
304
+        '">'.$bigbluebuttonbn->name.'</a>'."\n";
305 305
     $str .= '  </div>'."\n";
306 306
     $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
307 307
         '</div>'."\n";
308 308
     $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
309
-      .'</div>'."\n";
309
+        .'</div>'."\n";
310 310
     $str .= '</div>'."\n";
311 311
     return $str;
312 312
 }
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -27,32 +27,32 @@  discard block
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once($CFG->dirroot.'/calendar/lib.php');
31
-require_once($CFG->dirroot.'/message/lib.php');
32
-require_once($CFG->dirroot.'/mod/lti/OAuth.php');
33
-require_once($CFG->libdir.'/accesslib.php');
34
-require_once($CFG->libdir.'/completionlib.php');
35
-require_once($CFG->libdir.'/datalib.php');
36
-require_once($CFG->libdir.'/coursecatlib.php');
37
-require_once($CFG->libdir.'/enrollib.php');
38
-require_once($CFG->libdir.'/filelib.php');
39
-require_once($CFG->libdir.'/formslib.php');
40
-
41
-if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) {
42
-    require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php');
30
+require_once($CFG->dirroot . '/calendar/lib.php');
31
+require_once($CFG->dirroot . '/message/lib.php');
32
+require_once($CFG->dirroot . '/mod/lti/OAuth.php');
33
+require_once($CFG->libdir . '/accesslib.php');
34
+require_once($CFG->libdir . '/completionlib.php');
35
+require_once($CFG->libdir . '/datalib.php');
36
+require_once($CFG->libdir . '/coursecatlib.php');
37
+require_once($CFG->libdir . '/enrollib.php');
38
+require_once($CFG->libdir . '/filelib.php');
39
+require_once($CFG->libdir . '/formslib.php');
40
+
41
+if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) {
42
+    require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php');
43 43
 }
44 44
 
45 45
 if (!isset($CFG->bigbluebuttonbn)) {
46 46
     $CFG->bigbluebuttonbn = array();
47 47
 }
48 48
 
49
-if (file_exists(dirname(__FILE__).'/config.php')) {
50
-    require_once(dirname(__FILE__).'/config.php');
49
+if (file_exists(dirname(__FILE__) . '/config.php')) {
50
+    require_once(dirname(__FILE__) . '/config.php');
51 51
     // Old BigBlueButtonBN cfg schema. For backward compatibility.
52 52
     global $BIGBLUEBUTTONBN_CFG;
53 53
 
54 54
     if (isset($BIGBLUEBUTTONBN_CFG)) {
55
-        foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) {
55
+        foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) {
56 56
             $cfgkey = str_replace("bigbluebuttonbn_", "", $key);
57 57
             $CFG->bigbluebuttonbn[$cfgkey] = $value;
58 58
         }
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     $features = array(
86
-        (string) FEATURE_IDNUMBER => true,
87
-        (string) FEATURE_GROUPS => true,
88
-        (string) FEATURE_GROUPINGS => true,
89
-        (string) FEATURE_GROUPMEMBERSONLY => true,
90
-        (string) FEATURE_MOD_INTRO => true,
91
-        (string) FEATURE_BACKUP_MOODLE2 => true,
92
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
93
-        (string) FEATURE_GRADE_HAS_GRADE => false,
94
-        (string) FEATURE_GRADE_OUTCOMES => false,
95
-        (string) FEATURE_SHOW_DESCRIPTION => true,
86
+        (string)FEATURE_IDNUMBER => true,
87
+        (string)FEATURE_GROUPS => true,
88
+        (string)FEATURE_GROUPINGS => true,
89
+        (string)FEATURE_GROUPMEMBERSONLY => true,
90
+        (string)FEATURE_MOD_INTRO => true,
91
+        (string)FEATURE_BACKUP_MOODLE2 => true,
92
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
93
+        (string)FEATURE_GRADE_HAS_GRADE => false,
94
+        (string)FEATURE_GRADE_OUTCOMES => false,
95
+        (string)FEATURE_SHOW_DESCRIPTION => true,
96 96
     );
97 97
 
98
-    if (isset($features[(string) $feature])) {
98
+    if (isset($features[(string)$feature])) {
99 99
         return $features[$feature];
100 100
     }
101 101
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     $log->timecreated = time();
189 189
     $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE;
190 190
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
191
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
191
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
192 192
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
193 193
     $log->meta = "{\"has_recordings\":false}";
194 194
     if (!empty($logs)) {
@@ -211,10 +211,10 @@  discard block
 block discarded – undo
211 211
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
212 212
     global $DB;
213 213
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
214
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*');
214
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*');
215 215
     if ($completed > 0) {
216
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
217
-            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
216
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
217
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
218 218
             get_string('view_message_times', 'bigbluebuttonbn');
219 219
     }
220 220
     return '';
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) {
230 230
     global $DB;
231 231
     $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id,
232
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ),
232
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',),
233 233
         '*', IGNORE_MULTIPLE);
234 234
     return $completed > 0;
235 235
 }
@@ -298,16 +298,16 @@  discard block
 block discarded – undo
298 298
     if ($bigbluebuttonbn->visible) {
299 299
         $classes = 'class="dimmed" ';
300 300
     }
301
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
302
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
303
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
304
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
305
-    $str .= '  </div>'."\n";
306
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
307
-        '</div>'."\n";
308
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
309
-      .'</div>'."\n";
310
-    $str .= '</div>'."\n";
301
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
302
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
303
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
304
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
305
+    $str .= '  </div>' . "\n";
306
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
307
+        '</div>' . "\n";
308
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
309
+      .'</div>' . "\n";
310
+    $str .= '</div>' . "\n";
311 311
     return $str;
312 312
 }
313 313
 
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
     if (count($files) == 1) {
463 463
         // Get the first (and only) file.
464 464
         $file = reset($files);
465
-        $filesrc = '/'.$file->get_filename();
465
+        $filesrc = '/' . $file->get_filename();
466 466
     }
467 467
     return $filesrc;
468 468
 }
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
     if (!$filename) {
513 513
         return false;
514 514
     }
515
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
515
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
516 516
     $fs = get_file_storage();
517 517
     $file = $fs->get_file_by_hash(sha1($fullpath));
518 518
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
config-dist.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
  * are 1=checked, 0=unchecked.
68 68
  **/
69 69
 
70
- /* When the value is set to 0 (unchecked) the all the features for recordings
70
+    /* When the value is set to 0 (unchecked) the all the features for recordings
71 71
   *  are ignored. Recording features are enabled by default.
72 72
   *  $CFG->bigbluebuttonbn['recordings_enabled'] = 1;
73 73
   */
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  * recordings from a different activity even from a different course.
98 98
  **/
99 99
 
100
- /*
100
+    /*
101 101
  * When the value is set to 1 (checked) the bigbluebuttonbn rooms or
102 102
  * activities will have the 'import recordings' capability enabled.
103 103
  * $CFG->bigbluebuttonbn['importrecordings_enabled'] = 0;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
  * 'Join session' button enabled
119 119
  **/
120 120
 
121
- /*
121
+    /*
122 122
  * When the value is set to 1 (checked) the bigbluebuttonbn rooms or
123 123
  * activities will have the 'wait for moderator' capability enabled by
124 124
  * default.
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
  * 5. CONFIGURATION FOR "STATIC VOICE BRIDGE" FEATURE
153 153
  *
154 154
  **/
155
- /*
155
+    /*
156 156
  * A conference voice bridge number can be permanently assigned to a room
157 157
  * or activity.
158 158
  * $CFG->bigbluebuttonbn['voicebridge_editable'] = 0;
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
  * 6. CONFIGURATION FOR "PRE-UPLOAD PRESENTATION" FEATURE
163 163
  *
164 164
  **/
165
- /*
165
+    /*
166 166
  * Since version 0.8, BigBluebutton has an implementation for allowing
167 167
  * preuploading presentation. When this feature is enabled, users creating or
168 168
  * editing a room or activity can upload a PDF or Office document to the
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
  * applied to each room or activity, or globally.
180 180
  **/
181 181
 
182
- /*
182
+    /*
183 183
  * The number of users allowed in a session by default when a new room or
184 184
  * conference is added. If the number is set to 0, no limit is established.
185 185
  * $CFG->bigbluebuttonbn['userlimit_default'] = 0;
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
  * By default only the owner is assigned.
201 201
  **/
202 202
 
203
- /*
203
+    /*
204 204
  * The values for this parameter can be '0' (which identifies the owner) and/or any of the role IDs defined in
205 205
  * Moodle (including the custom parameters). The value used will be the key for the role.
206 206
  * [owner=0|manager=1|coursecreator=2|editingteacher=3|teacher=4|student=5|guest=6|user=7|frontpage=8|ANY_CUSTOM_ROLE=xx]
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
  * 9. CONFIGURATION FOR "NOTIFICATION SENDING" FEATURE
212 212
  *
213 213
  **/
214
- /*
214
+    /*
215 215
  * When the value is set to 1 (checked) the 'notification sending'
216 216
  * capability can be used by the user creating or editing the room or
217 217
  * activity.
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  * 10. CONFIGURATION FOR "RECORDING READY" FEATURE
226 226
  *
227 227
  **/
228
- /*
228
+    /*
229 229
  * When the value is set to 1 (checked) the 'notify users when recording ready'
230 230
  * capability is enabled, meaning that a message will be sent to all enrolled
231 231
  * users in a course when a recording is ready
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
  * 12. GENERAL CONFIGURATION FOR RECORDINGS UI
250 250
  *
251 251
  **/
252
- /*
252
+    /*
253 253
  * When the value is set to 1 (checked) the bigbluebuttonbn resources
254 254
  * will show the recodings in an html table by default.
255 255
  * $CFG->bigbluebuttonbn['recordings_html_default'] = 0;
@@ -273,22 +273,22 @@  discard block
 block discarded – undo
273 273
  * $CFG->bigbluebuttonbn['recordings_deleted_editable'] = 0;
274 274
  */
275 275
 
276
- /*
276
+    /*
277 277
   * When the value is set to 1 (checked) the bigbluebuttonbn resources for recordings
278 278
   * will show only the imported links as part of the list.
279 279
   * $CFG->bigbluebuttonbn['recordings_imported_default'] = 0;
280 280
   */
281 281
 
282
- /*
282
+    /*
283 283
   * When the value is set to 1 (checked) the 'show only imported links'
284 284
   * capability can be enabled/disabled by the user creating or editing the resource for recordings.
285 285
   * $CFG->bigbluebuttonbn['recordings_imported_editable'] = 1;
286 286
   */
287 287
 
288
-  /*
288
+    /*
289 289
    *  CONFIGURATION FOR FEATURES OFFERED BY BN SERVERS
290 290
   ** ------------------------------------------------------------------ **/
291
-  /*
291
+    /*
292 292
    * When general_warning_message value is different than "", the string is shown
293 293
    * as a warning message to privileged users (administrators and Teachers or users allowed to edit).
294 294
    * $CFG->bigbluebuttonbn['general_warning_message'] = "This will may have recordings enabled when upgraded to premium.";
Please login to merge, or discard this patch.
bbb_broker.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -342,26 +342,26 @@  discard block
 block discarded – undo
342 342
             return array(
343 343
                 'status' => false,
344 344
                 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn')
345
-              );
345
+                );
346 346
         }
347 347
         if ($realrecordings[$params['id']]['published'] !== 'true') {
348 348
             return array(
349 349
                 'status' => false,
350 350
                 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn')
351
-              );
351
+                );
352 352
         }
353 353
         return array(
354 354
             'status' => bigbluebuttonbn_publish_recording_imported(
355 355
                 $recordings[$params['id']]['imported'], true
356 356
             )
357
-          );
357
+            );
358 358
     }
359 359
     // As the recordingid was not identified as imported recording link, execute actual publish.
360 360
     return array(
361 361
         'status' => bigbluebuttonbn_publish_recordings(
362 362
             $params['id'], 'true'
363 363
         )
364
-      );
364
+        );
365 365
 }
366 366
 
367 367
 function bigbluebuttonbn_broker_recording_action_unprotect($params, $recordings) {
@@ -374,26 +374,26 @@  discard block
 block discarded – undo
374 374
             return array(
375 375
                 'status' => false,
376 376
                 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn')
377
-              );
377
+                );
378 378
         }
379 379
         if ($realrecordings[$params['id']]['protected'] === 'true') {
380 380
             return array(
381 381
                 'status' => false,
382 382
                 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn')
383
-              );
383
+                );
384 384
         }
385 385
         return array(
386 386
             'status' => bigbluebuttonbn_protect_recording_imported(
387 387
                 $recordings[$params['id']]['imported'], false
388 388
             )
389
-          );
389
+            );
390 390
     }
391 391
     // As the recordingid was not identified as imported recording link, execute actual uprotect.
392 392
     return array(
393 393
         'status' => bigbluebuttonbn_update_recordings(
394 394
             $params['id'], array('protect' => 'false')
395 395
         )
396
-      );
396
+        );
397 397
 }
398 398
 
399 399
 function bigbluebuttonbn_broker_recording_action_unpublish($params, $recordings) {
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
             'status' => bigbluebuttonbn_publish_recording_imported(
405 405
                 $recordings[$params['id']]['imported'], false
406 406
             )
407
-          );
407
+            );
408 408
     }
409 409
     // As the recordingid was not identified as imported recording link, execute unpublish on a real recording.
410 410
     // First: Unpublish imported links associated to the recording.
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         'status' => bigbluebuttonbn_publish_recordings(
423 423
             $params['id'], 'false'
424 424
         )
425
-      );
425
+        );
426 426
 }
427 427
 
428 428
 function bigbluebuttonbn_broker_recording_action_protect($params, $recordings) {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
             'status' => bigbluebuttonbn_protect_recording_imported(
434 434
                 $recordings[$params['id']]['imported'], true
435 435
             )
436
-          );
436
+            );
437 437
     }
438 438
     // As the recordingid was not identified as imported recording link, execute protect on a real recording.
439 439
     // First: Protect imported links associated to the recording.
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
         'status' => bigbluebuttonbn_update_recordings(
452 452
             $params['id'], array('protect' => 'true')
453 453
         )
454
-      );
454
+        );
455 455
 }
456 456
 
457 457
 function bigbluebuttonbn_broker_recording_action_delete($params, $recordings) {
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
             'status' => bigbluebuttonbn_delete_recording_imported(
463 463
                 $recordings[$params['id']]['imported']
464 464
             )
465
-          );
465
+            );
466 466
     }
467 467
     // As the recordingid was not identified as imported recording link, execute delete on a real recording.
468 468
     // First: Delete imported links associated to the recording.
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
         'status' => bigbluebuttonbn_delete_recordings(
479 479
             $params['id']
480 480
         )
481
-      );
481
+        );
482 482
 }
483 483
 
484 484
 function bigbluebuttonbn_broker_recording_action_edit($params, $recordings) {
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
             'status' => bigbluebuttonbn_update_recording_imported(
489 489
                 $recordings[$params['id']]['imported'], json_decode($params['meta'], true)
490 490
             )
491
-          );
491
+            );
492 492
     }
493 493
 
494 494
     // As the recordingid was not identified as imported recording link, execute update on a real recording.
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
         'status' => bigbluebuttonbn_update_recordings(
499 499
             $params['id'], json_decode($params['meta'])
500 500
         )
501
-      );
501
+        );
502 502
 }
503 503
 
504 504
 function bigbluebuttonbn_broker_recording_ready($params, $bigbluebuttonbn) {
@@ -625,10 +625,10 @@  discard block
 block discarded – undo
625 625
     $params['recording_import'] = ['id' => 'The recordingID must be specified.'];
626 626
     $params['recording_ready'] = [
627 627
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
628
-          ];
628
+            ];
629 629
     $params['live_session_events'] = [
630 630
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
631
-          ];
631
+            ];
632 632
     return $params;
633 633
 }
634 634
 
Please login to merge, or discard this 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
 
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
         bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm);
130 130
         return;
131 131
     }
132
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
132
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
133 133
     return;
134 134
 
135 135
 } catch (Exception $e) {
136
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
136
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
137 137
     return;
138 138
 }
139 139
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
261 261
     $callbackresponse['status'] = true;
262 262
     $callbackresponse['found'] = true;
263
-    $callbackresponse['published'] = (string) $recording['published'];
263
+    $callbackresponse['published'] = (string)$recording['published'];
264 264
     if (!isset($params['meta']) || empty($params['meta'])) {
265 265
         return $callbackresponse;
266 266
     }
@@ -507,8 +507,8 @@  discard block
 block discarded – undo
507 507
         $decodedparameters = JWT::decode($params['signed_parameters'],
508 508
             (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
509 509
     } catch (Exception $e) {
510
-        $error = 'Caught exception: '.$e->getMessage();
511
-        header('HTTP/1.0 400 Bad Request. '.$error);
510
+        $error = 'Caught exception: ' . $e->getMessage();
511
+        header('HTTP/1.0 400 Bad Request. ' . $error);
512 512
         return;
513 513
     }
514 514
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -524,8 +524,8 @@  discard block
 block discarded – undo
524 524
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
525 525
         header('HTTP/1.0 202 Accepted');
526 526
     } catch (Exception $e) {
527
-        $error = 'Caught exception: '.$e->getMessage();
528
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
527
+        $error = 'Caught exception: ' . $e->getMessage();
528
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
529 529
     }
530 530
 }
531 531
 
@@ -538,13 +538,13 @@  discard block
 block discarded – undo
538 538
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
539 539
     if (!isset($importrecordings[$params['id']])) {
540 540
         $error = "Recording {$params['id']} could not be found. It can not be imported";
541
-        header('HTTP/1.0 404 Not found. '.$error);
541
+        header('HTTP/1.0 404 Not found. ' . $error);
542 542
         return;
543 543
     }
544 544
     $callbackresponse = array('status' => true);
545 545
     $importrecordings[$params['id']]['imported'] = true;
546 546
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
547
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
547
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
548 548
     bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
549 549
     // Moodle event logger: Create an event for recording imported.
550 550
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -561,8 +561,8 @@  discard block
 block discarded – undo
561 561
         $decodedparameters = JWT::decode($params['signed_parameters'],
562 562
             (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
563 563
     } catch (Exception $e) {
564
-        $error = 'Caught exception: '.$e->getMessage();
565
-        header('HTTP/1.0 400 Bad Request. '.$error);
564
+        $error = 'Caught exception: ' . $e->getMessage();
565
+        header('HTTP/1.0 400 Bad Request. ' . $error);
566 566
         return;
567 567
     }
568 568
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
     }
596 596
     $action = strtolower($params['action']);
597 597
     if (!array_key_exists($action, $requiredparams)) {
598
-        return 'Action '.$params['action'].' can not be performed.';
598
+        return 'Action ' . $params['action'] . ' can not be performed.';
599 599
     }
600 600
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
601 601
 }
Please login to merge, or discard this patch.
locallib.php 2 patches
Indentation   +55 added lines, -55 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;
@@ -140,23 +140,23 @@  discard block
 block discarded – undo
140 140
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
141 141
     $xml = bigbluebuttonbn_wrap_xml_load_file(
142 142
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
143
-      );
143
+        );
144 144
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
145 145
         // Meeting info was returned.
146 146
         return array('returncode' => $xml->returncode,
147
-                     'meetingID' => $xml->meetingID,
148
-                     'moderatorPW' => $xml->moderatorPW,
149
-                     'attendeePW' => $xml->attendeePW,
150
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
151
-                     'running' => $xml->running,
152
-                     'recording' => $xml->recording,
153
-                     'startTime' => $xml->startTime,
154
-                     'endTime' => $xml->endTime,
155
-                     'participantCount' => $xml->participantCount,
156
-                     'moderatorCount' => $xml->moderatorCount,
157
-                     'attendees' => $xml->attendees,
158
-                     'metadata' => $xml->metadata,
159
-                   );
147
+                        'meetingID' => $xml->meetingID,
148
+                        'moderatorPW' => $xml->moderatorPW,
149
+                        'attendeePW' => $xml->attendeePW,
150
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
151
+                        'running' => $xml->running,
152
+                        'recording' => $xml->recording,
153
+                        'startTime' => $xml->startTime,
154
+                        'endTime' => $xml->endTime,
155
+                        'participantCount' => $xml->participantCount,
156
+                        'moderatorCount' => $xml->moderatorCount,
157
+                        'attendees' => $xml->attendees,
158
+                        'metadata' => $xml->metadata,
159
+                    );
160 160
     }
161 161
     if ($xml) {
162 162
         // Either failure or success without meeting info.
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 function bigbluebuttonbn_get_default_config_xml() {
279 279
     $xml = bigbluebuttonbn_wrap_xml_load_file(
280 280
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
281
-      );
281
+        );
282 282
     return $xml;
283 283
 }
284 284
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
     foreach ($ids as $id) {
348 348
         $xml = bigbluebuttonbn_wrap_xml_load_file(
349 349
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
350
-          );
350
+            );
351 351
         if ($xml && $xml->returncode != 'SUCCESS') {
352 352
             return false;
353 353
         }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
     foreach ($ids as $id) {
365 365
         $xml = bigbluebuttonbn_wrap_xml_load_file(
366 366
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
367
-          );
367
+            );
368 368
         if ($xml && $xml->returncode != 'SUCCESS') {
369 369
             return false;
370 370
         }
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
     foreach ($ids as $id) {
382 382
         $xml = bigbluebuttonbn_wrap_xml_load_file(
383 383
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
384
-          );
384
+            );
385 385
         if ($xml && $xml->returncode != 'SUCCESS') {
386 386
             return false;
387 387
         }
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
397 397
     $xml = bigbluebuttonbn_wrap_xml_load_file(
398 398
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
399
-      );
399
+        );
400 400
     if ($xml) {
401 401
         // If the xml packet returned failure it displays the message to the user.
402 402
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 function bigbluebuttonbn_is_meeting_running($meetingid) {
412 412
     $xml = bigbluebuttonbn_wrap_xml_load_file(
413 413
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('isMeetingRunning', ['meetingID' => $meetingid])
414
-      );
414
+        );
415 415
     if ($xml && $xml->returncode == 'SUCCESS') {
416 416
         return ($xml->running == 'true');
417 417
     }
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 function bigbluebuttonbn_get_server_version() {
422 422
     $xml = bigbluebuttonbn_wrap_xml_load_file(
423 423
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
424
-      );
424
+        );
425 425
     if ($xml && $xml->returncode == 'SUCCESS') {
426 426
         return $xml->version;
427 427
     }
@@ -476,10 +476,10 @@  discard block
 block discarded – undo
476 476
 
477 477
         $options = array();
478 478
         $options['CURLOPT_HTTPHEADER'] = array(
479
-                 'Content-Type: '.$contenttype,
480
-                 'Content-Length: '.strlen($data),
481
-                 'Content-Language: en-US',
482
-               );
479
+                    'Content-Type: '.$contenttype,
480
+                    'Content-Length: '.strlen($data),
481
+                    'Content-Language: en-US',
482
+                );
483 483
 
484 484
         return $c->post($url, $data, $options);
485 485
     }
@@ -558,13 +558,13 @@  discard block
 block discarded – undo
558 558
 
559 559
 function bigbluebuttonbn_role_unknown() {
560 560
     return array(
561
-              "id" => "0",
562
-              "name" => "",
563
-              "shortname" => "unknown",
564
-              "description" => "",
565
-              "sortorder" => "0",
566
-              "archetype" => "guest",
567
-              "localname" => "Unknown"
561
+                "id" => "0",
562
+                "name" => "",
563
+                "shortname" => "unknown",
564
+                "description" => "",
565
+                "sortorder" => "0",
566
+                "archetype" => "guest",
567
+                "localname" => "Unknown"
568 568
             );
569 569
 }
570 570
 
@@ -573,16 +573,16 @@  discard block
 block discarded – undo
573 573
         'all' => array(
574 574
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
575 575
             'children' => []
576
-          )
577
-      );
576
+            )
577
+        );
578 578
     $data['role'] = array(
579 579
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
580 580
         'children' => bigbluebuttonbn_get_roles_select($context)
581
-      );
581
+        );
582 582
     $data['user'] = array(
583 583
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
584 584
         'children' => bigbluebuttonbn_get_users_select($context)
585
-      );
585
+        );
586 586
     return $data;
587 587
 }
588 588
 
@@ -612,9 +612,9 @@  discard block
 block discarded – undo
612 612
             continue;
613 613
         }
614 614
         $participantlistarray[] = array(
615
-              'selectiontype' => 'role',
616
-              'selectionid' => $moderatordefault,
617
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
615
+                'selectiontype' => 'role',
616
+                'selectionid' => $moderatordefault,
617
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
618 618
     }
619 619
     return $participantlistarray;
620 620
 }
@@ -645,11 +645,11 @@  discard block
 block discarded – undo
645 645
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
646 646
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
647 647
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
648
-          ],
648
+            ],
649 649
         'type_selected' => 'all',
650 650
         'options' => ['all' => '---------------'],
651 651
         'selected' => 'all',
652
-      ];
652
+        ];
653 653
 }
654 654
 
655 655
 function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) {
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
         $eventproperties['other'] = $options['other'];
840 840
     }
841 841
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
842
-      array($eventproperties));
842
+        array($eventproperties));
843 843
     $event->trigger();
844 844
 }
845 845
 
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
     // Ping again and refresh the cache.
885 885
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
886 886
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
887
-      );
887
+        );
888 888
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
889 889
     return $meetinginfo;
890 890
 }
@@ -1120,8 +1120,8 @@  discard block
 block discarded – undo
1120 1120
     }
1121 1121
     $id = 'playbacks-'.$recording['recordID'];
1122 1122
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1123
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1124
-          'title' => $title, $visibility => $visibility));
1123
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1124
+            'title' => $title, $visibility => $visibility));
1125 1125
     foreach ($recording['playbacks'] as $playback) {
1126 1126
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid,
1127 1127
             $playback).'&#32;';
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
     $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1136 1136
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);';
1137 1137
     $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid.
1138
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1138
+        '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1139 1139
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1140 1140
         $href .= '&href='.urlencode(trim($playback['url']));
1141 1141
     }
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
         'data-target' => $playback['type'],
1148 1148
         'data-href' => $href,
1149 1149
         'class' => 'btn btn-sm btn-default'
1150
-      );
1150
+        );
1151 1151
     return $OUTPUT->action_link('#', $title, null, $linkattributes);
1152 1152
 }
1153 1153
 
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
             'onclick' => $onclick,
1232 1232
             'data-action' => $data['action'],
1233 1233
             'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID'])
1234
-          );
1234
+            );
1235 1235
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
1236 1236
     }
1237 1237
     // With text for $manageaction.
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
         $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1337 1337
         $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1338 1338
         $rowdata->duration_formatted
1339
-      );
1339
+        );
1340 1340
     if ($bbbsession['managerecordings']) {
1341 1341
         $row->cells[] = $rowdata->actionbar;
1342 1342
     }
@@ -1578,8 +1578,8 @@  discard block
 block discarded – undo
1578 1578
     $activitytime = '';
1579 1579
     if ($time) {
1580 1580
         $activitytime = calendar_day_representation($time).' '.
1581
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1582
-          calendar_time_representation($time);
1581
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1582
+            calendar_time_representation($time);
1583 1583
     }
1584 1584
     return $activitytime;
1585 1585
 }
@@ -1757,7 +1757,7 @@  discard block
 block discarded – undo
1757 1757
         $renderer->render_group_element('participant_moderator_default',
1758 1758
             $renderer->render_group_element_configmultiselect('participant_moderator_default',
1759 1759
                 array_keys($owner), array_merge($owner, $roles))
1760
-          );
1760
+            );
1761 1761
     }
1762 1762
 }
1763 1763
 
Please login to merge, or discard this patch.
Spacing   +97 added lines, -97 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) {
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         // Override imported flag with actual ID.
269 269
         $recording['imported'] = $recordimported->id;
270 270
         if (isset($recordimported->protected)) {
271
-            $recording['protected'] = (string) $recordimported->protected;
271
+            $recording['protected'] = (string)$recordimported->protected;
272 272
         }
273 273
         $recordsimportedarray[$recording['recordID']] = $recording;
274 274
     }
@@ -284,36 +284,36 @@  discard block
 block discarded – undo
284 284
 
285 285
 function bigbluebuttonbn_get_default_config_xml_array() {
286 286
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
287
-    return (array) $defaultconfigxml;
287
+    return (array)$defaultconfigxml;
288 288
 }
289 289
 
290 290
 function bigbluebuttonbn_get_recording_array_value($recording) {
291 291
     // Add formats.
292 292
     $playbackarray = array();
293 293
     foreach ($recording->playback->format as $format) {
294
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
295
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
294
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
295
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
296 296
         // Add preview per format when existing.
297 297
         if ($format->preview) {
298 298
             $imagesarray = array();
299 299
             foreach ($format->preview->images->image as $image) {
300
-                $imagearray = array('url' => trim((string) $image));
300
+                $imagearray = array('url' => trim((string)$image));
301 301
                 foreach ($image->attributes() as $attkey => $attvalue) {
302
-                    $imagearray[$attkey] = (string) $attvalue;
302
+                    $imagearray[$attkey] = (string)$attvalue;
303 303
                 }
304 304
                 array_push($imagesarray, $imagearray);
305 305
             }
306
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
306
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
307 307
         }
308 308
     }
309 309
     // Add the metadata to the recordings array.
310 310
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
311
-    $recordingarray = array('recordID' => (string) $recording->recordID,
312
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
313
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
314
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
311
+    $recordingarray = array('recordID' => (string)$recording->recordID,
312
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
313
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
314
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
315 315
     if (isset($recording->protected)) {
316
-        $recordingarray['protected'] = (string) $recording->protected;
316
+        $recordingarray['protected'] = (string)$recording->protected;
317 317
     }
318 318
     return $recordingarray + $metadataarray;
319 319
 }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         if (is_object($value)) {
325 325
             $value = '';
326 326
         }
327
-        $metadataarray['meta_'.$key] = $value;
327
+        $metadataarray['meta_' . $key] = $value;
328 328
     }
329 329
     return $metadataarray;
330 330
 }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
     $ids = explode(',', $recordids);
381 381
     foreach ($ids as $id) {
382 382
         $xml = bigbluebuttonbn_wrap_xml_load_file(
383
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
383
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
384 384
           );
385 385
         if ($xml && $xml->returncode != 'SUCCESS') {
386 386
             return false;
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
             return $xml;
448 448
         } catch (Exception $e) {
449 449
             libxml_use_internal_errors($previous);
450
-            $error = 'Caught exception: '.$e->getMessage();
450
+            $error = 'Caught exception: ' . $e->getMessage();
451 451
             debugging($error, DEBUG_DEVELOPER);
452 452
             return null;
453 453
         }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
459 459
         return $response;
460 460
     } catch (Exception $e) {
461
-        $error = 'Caught exception: '.$e->getMessage();
461
+        $error = 'Caught exception: ' . $e->getMessage();
462 462
         debugging($error, DEBUG_DEVELOPER);
463 463
         libxml_use_internal_errors($previous);
464 464
         return null;
@@ -476,8 +476,8 @@  discard block
 block discarded – undo
476 476
 
477 477
         $options = array();
478 478
         $options['CURLOPT_HTTPHEADER'] = array(
479
-                 'Content-Type: '.$contenttype,
480
-                 'Content-Length: '.strlen($data),
479
+                 'Content-Type: ' . $contenttype,
480
+                 'Content-Length: ' . strlen($data),
481 481
                  'Content-Language: en-US',
482 482
                );
483 483
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 
489 489
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
490 490
     // End the session associated with this instance (if it's running).
491
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
491
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
492 492
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
493 493
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
494 494
     }
@@ -500,9 +500,9 @@  discard block
 block discarded – undo
500 500
     if ($userroles) {
501 501
         $where = '';
502 502
         foreach ($userroles as $value) {
503
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$value->roleid;
503
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $value->roleid;
504 504
         }
505
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
505
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
506 506
     }
507 507
     return $userroles;
508 508
 }
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 }
514 514
 
515 515
 function bigbluebuttonbn_get_users(context $context = null) {
516
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
516
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
517 517
     foreach ($users as $key => $value) {
518 518
         $users[$key] = fullname($value);
519 519
     }
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 }
522 522
 
523 523
 function bigbluebuttonbn_get_users_select(context $context = null) {
524
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
524
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
525 525
     foreach ($users as $key => $value) {
526 526
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
527 527
     }
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 }
530 530
 
531 531
 function bigbluebuttonbn_get_roles(context $context = null) {
532
-    $roles = (array) role_get_names($context);
532
+    $roles = (array)role_get_names($context);
533 533
     foreach ($roles as $key => $value) {
534 534
         $roles[$key] = $value->localname;
535 535
     }
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 }
538 538
 
539 539
 function bigbluebuttonbn_get_roles_select(context $context = null) {
540
-    $roles = (array) role_get_names($context);
540
+    $roles = (array)role_get_names($context);
541 541
     foreach ($roles as $key => $value) {
542 542
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
543 543
     }
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 }
546 546
 
547 547
 function bigbluebuttonbn_get_role($id) {
548
-    $roles = (array) role_get_names();
548
+    $roles = (array)role_get_names();
549 549
     if (is_numeric($id)) {
550 550
         return (object)$roles[$id];
551 551
     }
@@ -625,11 +625,11 @@  discard block
 block discarded – undo
625 625
         return array();
626 626
     }
627 627
     foreach ($rules as $key => $rule) {
628
-        if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) {
628
+        if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) {
629 629
             continue;
630 630
         }
631 631
         $role = bigbluebuttonbn_get_role($rule['selectionid']);
632
-        if ( $role == null ) {
632
+        if ($role == null) {
633 633
             unset($rules[$key]);
634 634
             continue;
635 635
         }
@@ -668,10 +668,10 @@  discard block
 block discarded – undo
668 668
     if (empty($userroles)) {
669 669
         $userroles = get_user_roles($context, $userid, true);
670 670
     }
671
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
671
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
672 672
 }
673 673
 
674
-function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) {
674
+function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) {
675 675
     // Iterate participant rules.
676 676
     foreach ($participantlist as $participant) {
677 677
         if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) {
@@ -716,9 +716,9 @@  discard block
 block discarded – undo
716 716
     $isunique = true;
717 717
     if ($voicebridge != 0) {
718 718
         $table = 'bigbluebuttonbn';
719
-        $select = 'voicebridge = '.$voicebridge;
719
+        $select = 'voicebridge = ' . $voicebridge;
720 720
         if ($id) {
721
-            $select .= ' AND id <> '.$id;
721
+            $select .= ' AND id <> ' . $id;
722 722
         }
723 723
         if ($DB->get_records_select($table, $select)) {
724 724
             $isunique = false;
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 function bigbluebuttonbn_generate_nonce() {
773 773
     $mt = microtime();
774 774
     $rand = mt_rand();
775
-    return md5($mt.$rand);
775
+    return md5($mt . $rand);
776 776
 }
777 777
 
778 778
 function bigbluebuttonbn_random_password($length = 8) {
@@ -783,41 +783,41 @@  discard block
 block discarded – undo
783 783
 
784 784
 function bigbluebuttonbn_events() {
785 785
     return array(
786
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
787
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
788
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
789
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
790
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
791
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
792
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
793
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
794
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
795
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
796
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
797
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
798
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
799
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
800
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
786
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
787
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
788
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
789
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
790
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
791
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
792
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
793
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
794
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
795
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
796
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
797
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
798
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
799
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
800
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
801 801
     );
802 802
 }
803 803
 
804 804
 function bigbluebuttonbn_events_action() {
805 805
     return array(
806
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
807
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
808
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
809
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
810
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
811
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
812
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
813
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
814
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
815
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
816
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
817
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
818
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
819
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
820
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
806
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
807
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
808
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
809
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
810
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
811
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
812
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
813
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
814
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
815
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
816
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
817
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
818
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
819
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
820
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
821 821
     );
822 822
 }
823 823
 
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
     if (array_key_exists('other', $options)) {
839 839
         $eventproperties['other'] = $options['other'];
840 840
     }
841
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
841
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
842 842
       array($eventproperties));
843 843
     $event->trigger();
844 844
 }
@@ -879,10 +879,10 @@  discard block
 block discarded – undo
879 879
     $now = time();
880 880
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
881 881
         // Use the value in the cache.
882
-        return (array) json_decode($result['meeting_info']);
882
+        return (array)json_decode($result['meeting_info']);
883 883
     }
884 884
     // Ping again and refresh the cache.
885
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
885
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
886 886
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
887 887
       );
888 888
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -957,8 +957,8 @@  discard block
 block discarded – undo
957 957
  * @param string $configxml
958 958
  */
959 959
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
960
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
961
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
960
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
961
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
962 962
     return $configxmlparams;
963 963
 }
964 964
 
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
  * @param string $configxml
968 968
  */
969 969
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
970
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
970
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
971 971
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
972 972
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
973 973
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
  */
981 981
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
982 982
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
983
-    $configxmlarray = (array) $configxml;
983
+    $configxmlarray = (array)$configxml;
984 984
     if ($configxmlarray['returncode'] != 'SUCCESS') {
985 985
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
986 986
         return '';
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
     global $USER;
1031 1031
     $starttime = $starttime - ($starttime % 1000);
1032 1032
     // Set formatted date.
1033
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1033
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1034 1034
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1035 1035
 }
1036 1036
 
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) {
1047 1047
     $actionbar = '';
1048 1048
     foreach ($tools as $tool) {
1049
-        if ( $tool == 'protect' && !isset($recording['protected']) ) {
1049
+        if ($tool == 'protect' && !isset($recording['protected'])) {
1050 1050
             continue;
1051 1051
         }
1052 1052
         $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool);
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
         $visibility = 'hidden ';
1091 1091
     }
1092 1092
     $recordingpreview = html_writer::start_tag('div',
1093
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1093
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1094 1094
     foreach ($recording['playbacks'] as $playback) {
1095 1095
         if (isset($playback['preview'])) {
1096 1096
             foreach ($playback['preview'] as $image) {
@@ -1118,13 +1118,13 @@  discard block
 block discarded – undo
1118 1118
     if ($recording['published'] === 'false') {
1119 1119
         $visibility = 'hidden ';
1120 1120
     }
1121
-    $id = 'playbacks-'.$recording['recordID'];
1121
+    $id = 'playbacks-' . $recording['recordID'];
1122 1122
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1123 1123
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1124 1124
           'title' => $title, $visibility => $visibility));
1125 1125
     foreach ($recording['playbacks'] as $playback) {
1126 1126
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid,
1127
-            $playback).'&#32;';
1127
+            $playback) . '&#32;';
1128 1128
     }
1129 1129
     $recordingtypes .= html_writer::end_tag('div');
1130 1130
     return $recordingtypes;
@@ -1132,12 +1132,12 @@  discard block
 block discarded – undo
1132 1132
 
1133 1133
 function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) {
1134 1134
     global $CFG, $OUTPUT;
1135
-    $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1135
+    $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1136 1136
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);';
1137
-    $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid.
1138
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1137
+    $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid .
1138
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1139 1139
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1140
-        $href .= '&href='.urlencode(trim($playback['url']));
1140
+        $href .= '&href=' . urlencode(trim($playback['url']));
1141 1141
     }
1142 1142
     $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID'];
1143 1143
     $linkattributes = array(
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1224 1224
         // With icon for $manageaction.
1225 1225
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1226
-        $icon = new pix_icon('i/'.$data['tag'],
1226
+        $icon = new pix_icon('i/' . $data['tag'],
1227 1227
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1228 1228
             'moodle', $iconattributes);
1229 1229
         $linkattributes = array(
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
     if (isset($recordings) && !array_key_exists('messageKey', $recordings)) {
1306 1306
         // There are recordings for this meeting.
1307 1307
         foreach ($recordings as $recording) {
1308
-            if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) {
1308
+            if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
1309 1309
                 continue;
1310 1310
             }
1311 1311
             bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table);
@@ -1320,7 +1320,7 @@  discard block
 block discarded – undo
1320 1320
         return;
1321 1321
     }
1322 1322
     $row = new html_table_row();
1323
-    $row->id = 'recording-td-'.$recording['recordID'];
1323
+    $row->id = 'recording-td-' . $recording['recordID'];
1324 1324
     $row->attributes['data-imported'] = 'false';
1325 1325
     $texthead = '';
1326 1326
     $texttail = '';
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 }
1345 1345
 
1346 1346
 function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) {
1347
-    if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) {
1347
+    if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) {
1348 1348
         return true;
1349 1349
     }
1350 1350
     return false;
@@ -1357,9 +1357,9 @@  discard block
 block discarded – undo
1357 1357
     // Build the message_body.
1358 1358
     $msg->activity_type = '';
1359 1359
     $msg->activity_title = $bigbluebuttonbn->name;
1360
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1361
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1362
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1360
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1361
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1362
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1363 1363
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1364 1364
 }
1365 1365
 
@@ -1449,15 +1449,15 @@  discard block
 block discarded – undo
1449 1449
 
1450 1450
 function bigbluebuttonbn_get_recordings_sql_selectdeleted($courseid, $bigbluebuttonbnid = null, $subset = true) {
1451 1451
     if ($bigbluebuttonbnid === null) {
1452
-        return "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1452
+        return "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1453 1453
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1454 1454
     }
1455 1455
     if ($subset) {
1456
-        return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1456
+        return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1457 1457
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1458 1458
     }
1459
-    return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
1460
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1459
+    return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
1460
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1461 1461
 }
1462 1462
 
1463 1463
 function bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid = null, $subset = true,
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
     }
1503 1503
     // Prepare select for loading records based on existent bigbluebuttonbns.
1504 1504
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
1505
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
1505
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
1506 1506
     // Include only Create events and exclude those with record not true.
1507 1507
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
1508 1508
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -1577,8 +1577,8 @@  discard block
 block discarded – undo
1577 1577
 function bigbluebuttonbn_format_activity_time($time) {
1578 1578
     $activitytime = '';
1579 1579
     if ($time) {
1580
-        $activitytime = calendar_day_representation($time).' '.
1581
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1580
+        $activitytime = calendar_day_representation($time) . ' ' .
1581
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
1582 1582
           calendar_time_representation($time);
1583 1583
     }
1584 1584
     return $activitytime;
Please login to merge, or discard this patch.
backup/moodle2/backup_bigbluebuttonbn_activity_task.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 defined('MOODLE_INTERNAL') || die;
27 27
 
28
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php');
28
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php');
29 29
 
30 30
 /**
31 31
  * Backup task that provides all the settings and steps to perform one complete backup of the activity.
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
     public static function encode_content_links($content) {
63 63
         global $CFG;
64 64
 
65
-        $base = preg_quote($CFG->wwwroot.'/mod/bigbluebuttonbn', '#');
65
+        $base = preg_quote($CFG->wwwroot . '/mod/bigbluebuttonbn', '#');
66 66
 
67 67
         // Link to the list of bigbluebuttonbns.
68
-        $pattern = '#('.$base."\/index.php\?id\=)([0-9]+)#";
68
+        $pattern = '#(' . $base . "\/index.php\?id\=)([0-9]+)#";
69 69
         $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNINDEX*$2@$', $content);
70 70
 
71 71
         // Link to bigbluebuttonbn view by moduleid.
72
-        $pattern = '#('.$base."\/view.php\?id\=)([0-9]+)#";
72
+        $pattern = '#(' . $base . "\/view.php\?id\=)([0-9]+)#";
73 73
         $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNVIEWBYID*$2@$', $content);
74 74
 
75 75
         return $content;
Please login to merge, or discard this patch.
backup/moodle2/backup_bigbluebuttonbn_stepslib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         $logs = new backup_nested_element('logs');
49 49
 
50 50
         $log = new backup_nested_element('log', array('id'), array(
51
-                'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', ));
51
+                'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',));
52 52
 
53 53
         // Build the tree.
54 54
         $bigbluebuttonbn->add_child($logs);
Please login to merge, or discard this patch.