Completed
Push — master ( 86fc5a...76e155 )
by Jesus
04:53
created
bbb_view.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
 
179 179
 function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession, $bigbluebuttonbn) {
180 180
     $data = ['meetingID' => $bbbsession['meetingid'],
181
-              'name' => $bbbsession['meetingname'],
182
-              'attendeePW' => $bbbsession['viewerPW'],
183
-              'moderatorPW' => $bbbsession['modPW'],
184
-              'logoutURL' => $bbbsession['logoutURL'],
181
+                'name' => $bbbsession['meetingname'],
182
+                'attendeePW' => $bbbsession['viewerPW'],
183
+                'moderatorPW' => $bbbsession['modPW'],
184
+                'logoutURL' => $bbbsession['logoutURL'],
185 185
             ];
186 186
 
187 187
     $data['record'] = 'false';
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
     global $USER;
222 222
 
223 223
     $metadata = ['bbb-origin' => $bbbsession['origin'],
224
-                 'bbb-origin-version' => $bbbsession['originVersion'],
225
-                 'bbb-origin-server-name' => $bbbsession['originServerName'],
226
-                 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
227
-                 'bbb-origin-tag' => $bbbsession['originTag'],
228
-                 'bbb-context' => $bbbsession['course']->fullname,
229
-                 'bbb-recording-name' => $bbbsession['meetingname'],
230
-                 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
231
-                 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
224
+                    'bbb-origin-version' => $bbbsession['originVersion'],
225
+                    'bbb-origin-server-name' => $bbbsession['originServerName'],
226
+                    'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
227
+                    'bbb-origin-tag' => $bbbsession['originTag'],
228
+                    'bbb-context' => $bbbsession['course']->fullname,
229
+                    'bbb-recording-name' => $bbbsession['meetingname'],
230
+                    'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
231
+                    'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
232 232
                 ];
233 233
 
234 234
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
             array(
237 237
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
238 238
                 'context' => $bbbsession['bigbluebuttonbnURL']
239
-              )
240
-          );
239
+                )
240
+            );
241 241
     }
242 242
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
243 243
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
Please login to merge, or discard this patch.
view.php 1 patch
Spacing   +34 added lines, -34 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
 $bn = optional_param('n', 0, PARAM_INT);
@@ -59,18 +59,18 @@  discard block
 block discarded – undo
59 59
 if (is_null($serverversion)) {
60 60
     if ($bbbsession['administrator']) {
61 61
         print_error('view_error_unable_join', 'bigbluebuttonbn',
62
-            $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
62
+            $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
63 63
         exit;
64 64
     }
65 65
 
66 66
     if ($bbbsession['moderator']) {
67 67
         print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
68
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
68
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
69 69
         exit;
70 70
     }
71 71
 
72 72
     print_error('view_error_unable_join_student', 'bigbluebuttonbn',
73
-        $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
73
+        $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
74 74
     exit;
75 75
 }
76 76
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 // Print the page header.
82 82
 $PAGE->set_context($context);
83
-$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
83
+$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
84 84
 $PAGE->set_title(format_string($bigbluebuttonbn->name));
85 85
 $PAGE->set_cacheable(false);
86 86
 $PAGE->set_heading($course->fullname);
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) {
91 91
     echo $OUTPUT->header();
92 92
     if (isguestuser()) {
93
-        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
94
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
93
+        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
94
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
95 95
     } else {
96
-        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
97
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
96
+        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
97
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
98 98
     }
99 99
     echo $OUTPUT->footer();
100 100
     exit;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 // Operation URLs.
104 104
 $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
105
-$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .
105
+$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
106 106
     '&bn=' . $bbbsession['bigbluebuttonbn']->id;
107 107
 $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
108 108
     'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 echo $OUTPUT->footer();
123 123
 
124 124
 // Shows version as a comment.
125
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
125
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
126 126
 
127 127
 // Initialize session variable used across views.
128 128
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass;
154 154
 
155 155
     // Database info related to the activity.
156
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
156
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
157 157
         $bbbsession['bigbluebuttonbn']->id;
158 158
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
159 159
     $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
175 175
     }
176 176
     if ($bigbluebuttonbn->record) {
177
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
177
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
178 178
     }
179 179
 
180 180
     $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     $bbbsession['originServerName'] = $parsedurl['host'];
191 191
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
192 192
     $bbbsession['originServerCommonName'] = '';
193
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
193
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
194 194
 }
195 195
 
196 196
 function bigbluebuttonbn_view_bbbsession_roles($context, $userid) {
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
     $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true);
248 248
 
249 249
     // Assign group default values.
250
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
251
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
250
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
251
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
252 252
     $groupname = get_string('allparticipants');
253
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
253
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
254 254
 
255 255
     if (count($groups) == 0) {
256 256
         // Only the All participants group exists.
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
         $bbbsession['group'] = array_values($groups)[0]->id;
262 262
     }
263 263
 
264
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
265
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
264
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
265
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
266 266
     $groupname = groups_get_group_name($bbbsession['group']);
267
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
267
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
268 268
 
269 269
     if (count($groups) == 1) {
270 270
         // There only one group and the user has access to.
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
     }
273 273
 
274 274
     echo $OUTPUT->box_start('generalbox boxaligncenter');
275
-    echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').
275
+    echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') .
276 276
       '</div>';
277 277
     echo $OUTPUT->box_end();
278 278
 
279 279
     groups_print_activity_menu(
280
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id);
280
+      $bbbsession['cm'], $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id);
281 281
     echo '<br><br>';
282 282
 }
283 283
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
             'M.mod_bigbluebuttonbn.recordings.init', array($jsvars));
320 320
     }
321 321
 
322
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
322
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
323 323
 
324 324
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
325 325
 }
@@ -330,12 +330,12 @@  discard block
 block discarded – undo
330 330
     // JavaScript variables for room.
331 331
     $openingtime = '';
332 332
     if ($bbbsession['openingtime']) {
333
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
333
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
334 334
             userdate($bbbsession['openingtime']);
335 335
     }
336 336
     $closingtime = '';
337 337
     if ($bbbsession['closingtime']) {
338
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
338
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
339 339
             userdate($bbbsession['closingtime']);
340 340
     }
341 341
     $jsvars += array(
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
     $output .= $OUTPUT->box_end();
353 353
 
354 354
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
355
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
355
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
356 356
     $output .= $OUTPUT->box_end();
357 357
 
358 358
     if ($activity == 'ended') {
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     // If there are meetings with recordings load the data to the table.
389 389
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
390 390
         // Render a plain html table.
391
-        return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n";
391
+        return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n";
392 392
     }
393 393
 
394 394
     // JavaScript variables for recordings with YUI.
@@ -408,8 +408,8 @@  discard block
 block discarded – undo
408 408
         array('type' => 'button',
409 409
               'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
410 410
               'class' => 'btn btn-secondary',
411
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
412
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
411
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
412
+                  $bbbsession['bigbluebuttonbn']->id . '\''));
413 413
     $output = html_writer::start_tag('br');
414 414
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
415 415
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -424,10 +424,10 @@  discard block
 block discarded – undo
424 424
         $attributes = array('title' => $bbbsession['presentation']['name']);
425 425
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
426 426
 
427
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
428
-                ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
429
-                ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
430
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
427
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
428
+                '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' .
429
+                '' . $OUTPUT->action_link($bbbsession['presentation']['url'],
430
+                      $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
431 431
     }
432 432
 
433 433
     return '';
Please login to merge, or discard this patch.
locallib.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 // BigBlueButton API Calls.
86 86
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
87 87
     $data = ['meetingID' => $meetingid,
88
-              'fullName' => $username,
89
-              'password' => $pw,
90
-              'logoutURL' => $logouturl,
88
+                'fullName' => $username,
89
+                'password' => $pw,
90
+                'logoutURL' => $logouturl,
91 91
             ];
92 92
 
93 93
     if (!is_null($configtoken)) {
@@ -188,24 +188,24 @@  discard block
 block discarded – undo
188 188
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
189 189
     $xml = bigbluebuttonbn_wrap_xml_load_file(
190 190
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
191
-      );
191
+        );
192 192
 
193 193
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
194 194
         // Meeting info was returned.
195 195
         return array('returncode' => $xml->returncode,
196
-                     'meetingID' => $xml->meetingID,
197
-                     'moderatorPW' => $xml->moderatorPW,
198
-                     'attendeePW' => $xml->attendeePW,
199
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
200
-                     'running' => $xml->running,
201
-                     'recording' => $xml->recording,
202
-                     'startTime' => $xml->startTime,
203
-                     'endTime' => $xml->endTime,
204
-                     'participantCount' => $xml->participantCount,
205
-                     'moderatorCount' => $xml->moderatorCount,
206
-                     'attendees' => $xml->attendees,
207
-                     'metadata' => $xml->metadata,
208
-                   );
196
+                        'meetingID' => $xml->meetingID,
197
+                        'moderatorPW' => $xml->moderatorPW,
198
+                        'attendeePW' => $xml->attendeePW,
199
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
200
+                        'running' => $xml->running,
201
+                        'recording' => $xml->recording,
202
+                        'startTime' => $xml->startTime,
203
+                        'endTime' => $xml->endTime,
204
+                        'participantCount' => $xml->participantCount,
205
+                        'moderatorCount' => $xml->moderatorCount,
206
+                        'attendees' => $xml->attendees,
207
+                        'metadata' => $xml->metadata,
208
+                    );
209 209
     }
210 210
 
211 211
     if ($xml) {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         // Do getRecordings is executed using a method GET (supported by all versions of BBB).
270 270
         $xml = bigbluebuttonbn_wrap_xml_load_file(
271 271
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getRecordings', ['meetingID' => implode(',', $mids)])
272
-          );
272
+            );
273 273
         if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
274 274
             // If there were meetings already created.
275 275
             foreach ($xml->recordings->recording as $recording) {
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 function bigbluebuttonbn_get_default_config_xml() {
333 333
     $xml = bigbluebuttonbn_wrap_xml_load_file(
334 334
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
335
-      );
335
+        );
336 336
 
337 337
     return $xml;
338 338
 }
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
     foreach ($ids as $id) {
407 407
         $xml = bigbluebuttonbn_wrap_xml_load_file(
408 408
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
409
-          );
409
+            );
410 410
         if ($xml && $xml->returncode != 'SUCCESS') {
411 411
             return false;
412 412
         }
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
     foreach ($ids as $id) {
425 425
         $xml = bigbluebuttonbn_wrap_xml_load_file(
426 426
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
427
-          );
427
+            );
428 428
         if ($xml && $xml->returncode != 'SUCCESS') {
429 429
             return false;
430 430
         }
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     foreach ($ids as $id) {
443 443
         $xml = bigbluebuttonbn_wrap_xml_load_file(
444 444
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
445
-          );
445
+            );
446 446
         if ($xml && $xml->returncode != 'SUCCESS') {
447 447
             return false;
448 448
         }
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
502 502
     $xml = bigbluebuttonbn_wrap_xml_load_file(
503 503
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
504
-      );
504
+        );
505 505
 
506 506
     if ($xml) {
507 507
         // If the xml packet returned failure it displays the message to the user.
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 function bigbluebuttonbn_is_meeting_running($meetingid) {
519 519
     $xml = bigbluebuttonbn_wrap_xml_load_file(
520 520
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('isMeetingRunning', ['meetingID' => $meetingid])
521
-      );
521
+        );
522 522
 
523 523
     if ($xml && $xml->returncode == 'SUCCESS') {
524 524
         return ($xml->running == 'true');
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 function bigbluebuttonbn_get_server_version() {
531 531
     $xml = bigbluebuttonbn_wrap_xml_load_file(
532 532
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
533
-      );
533
+        );
534 534
 
535 535
     if ($xml && $xml->returncode == 'SUCCESS') {
536 536
         return $xml->version;
@@ -591,10 +591,10 @@  discard block
 block discarded – undo
591 591
 
592 592
         $options = array();
593 593
         $options['CURLOPT_HTTPHEADER'] = array(
594
-                 'Content-Type: '.$contenttype,
595
-                 'Content-Length: '.strlen($data),
596
-                 'Content-Language: en-US',
597
-               );
594
+                    'Content-Type: '.$contenttype,
595
+                    'Content-Length: '.strlen($data),
596
+                    'Content-Language: en-US',
597
+                );
598 598
 
599 599
         return $c->post($url, $data, $options);
600 600
     }
@@ -676,16 +676,16 @@  discard block
 block discarded – undo
676 676
         'all' => array(
677 677
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
678 678
             'children' => []
679
-          )
680
-      );
679
+            )
680
+        );
681 681
     $data['role'] = array(
682 682
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
683 683
         'children' => bigbluebuttonbn_get_roles_select($context)
684
-      );
684
+        );
685 685
     $data['user'] = array(
686 686
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
687 687
         'children' => bigbluebuttonbn_get_users_select($context)
688
-      );
688
+        );
689 689
     return $data;
690 690
 }
691 691
 
@@ -735,9 +735,9 @@  discard block
 block discarded – undo
735 735
             continue;
736 736
         }
737 737
         $participantlistarray[] = array(
738
-              'selectiontype' => 'role',
739
-              'selectionid' => $moderatordefault,
740
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
738
+                'selectiontype' => 'role',
739
+                'selectionid' => $moderatordefault,
740
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
741 741
     }
742 742
     return $participantlistarray;
743 743
 }
@@ -748,11 +748,11 @@  discard block
 block discarded – undo
748 748
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
749 749
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
750 750
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
751
-          ],
751
+            ],
752 752
         'type_selected' => 'all',
753 753
         'options' => ['all' => '---------------'],
754 754
         'selected' => 'all',
755
-      ];
755
+        ];
756 756
 }
757 757
 
758 758
 function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) {
@@ -870,8 +870,8 @@  discard block
 block discarded – undo
870 870
         }
871 871
     }
872 872
     $parray = array('url' => $purl, 'name' => $pname,
873
-                               'icon' => $picon,
874
-                               'mimetype_description' => $pmimetypedescrip);
873
+                                'icon' => $picon,
874
+                                'mimetype_description' => $pmimetypedescrip);
875 875
     return $parray;
876 876
 }
877 877
 
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
         $eventproperties['other'] = $options['other'];
946 946
     }
947 947
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
948
-      array($eventproperties));
948
+        array($eventproperties));
949 949
     $event->trigger();
950 950
 }
951 951
 
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
     // Ping again and refresh the cache.
991 991
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
992 992
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
993
-      );
993
+        );
994 994
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
995 995
     return $meetinginfo;
996 996
 }
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
         $actionbar .= bigbluebuttonbn_actionbar_render_button(
1113 1113
             $recording,
1114 1114
             bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool)
1115
-          );
1115
+            );
1116 1116
     }
1117 1117
     $head = html_writer::start_tag('div', array(
1118 1118
         'id' => 'recording-actionbar-' . $recording['recordID'],
@@ -1185,8 +1185,8 @@  discard block
 block discarded – undo
1185 1185
     }
1186 1186
     $id = 'playbacks-'.$recording['recordID'];
1187 1187
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1188
-          'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'],
1189
-          'title' => $title, $visibility => $visibility));
1188
+            'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'],
1189
+            'title' => $title, $visibility => $visibility));
1190 1190
     foreach ($recording['playbacks'] as $playback) {
1191 1191
         $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1192 1192
         $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid.
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
             'onclick' => $onclick,
1292 1292
             'data-action' => $data['action'],
1293 1293
             'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID'])
1294
-          );
1294
+            );
1295 1295
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
1296 1296
     }
1297 1297
 
@@ -1641,8 +1641,8 @@  discard block
 block discarded – undo
1641 1641
     $activitytime = '';
1642 1642
     if ($time) {
1643 1643
         $activitytime = calendar_day_representation($time).' '.
1644
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1645
-          calendar_time_representation($time);
1644
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1645
+            calendar_time_representation($time);
1646 1646
     }
1647 1647
 
1648 1648
     return $activitytime;
Please login to merge, or discard this patch.
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once(dirname(__FILE__).'/lib.php');
30
+require_once(dirname(__FILE__) . '/lib.php');
31 31
 
32 32
 const BIGBLUEBUTTONBN_FORCED = true;
33 33
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     if (isset($meta)) {
77 77
         $log->meta = $meta;
78 78
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
79
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
79
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
80 80
     }
81 81
 
82 82
     $DB->insert_record('bigbluebuttonbn_logs', $log);
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 
122 122
     if (!is_null($pname) && !is_null($purl)) {
123 123
         $method = BIGBLUEBUTTONBN_METHOD_POST;
124
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='".
125
-            $purl."' /></module></modules>";
124
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='" .
125
+            $purl . "' /></module></modules>";
126 126
     }
127 127
 
128 128
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                                 'moderatorPW' => $meeting->moderatorPW,
168 168
                                 'attendeePW' => $meeting->attendeePW,
169 169
                                 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded,
170
-                                'running' => $meeting->running, );
170
+                                'running' => $meeting->running,);
171 171
         }
172 172
 
173 173
         return $meetings;
@@ -308,12 +308,12 @@  discard block
 block discarded – undo
308 308
 function bigbluebuttonbn_get_recordings_imported_array($courseid, $bigbluebuttonbnid = null, $subset = true) {
309 309
     global $DB;
310 310
 
311
-    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
312
-        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
311
+    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
312
+        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
313 313
     if ($bigbluebuttonbnid === null) {
314
-        $select = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
314
+        $select = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
315 315
     } else if ($subset) {
316
-        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
316
+        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
317 317
     }
318 318
     $recordsimported = $DB->get_records_select('bigbluebuttonbn_logs', $select);
319 319
 
@@ -340,37 +340,37 @@  discard block
 block discarded – undo
340 340
 function bigbluebuttonbn_get_default_config_xml_array() {
341 341
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
342 342
 
343
-    return (array) $defaultconfigxml;
343
+    return (array)$defaultconfigxml;
344 344
 }
345 345
 
346 346
 function bigbluebuttonbn_get_recording_array_value($recording) {
347 347
     // Add formats.
348 348
     $playbackarray = array();
349 349
     foreach ($recording->playback->format as $format) {
350
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
351
-            'url' => (string) $format->url, 'length' => (string) $format->length);
350
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
351
+            'url' => (string)$format->url, 'length' => (string)$format->length);
352 352
         // Add preview per format when existing.
353 353
         if ($format->preview) {
354 354
             $imagesarray = array();
355 355
             foreach ($format->preview->images->image as $image) {
356
-                $imagearray = array('url' => (string) $image);
356
+                $imagearray = array('url' => (string)$image);
357 357
                 foreach ($image->attributes() as $attkey => $attvalue) {
358
-                    $imagearray[$attkey] = (string) $attvalue;
358
+                    $imagearray[$attkey] = (string)$attvalue;
359 359
                 }
360 360
                 array_push($imagesarray, $imagearray);
361 361
             }
362
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
362
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
363 363
         }
364 364
     }
365 365
 
366 366
     // Add the metadata to the recordings array.
367 367
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
368
-    $recordingarray = array('recordID' => (string) $recording->recordID,
369
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
370
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
371
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
368
+    $recordingarray = array('recordID' => (string)$recording->recordID,
369
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
370
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
371
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
372 372
     if (isset($recording->protected)) {
373
-        $recordingarray['protected'] = (string) $recording->protected;
373
+        $recordingarray['protected'] = (string)$recording->protected;
374 374
     }
375 375
     // Force protected.
376 376
     $recordingarray['protected'] = 'false';
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         if (is_object($value)) {
384 384
             $value = '';
385 385
         }
386
-        $metadataarray['meta_'.$key] = $value;
386
+        $metadataarray['meta_' . $key] = $value;
387 387
     }
388 388
     return $metadataarray;
389 389
 }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     $ids = explode(',', $recordids);
442 442
     foreach ($ids as $id) {
443 443
         $xml = bigbluebuttonbn_wrap_xml_load_file(
444
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
444
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
445 445
           );
446 446
         if ($xml && $xml->returncode != 'SUCCESS') {
447 447
             return false;
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
             return $xml;
562 562
         } catch (Exception $e) {
563 563
             libxml_use_internal_errors($previous);
564
-            $error = 'Caught exception: '.$e->getMessage();
564
+            $error = 'Caught exception: ' . $e->getMessage();
565 565
             debugging($error, DEBUG_DEVELOPER);
566 566
             return null;
567 567
         }
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
574 574
         return $response;
575 575
     } catch (Exception $e) {
576
-        $error = 'Caught exception: '.$e->getMessage();
576
+        $error = 'Caught exception: ' . $e->getMessage();
577 577
         debugging($error, DEBUG_DEVELOPER);
578 578
         libxml_use_internal_errors($previous);
579 579
         return null;
@@ -591,8 +591,8 @@  discard block
 block discarded – undo
591 591
 
592 592
         $options = array();
593 593
         $options['CURLOPT_HTTPHEADER'] = array(
594
-                 'Content-Type: '.$contenttype,
595
-                 'Content-Length: '.strlen($data),
594
+                 'Content-Type: ' . $contenttype,
595
+                 'Content-Length: ' . strlen($data),
596 596
                  'Content-Language: en-US',
597 597
                );
598 598
 
@@ -609,9 +609,9 @@  discard block
 block discarded – undo
609 609
     if ($userroles) {
610 610
         $where = '';
611 611
         foreach ($userroles as $value) {
612
-            $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid;
612
+            $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid;
613 613
         }
614
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
614
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
615 615
     }
616 616
 
617 617
     return $userroles;
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 }
625 625
 
626 626
 function bigbluebuttonbn_get_users(context $context = null) {
627
-    $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
627
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
628 628
     foreach ($users as $key => $value) {
629 629
         $users[$key] = fullname($value);
630 630
     }
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 }
633 633
 
634 634
 function bigbluebuttonbn_get_users_select(context $context = null) {
635
-    $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
635
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
636 636
     foreach ($users as $key => $value) {
637 637
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
638 638
     }
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 }
641 641
 
642 642
 function bigbluebuttonbn_get_roles(context $context = null) {
643
-    $roles = (array) role_get_names($context);
643
+    $roles = (array)role_get_names($context);
644 644
     foreach ($roles as $key => $value) {
645 645
         $roles[$key] = $value->localname;
646 646
     }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 }
649 649
 
650 650
 function bigbluebuttonbn_get_roles_select(context $context = null) {
651
-    $roles = (array) role_get_names($context);
651
+    $roles = (array)role_get_names($context);
652 652
     foreach ($roles as $key => $value) {
653 653
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
654 654
     }
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 }
657 657
 
658 658
 function bigbluebuttonbn_get_role($id) {
659
-    $roles = (array) role_get_names();
659
+    $roles = (array)role_get_names();
660 660
     if (is_numeric($id)) {
661 661
         return (object)$roles[$id];
662 662
     }
@@ -702,11 +702,11 @@  discard block
 block discarded – undo
702 702
         return array();
703 703
     }
704 704
     foreach ($rules as $key => $rule) {
705
-        if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) {
705
+        if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) {
706 706
             continue;
707 707
         }
708 708
         $role = bigbluebuttonbn_get_role($rule['selectionid']);
709
-        if ( $role == null ) {
709
+        if ($role == null) {
710 710
             unset($rules[$key]);
711 711
             continue;
712 712
         }
@@ -815,9 +815,9 @@  discard block
 block discarded – undo
815 815
     $isunique = true;
816 816
     if ($voicebridge != 0) {
817 817
         $table = 'bigbluebuttonbn';
818
-        $select = 'voicebridge = '.$voicebridge;
818
+        $select = 'voicebridge = ' . $voicebridge;
819 819
         if ($id) {
820
-            $select .= ' AND id <> '.$id;
820
+            $select .= ' AND id <> ' . $id;
821 821
         }
822 822
         if ($DB->get_records_select($table, $select)) {
823 823
             $isunique = false;
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 function bigbluebuttonbn_generate_nonce() {
879 879
     $mt = microtime();
880 880
     $rand = mt_rand();
881
-    return md5($mt.$rand);
881
+    return md5($mt . $rand);
882 882
 }
883 883
 
884 884
 function bigbluebuttonbn_random_password($length = 8) {
@@ -889,41 +889,41 @@  discard block
 block discarded – undo
889 889
 
890 890
 function bigbluebuttonbn_events() {
891 891
     return array(
892
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
893
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
894
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
895
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
896
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
897
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
898
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
899
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
900
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
901
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
902
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
903
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
904
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
905
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
906
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
892
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
893
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
894
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
895
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
896
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
897
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
898
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
899
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
900
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
901
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
902
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
903
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
904
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
905
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
906
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
907 907
     );
908 908
 }
909 909
 
910 910
 function bigbluebuttonbn_events_action() {
911 911
     return array(
912
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
913
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
914
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
915
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
916
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
917
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
918
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
919
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
920
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
921
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
922
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
923
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
924
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
925
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
926
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
912
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
913
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
914
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
915
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
916
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
917
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
918
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
919
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
920
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
921
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
922
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
923
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
924
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
925
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
926
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
927 927
     );
928 928
 }
929 929
 
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
     if (array_key_exists('other', $options)) {
945 945
         $eventproperties['other'] = $options['other'];
946 946
     }
947
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
947
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
948 948
       array($eventproperties));
949 949
     $event->trigger();
950 950
 }
@@ -985,10 +985,10 @@  discard block
 block discarded – undo
985 985
     $now = time();
986 986
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
987 987
         // Use the value in the cache.
988
-        return (array) json_decode($result['meeting_info']);
988
+        return (array)json_decode($result['meeting_info']);
989 989
     }
990 990
     // Ping again and refresh the cache.
991
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
991
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
992 992
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
993 993
       );
994 994
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1040,8 +1040,8 @@  discard block
 block discarded – undo
1040 1040
  * @param string $configxml
1041 1041
  */
1042 1042
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1043
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1044
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1043
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1044
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1045 1045
     return $configxmlparams;
1046 1046
 }
1047 1047
 
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
  * @param string $configxml
1051 1051
  */
1052 1052
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1053
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1053
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1054 1054
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1055 1055
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
1056 1056
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
  */
1064 1064
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1065 1065
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1066
-    $configxmlarray = (array) $configxml;
1066
+    $configxmlarray = (array)$configxml;
1067 1067
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1068 1068
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1069 1069
         return '';
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
         $row->date = $starttime;
1093 1093
         $starttime = $starttime - ($starttime % 1000);
1094 1094
         // Set formatted date.
1095
-        $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1095
+        $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1096 1096
         $row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1097 1097
         // Set formatted duration.
1098 1098
         $firstplayback = array_values($recording['playbacks'])[0];
@@ -1154,7 +1154,7 @@  discard block
 block discarded – undo
1154 1154
         $visibility = 'hidden ';
1155 1155
     }
1156 1156
     $recordingpreview = html_writer::start_tag('div',
1157
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1157
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1158 1158
     foreach ($recording['playbacks'] as $playback) {
1159 1159
         if (isset($playback['preview'])) {
1160 1160
             foreach ($playback['preview'] as $image) {
@@ -1183,19 +1183,19 @@  discard block
 block discarded – undo
1183 1183
     if ($recording['published'] === 'false') {
1184 1184
         $visibility = 'hidden ';
1185 1185
     }
1186
-    $id = 'playbacks-'.$recording['recordID'];
1186
+    $id = 'playbacks-' . $recording['recordID'];
1187 1187
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1188 1188
           'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'],
1189 1189
           'title' => $title, $visibility => $visibility));
1190 1190
     foreach ($recording['playbacks'] as $playback) {
1191 1191
         $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1192
-        $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid.
1193
-            '&href='.urlencode($playback['url']).'&rid='.$recording['recordID'];
1194
-        $linkattributes = array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'),
1192
+        $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn=' . $bigbluebuttonbnid .
1193
+            '&href=' . urlencode($playback['url']) . '&rid=' . $recording['recordID'];
1194
+        $linkattributes = array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'),
1195 1195
             'class' => 'btn btn-sm btn-default', 'onclick' => $onclick,
1196 1196
             'data-action' => 'play', 'data-href' => $href);
1197
-        $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_'.$playback['type'],
1198
-            'bigbluebuttonbn'), null, $linkattributes).'&#32;';
1197
+        $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_' . $playback['type'],
1198
+            'bigbluebuttonbn'), null, $linkattributes) . '&#32;';
1199 1199
     }
1200 1200
     $recordingtypes .= html_writer::end_tag('div');
1201 1201
     return $recordingtypes;
@@ -1279,11 +1279,11 @@  discard block
 block discarded – undo
1279 1279
         $target .= '-' . $data['target'];
1280 1280
     }
1281 1281
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1282
-    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);';
1282
+    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);';
1283 1283
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1284 1284
         // With icon for $manageaction.
1285 1285
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1286
-        $icon = new pix_icon('i/'.$data['tag'],
1286
+        $icon = new pix_icon('i/' . $data['tag'],
1287 1287
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1288 1288
             'moodle', $iconattributes);
1289 1289
         $linkattributes = array(
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
     if (isset($recordings) && !array_key_exists('messageKey', $recordings)) {
1374 1374
         // There are recordings for this meeting.
1375 1375
         foreach ($recordings as $recording) {
1376
-            if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) {
1376
+            if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
1377 1377
                 continue;
1378 1378
             }
1379 1379
             bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table);
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 
1386 1386
 function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, &$table) {
1387 1387
     $row = new html_table_row();
1388
-    $row->id = 'recording-td-'.$recording['recordID'];
1388
+    $row->id = 'recording-td-' . $recording['recordID'];
1389 1389
     $row->attributes['data-imported'] = 'false';
1390 1390
     $texthead = '';
1391 1391
     $texttail = '';
@@ -1399,9 +1399,9 @@  discard block
 block discarded – undo
1399 1399
     $rowdata = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools);
1400 1400
     if ($rowdata != null) {
1401 1401
         $rowdata->date_formatted = str_replace(' ', '&nbsp;', $rowdata->date_formatted);
1402
-        $row->cells = array($texthead.$rowdata->recording.$texttail,
1403
-            $texthead.$rowdata->activity.$texttail, $texthead.$rowdata->description.$texttail,
1404
-            $rowdata->preview, $texthead.$rowdata->date_formatted.$texttail,
1402
+        $row->cells = array($texthead . $rowdata->recording . $texttail,
1403
+            $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1404
+            $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1405 1405
             $rowdata->duration_formatted);
1406 1406
         if ($bbbsession['managerecordings']) {
1407 1407
             $row->cells[] = $rowdata->actionbar;
@@ -1411,7 +1411,7 @@  discard block
 block discarded – undo
1411 1411
 }
1412 1412
 
1413 1413
 function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) {
1414
-    return !( !isset($recording['imported']) && isset($bbbsession['group']) && $recording['meetingID'] != $bbbsession['meetingid'] );
1414
+    return !(!isset($recording['imported']) && isset($bbbsession['group']) && $recording['meetingID'] != $bbbsession['meetingid']);
1415 1415
 }
1416 1416
 
1417 1417
 function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) {
@@ -1423,9 +1423,9 @@  discard block
 block discarded – undo
1423 1423
     // Build the message_body.
1424 1424
     $msg->activity_type = '';
1425 1425
     $msg->activity_title = $bigbluebuttonbn->name;
1426
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1427
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1428
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1426
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1427
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1428
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1429 1429
 
1430 1430
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1431 1431
 }
@@ -1518,15 +1518,15 @@  discard block
 block discarded – undo
1518 1518
 
1519 1519
     // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'.
1520 1520
     $select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'";
1521
-    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
1522
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1521
+    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
1522
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1523 1523
     if ($bigbluebuttonbnid === null) {
1524 1524
         $select = "course = '{$courseid}'";
1525
-        $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1525
+        $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1526 1526
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1527 1527
     } else if ($subset) {
1528 1528
         $select = "id = '{$bigbluebuttonbnid}'";
1529
-        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1529
+        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1530 1530
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1531 1531
     }
1532 1532
     $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid');
@@ -1548,7 +1548,7 @@  discard block
 block discarded – undo
1548 1548
     if (!empty($bigbluebuttonbns)) {
1549 1549
         // Prepare select for loading records based on existent bigbluebuttonbns.
1550 1550
         $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
1551
-        $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
1551
+        $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
1552 1552
         // Include only Create events and exclude those with record not true.
1553 1553
         $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
1554 1554
         // Execute select for loading records based on existent bigbluebuttonbns.
@@ -1640,8 +1640,8 @@  discard block
 block discarded – undo
1640 1640
 function bigbluebuttonbn_format_activity_time($time) {
1641 1641
     $activitytime = '';
1642 1642
     if ($time) {
1643
-        $activitytime = calendar_day_representation($time).' '.
1644
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1643
+        $activitytime = calendar_day_representation($time) . ' ' .
1644
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
1645 1645
           calendar_time_representation($time);
1646 1646
     }
1647 1647
 
Please login to merge, or discard this patch.