Completed
Push — master ( 59bc19...b8c79f )
by Jesus
02:06
created
bbb_broker.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -371,19 +371,19 @@  discard block
 block discarded – undo
371 371
             return array(
372 372
                 'status' => false,
373 373
                 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn')
374
-              );
374
+                );
375 375
         }
376 376
         if ($realrecordings[$params['id']]['published'] !== 'true') {
377 377
             return array(
378 378
                 'status' => false,
379 379
                 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn')
380
-              );
380
+                );
381 381
         }
382 382
         return array(
383 383
             'status' => bigbluebuttonbn_publish_recording_imported(
384 384
                 $recordings[$params['id']]['imported'], true
385 385
             )
386
-          );
386
+            );
387 387
     }
388 388
 
389 389
     // As the recordingid was not identified as imported recording link, execute actual publish.
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
         'status' => bigbluebuttonbn_publish_recordings(
392 392
             $params['id'], 'true'
393 393
         )
394
-      );
394
+        );
395 395
 }
396 396
 
397 397
 function bigbluebuttonbn_broker_recording_action_unprotect($params, $recordings) {
@@ -404,19 +404,19 @@  discard block
 block discarded – undo
404 404
             return array(
405 405
                 'status' => false,
406 406
                 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn')
407
-              );
407
+                );
408 408
         }
409 409
         if ($realrecordings[$params['id']]['protected'] === 'true') {
410 410
             return array(
411 411
                 'status' => false,
412 412
                 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn')
413
-              );
413
+                );
414 414
         }
415 415
         return array(
416 416
             'status' => bigbluebuttonbn_protect_recording_imported(
417 417
                 $recordings[$params['id']]['imported'], false
418 418
             )
419
-          );
419
+            );
420 420
     }
421 421
 
422 422
     // As the recordingid was not identified as imported recording link, execute actual uprotect.
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
         'status' => bigbluebuttonbn_update_recordings(
425 425
             $params['id'], array('protect' => 'false')
426 426
         )
427
-      );
427
+        );
428 428
 }
429 429
 
430 430
 function bigbluebuttonbn_broker_recording_action_unpublish($params, $recordings) {
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
             'status' => bigbluebuttonbn_publish_recording_imported(
437 437
                 $recordings[$params['id']]['imported'], false
438 438
             )
439
-          );
439
+            );
440 440
     }
441 441
 
442 442
     // As the recordingid was not identified as imported recording link, execute unpublish on a real recording.
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
         'status' => bigbluebuttonbn_publish_recordings(
457 457
             $params['id'], 'false'
458 458
         )
459
-      );
459
+        );
460 460
 }
461 461
 
462 462
 function bigbluebuttonbn_broker_recording_action_protect($params, $recordings) {
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             'status' => bigbluebuttonbn_protect_recording_imported(
469 469
                 $recordings[$params['id']]['imported'], true
470 470
             )
471
-          );
471
+            );
472 472
     }
473 473
 
474 474
     // As the recordingid was not identified as imported recording link, execute protect on a real recording.
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
         'status' => bigbluebuttonbn_update_recordings(
489 489
             $params['id'], array('protect' => 'true')
490 490
         )
491
-      );
491
+        );
492 492
 }
493 493
 
494 494
 function bigbluebuttonbn_broker_recording_action_delete($params, $recordings) {
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
             'status' => bigbluebuttonbn_delete_recording_imported(
501 501
                 $recordings[$params['id']]['imported']
502 502
             )
503
-          );
503
+            );
504 504
     }
505 505
 
506 506
     // As the recordingid was not identified as imported recording link, execute delete on a real recording.
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
         'status' => bigbluebuttonbn_delete_recordings(
519 519
             $params['id']
520 520
         )
521
-      );
521
+        );
522 522
 }
523 523
 
524 524
 function bigbluebuttonbn_broker_recording_action_edit($params, $recordings) {
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
             'status' => bigbluebuttonbn_update_recording_imported(
529 529
                 $recordings[$params['id']]['imported'], json_decode($params['meta'], true)
530 530
             )
531
-          );
531
+            );
532 532
     }
533 533
 
534 534
     // As the recordingid was not identified as imported recording link, execute update on a real recording.
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
         'status' => bigbluebuttonbn_update_recordings(
539 539
             $params['id'], json_decode($params['meta'])
540 540
         )
541
-      );
541
+        );
542 542
 }
543 543
 
544 544
 function bigbluebuttonbn_broker_recording_ready($params, $bigbluebuttonbn) {
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
     $params['recording_import'] = ['id' => 'The recordingID must be specified.'];
680 680
     $params['recording_ready'] = [
681 681
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
682
-          ];
682
+            ];
683 683
     $params['live_session_events'] = [
684 684
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
685
-          ];
685
+            ];
686 686
     return $params;
687 687
 }
688 688
 
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
 
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
         return;
140 140
     }
141 141
 
142
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
142
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
143 143
     return;
144 144
 
145 145
 } catch (Exception $e) {
146
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
146
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
147 147
     return;
148 148
 }
149 149
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
284 284
     $callbackresponse['status'] = true;
285 285
     $callbackresponse['found'] = true;
286
-    $callbackresponse['published'] = (string) $recording['published'];
286
+    $callbackresponse['published'] = (string)$recording['published'];
287 287
     if (!isset($params['meta'])) {
288 288
         return $callbackresponse;
289 289
     }
@@ -548,8 +548,8 @@  discard block
 block discarded – undo
548 548
         $decodedparameters = JWT::decode($params['signed_parameters'], \mod_bigbluebuttonbn\locallib\config::get('shared_secret'),
549 549
             array('HS256'));
550 550
     } catch (Exception $e) {
551
-        $error = 'Caught exception: '.$e->getMessage();
552
-        header('HTTP/1.0 400 Bad Request. '.$error);
551
+        $error = 'Caught exception: ' . $e->getMessage();
552
+        header('HTTP/1.0 400 Bad Request. ' . $error);
553 553
         return;
554 554
     }
555 555
 
@@ -567,8 +567,8 @@  discard block
 block discarded – undo
567 567
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
568 568
         header('HTTP/1.0 202 Accepted');
569 569
     } catch (Exception $e) {
570
-        $error = 'Caught exception: '.$e->getMessage();
571
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
570
+        $error = 'Caught exception: ' . $e->getMessage();
571
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
572 572
     }
573 573
 }
574 574
 
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
584 584
     if (!isset($importrecordings[$params['id']])) {
585 585
         $error = "Recording {$params['id']} could not be found. It can not be imported";
586
-        header('HTTP/1.0 404 Not found. '.$error);
586
+        header('HTTP/1.0 404 Not found. ' . $error);
587 587
         return;
588 588
     }
589 589
 
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 
592 592
     $importrecordings[$params['id']]['imported'] = true;
593 593
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
594
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
594
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
595 595
     bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
596 596
     // Moodle event logger: Create an event for recording imported.
597 597
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -609,8 +609,8 @@  discard block
 block discarded – undo
609 609
         $decodedparameters = JWT::decode($params['signed_parameters'], \mod_bigbluebuttonbn\locallib\config::get('shared_secret'),
610 610
             array('HS256'));
611 611
     } catch (Exception $e) {
612
-        $error = 'Caught exception: '.$e->getMessage();
613
-        header('HTTP/1.0 400 Bad Request. '.$error);
612
+        $error = 'Caught exception: ' . $e->getMessage();
613
+        header('HTTP/1.0 400 Bad Request. ' . $error);
614 614
         return;
615 615
     }
616 616
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 
649 649
     $action = strtolower($params['action']);
650 650
     if (!array_key_exists($action, $requiredparams)) {
651
-        return 'Action '.$params['action'].' can not be performed.';
651
+        return 'Action ' . $params['action'] . ' can not be performed.';
652 652
     }
653 653
 
654 654
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
Please login to merge, or discard this patch.
view.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
 
272 272
     echo $OUTPUT->box_start('generalbox boxaligncenter');
273 273
     echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').
274
-      '</div>';
274
+        '</div>';
275 275
     echo $OUTPUT->box_end();
276 276
 
277 277
     groups_print_activity_menu(
278
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id);
278
+        $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id);
279 279
     echo '<br><br>';
280 280
 }
281 281
 
@@ -380,13 +380,13 @@  discard block
 block discarded – undo
380 380
         $recordings = bigbluebuttonbn_get_recordings(
381 381
             $bbbsession['course']->id, $bigbluebuttonbnid, $showroom,
382 382
             $bbbsession['bigbluebuttonbn']->recordings_deleted
383
-          );
383
+            );
384 384
     }
385 385
 
386 386
     // Get recording links.
387 387
     $recordingsimported = bigbluebuttonbn_get_recordings_imported_array(
388 388
         $bbbsession['course']->id, $bigbluebuttonbnid, $showroom
389
-      );
389
+        );
390 390
 
391 391
     /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent
392 392
      * recordings are not included. */
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
     // JavaScript variables for recordings.
403 403
     $jsvars += array(
404 404
             'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1',
405
-          );
405
+            );
406 406
 
407 407
     // If there are meetings with recordings load the data to the table.
408 408
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
     $jsvars += array(
415 415
             'columns' => bigbluebuttonbn_get_recording_columns($bbbsession),
416 416
             'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings),
417
-          );
417
+            );
418 418
 
419 419
     // Render a YUI table.
420 420
     return html_writer::div('', '', array('id' => 'bigbluebuttonbn_yui_table'));
@@ -425,10 +425,10 @@  discard block
 block discarded – undo
425 425
 
426 426
     $button = html_writer::tag('input', '',
427 427
         array('type' => 'button',
428
-              'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
429
-              'class' => 'btn btn-secondary',
430
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
431
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
428
+                'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
429
+                'class' => 'btn btn-secondary',
430
+                'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
431
+                    $bbbsession['bigbluebuttonbn']->id.'\''));
432 432
     $output = html_writer::start_tag('br');
433 433
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
434 434
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
         return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
447 447
                 ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
448 448
                 ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
449
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
449
+                        $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
450 450
     }
451 451
 
452 452
     return '';
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 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);
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
 if (is_null($serverversion)) {
57 57
     if ($bbbsession['administrator']) {
58 58
         print_error('view_error_unable_join', 'bigbluebuttonbn',
59
-            $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
59
+            $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
60 60
         exit;
61 61
     }
62 62
 
63 63
     if ($bbbsession['moderator']) {
64 64
         print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
65
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
65
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
66 66
         exit;
67 67
     }
68 68
 
69 69
     print_error('view_error_unable_join_student', 'bigbluebuttonbn',
70
-        $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
70
+        $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
71 71
     exit;
72 72
 }
73
-$bbbsession['serverversion'] = (string) $serverversion;
73
+$bbbsession['serverversion'] = (string)$serverversion;
74 74
 
75 75
 // Mark viewed by user (if required).
76 76
 $completion = new completion_info($course);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 // Print the page header.
80 80
 $PAGE->set_context($context);
81
-$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
81
+$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
82 82
 $PAGE->set_title(format_string($bigbluebuttonbn->name));
83 83
 $PAGE->set_cacheable(false);
84 84
 $PAGE->set_heading($course->fullname);
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) {
89 89
     echo $OUTPUT->header();
90 90
     if (isguestuser()) {
91
-        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
92
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
91
+        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
92
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
93 93
     } else {
94
-        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
95
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
94
+        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
95
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
96 96
     }
97 97
     echo $OUTPUT->footer();
98 98
     exit;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 // Operation URLs.
102 102
 $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
103
-$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .
103
+$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
104 104
     '&bn=' . $bbbsession['bigbluebuttonbn']->id;
105 105
 $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
106 106
     'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 echo $OUTPUT->footer();
121 121
 
122 122
 // Shows version as a comment.
123
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
123
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
124 124
 
125 125
 // Initialize session variable used across views.
126 126
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass;
152 152
 
153 153
     // Database info related to the activity.
154
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
154
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
155 155
         $bbbsession['bigbluebuttonbn']->id;
156 156
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
157 157
     $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro;
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
173 173
     }
174 174
     if ($bigbluebuttonbn->record) {
175
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
175
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
176 176
     }
177 177
 
178 178
     $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime;
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     $bbbsession['originServerName'] = $parsedurl['host'];
189 189
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
190 190
     $bbbsession['originServerCommonName'] = '';
191
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
191
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
192 192
 }
193 193
 
194 194
 function bigbluebuttonbn_view_bbbsession_roles($context, $userid) {
@@ -245,10 +245,10 @@  discard block
 block discarded – undo
245 245
     $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true);
246 246
 
247 247
     // Assign group default values.
248
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
249
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
248
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
249
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
250 250
     $groupname = get_string('allparticipants');
251
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
251
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
252 252
 
253 253
     if (count($groups) == 0) {
254 254
         // Only the All participants group exists.
@@ -259,10 +259,10 @@  discard block
 block discarded – undo
259 259
         $bbbsession['group'] = array_values($groups)[0]->id;
260 260
     }
261 261
 
262
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
263
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
262
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
263
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
264 264
     $groupname = groups_get_group_name($bbbsession['group']);
265
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
265
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
266 266
 
267 267
     if (count($groups) == 1) {
268 268
         // There only one group and the user has access to.
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
     }
271 271
 
272 272
     echo $OUTPUT->box_start('generalbox boxaligncenter');
273
-    echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').
273
+    echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') .
274 274
       '</div>';
275 275
     echo $OUTPUT->box_end();
276 276
 
277 277
     groups_print_activity_menu(
278
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id);
278
+      $bbbsession['cm'], $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id);
279 279
     echo '<br><br>';
280 280
 }
281 281
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
             'M.mod_bigbluebuttonbn.recordings.init', array($jsvars));
318 318
     }
319 319
 
320
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
320
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
321 321
 
322 322
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
323 323
 }
@@ -328,12 +328,12 @@  discard block
 block discarded – undo
328 328
     // JavaScript variables for room.
329 329
     $openingtime = '';
330 330
     if ($bbbsession['openingtime']) {
331
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
331
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
332 332
             userdate($bbbsession['openingtime']);
333 333
     }
334 334
     $closingtime = '';
335 335
     if ($bbbsession['closingtime']) {
336
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
336
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
337 337
             userdate($bbbsession['closingtime']);
338 338
     }
339 339
     $jsvars += array(
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     $output .= $OUTPUT->box_end();
351 351
 
352 352
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
353
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
353
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
354 354
     $output .= $OUTPUT->box_end();
355 355
 
356 356
     if ($activity == 'ended') {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 
377 377
     // Get recordings.
378 378
     $recordings = array();
379
-    if ( bigbluebuttonbn_view_include_recordings($bbbsession) ) {
379
+    if (bigbluebuttonbn_view_include_recordings($bbbsession)) {
380 380
         $recordings = bigbluebuttonbn_get_recordings(
381 381
             $bbbsession['course']->id, $bigbluebuttonbnid, $showroom,
382 382
             $bbbsession['bigbluebuttonbn']->recordings_deleted
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
     // If there are meetings with recordings load the data to the table.
408 408
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
409 409
         // Render a plain html table.
410
-        return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n";
410
+        return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n";
411 411
     }
412 412
 
413 413
     // JavaScript variables for recordings with YUI.
@@ -427,8 +427,8 @@  discard block
 block discarded – undo
427 427
         array('type' => 'button',
428 428
               'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
429 429
               'class' => 'btn btn-secondary',
430
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
431
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
430
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
431
+                  $bbbsession['bigbluebuttonbn']->id . '\''));
432 432
     $output = html_writer::start_tag('br');
433 433
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
434 434
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -443,10 +443,10 @@  discard block
 block discarded – undo
443 443
         $attributes = array('title' => $bbbsession['presentation']['name']);
444 444
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
445 445
 
446
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
447
-                ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
448
-                ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
449
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
446
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
447
+                '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' .
448
+                '' . $OUTPUT->action_link($bbbsession['presentation']['url'],
449
+                      $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
450 450
     }
451 451
 
452 452
     return '';
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
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
 
197 197
 function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession, $bigbluebuttonbn) {
198 198
     $data = ['meetingID' => $bbbsession['meetingid'],
199
-              'name' => $bbbsession['meetingname'],
200
-              'attendeePW' => $bbbsession['viewerPW'],
201
-              'moderatorPW' => $bbbsession['modPW'],
202
-              'logoutURL' => $bbbsession['logoutURL'],
199
+                'name' => $bbbsession['meetingname'],
200
+                'attendeePW' => $bbbsession['viewerPW'],
201
+                'moderatorPW' => $bbbsession['modPW'],
202
+                'logoutURL' => $bbbsession['logoutURL'],
203 203
             ];
204 204
 
205 205
     $data['record'] = 'false';
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             '%duration%',
225 225
             (string) $durationtime,
226 226
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
227
-          );
227
+            );
228 228
     }
229 229
 
230 230
     $voicebridge = intval($bbbsession['voicebridge']);
@@ -244,14 +244,14 @@  discard block
 block discarded – undo
244 244
     global $USER;
245 245
 
246 246
     $metadata = ['bbb-origin' => $bbbsession['origin'],
247
-                 'bbb-origin-version' => $bbbsession['originVersion'],
248
-                 'bbb-origin-server-name' => $bbbsession['originServerName'],
249
-                 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
250
-                 'bbb-origin-tag' => $bbbsession['originTag'],
251
-                 'bbb-context' => $bbbsession['course']->fullname,
252
-                 'bbb-recording-name' => $bbbsession['meetingname'],
253
-                 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
254
-                 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
247
+                    'bbb-origin-version' => $bbbsession['originVersion'],
248
+                    'bbb-origin-server-name' => $bbbsession['originServerName'],
249
+                    'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
250
+                    'bbb-origin-tag' => $bbbsession['originTag'],
251
+                    'bbb-context' => $bbbsession['course']->fullname,
252
+                    'bbb-recording-name' => $bbbsession['meetingname'],
253
+                    'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
254
+                    'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
255 255
                 ];
256 256
 
257 257
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
             array(
260 260
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
261 261
                 'context' => $bbbsession['bigbluebuttonbnURL']
262
-              )
263
-          );
262
+                )
263
+            );
264 264
     }
265 265
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
266 266
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
Please login to merge, or discard this patch.
Switch Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -61,108 +61,108 @@
 block discarded – undo
61 61
 }
62 62
 
63 63
 switch (strtolower($action)) {
64
-    case 'logout':
65
-        if (isset($errors) && $errors != '') {
66
-            bigbluebutton_bbb_view_errors($errors, $id);
67
-            break;
68
-        }
69
-
70
-        if (is_null($bbbsession)) {
71
-            bigbluebutton_bbb_view_close_window_manually();
72
-            break;
73
-        }
64
+        case 'logout':
65
+            if (isset($errors) && $errors != '') {
66
+                bigbluebutton_bbb_view_errors($errors, $id);
67
+                break;
68
+            }
74 69
 
75
-        // Moodle event logger: Create an event for meeting left.
76
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
70
+            if (is_null($bbbsession)) {
71
+                bigbluebutton_bbb_view_close_window_manually();
72
+                break;
73
+            }
77 74
 
78
-        // Update the cache.
79
-        $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
75
+            // Moodle event logger: Create an event for meeting left.
76
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
80 77
 
81
-        // Close the tab or window where BBB was opened.
82
-        bigbluebutton_bbb_view_close_window();
83
-        break;
84
-    case 'join':
85
-        if (is_null($bbbsession)) {
86
-            print_error('view_error_unable_join', 'bigbluebuttonbn');
87
-            break;
88
-        }
78
+            // Update the cache.
79
+            $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
89 80
 
90
-        // See if the session is in progress.
91
-        if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
92
-            // Since the meeting is already running, we just join the session.
93
-            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
81
+            // Close the tab or window where BBB was opened.
82
+            bigbluebutton_bbb_view_close_window();
94 83
             break;
95
-        }
84
+        case 'join':
85
+            if (is_null($bbbsession)) {
86
+                print_error('view_error_unable_join', 'bigbluebuttonbn');
87
+                break;
88
+            }
96 89
 
97
-        // If user is not administrator nor moderator (user is steudent) and waiting is required.
98
-        if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
99
-            header('Location: '.$bbbsession['logoutURL']);
100
-            break;
101
-        }
90
+            // See if the session is in progress.
91
+            if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
92
+                // Since the meeting is already running, we just join the session.
93
+                bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
94
+                break;
95
+            }
102 96
 
103
-        // As the meeting doesn't exist, try to create it.
104
-        $response = bigbluebuttonbn_get_create_meeting_array(
105
-            bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
106
-            bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
107
-            $bbbsession['presentation']['name'],
108
-            $bbbsession['presentation']['url']
109
-        );
110
-
111
-        if (!$response) {
112
-            // The server is unreachable.
113
-            if ($bbbsession['administrator']) {
114
-                print_error('view_error_unable_join', 'bigbluebuttonbn',
115
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
97
+            // If user is not administrator nor moderator (user is steudent) and waiting is required.
98
+            if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
99
+                header('Location: '.$bbbsession['logoutURL']);
116 100
                 break;
117 101
             }
118
-            if ($bbbsession['moderator']) {
119
-                print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
102
+
103
+            // As the meeting doesn't exist, try to create it.
104
+            $response = bigbluebuttonbn_get_create_meeting_array(
105
+                bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
106
+                bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
107
+                $bbbsession['presentation']['name'],
108
+                $bbbsession['presentation']['url']
109
+            );
110
+
111
+            if (!$response) {
112
+                // The server is unreachable.
113
+                if ($bbbsession['administrator']) {
114
+                    print_error('view_error_unable_join', 'bigbluebuttonbn',
115
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
116
+                    break;
117
+                }
118
+                if ($bbbsession['moderator']) {
119
+                    print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
120
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
121
+                    break;
122
+                }
123
+
124
+                print_error('view_error_unable_join_student', 'bigbluebuttonbn',
120 125
                     $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
121 126
                 break;
122 127
             }
123 128
 
124
-            print_error('view_error_unable_join_student', 'bigbluebuttonbn',
125
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
126
-            break;
127
-        }
129
+            if ($response['returncode'] == 'FAILED') {
130
+                // The meeting was not created.
131
+                if (!$printerrorkey) {
132
+                    print_error($response['message'], 'bigbluebuttonbn');
133
+                    break;
134
+                }
135
+                $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
136
+                print_error($printerrorkey, 'bigbluebuttonbn');
137
+                break;
138
+            }
128 139
 
129
-        if ($response['returncode'] == 'FAILED') {
130
-            // The meeting was not created.
131
-            if (!$printerrorkey) {
132
-                print_error($response['message'], 'bigbluebuttonbn');
140
+            if ($response['hasBeenForciblyEnded'] == 'true') {
141
+                print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
133 142
                 break;
134 143
             }
135
-            $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
136
-            print_error($printerrorkey, 'bigbluebuttonbn');
137
-            break;
138
-        }
139 144
 
140
-        if ($response['hasBeenForciblyEnded'] == 'true') {
141
-            print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
145
+            // Moodle event logger: Create an event for meeting created.
146
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
147
+            // Internal logger: Insert a record with the meeting created.
148
+            bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
149
+            // Since the meeting is already running, we just join the session.
150
+            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
142 151
             break;
143
-        }
152
+        case 'playback':
153
+            $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
154
+            if ($href == '') {
155
+                bigbluebutton_bbb_view_close_window();
156
+                return;
157
+            }
144 158
 
145
-        // Moodle event logger: Create an event for meeting created.
146
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
147
-        // Internal logger: Insert a record with the meeting created.
148
-        bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
149
-        // Since the meeting is already running, we just join the session.
150
-        bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
151
-        break;
152
-    case 'playback':
153
-        $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
154
-        if ($href == '') {
159
+            // Moodle event logger: Create an event for meeting left.
160
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
161
+            // Execute the redirect.
162
+            header('Location: '.urldecode($href));
163
+            break;
164
+        default:
155 165
             bigbluebutton_bbb_view_close_window();
156
-            return;
157
-        }
158
-
159
-        // Moodle event logger: Create an event for meeting left.
160
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
161
-        // Execute the redirect.
162
-        header('Location: '.urldecode($href));
163
-        break;
164
-    default:
165
-        bigbluebutton_bbb_view_close_window();
166 166
 }
167 167
 
168 168
 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);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
98 98
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
99
-            header('Location: '.$bbbsession['logoutURL']);
99
+            header('Location: ' . $bbbsession['logoutURL']);
100 100
             break;
101 101
         }
102 102
 
@@ -112,17 +112,17 @@  discard block
 block discarded – undo
112 112
             // The server is unreachable.
113 113
             if ($bbbsession['administrator']) {
114 114
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
115
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
115
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
116 116
                 break;
117 117
             }
118 118
             if ($bbbsession['moderator']) {
119 119
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
120
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
120
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
121 121
                 break;
122 122
             }
123 123
 
124 124
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
125
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
125
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
126 126
             break;
127 127
         }
128 128
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         // Moodle event logger: Create an event for meeting left.
160 160
         bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
161 161
         // Execute the redirect.
162
-        header('Location: '.urldecode($href));
162
+        header('Location: ' . urldecode($href));
163 163
         break;
164 164
     default:
165 165
         bigbluebutton_bbb_view_close_window();
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         $data['welcome'] .= '<br><br>';
223 223
         $data['welcome'] .= str_replace(
224 224
             '%duration%',
225
-            (string) $durationtime,
225
+            (string)$durationtime,
226 226
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
227 227
           );
228 228
     }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
280 280
         // No more users allowed to join.
281
-        header('Location: '.$bbbsession['logoutURL']);
281
+        header('Location: ' . $bbbsession['logoutURL']);
282 282
         return;
283 283
     }
284 284
 
@@ -297,20 +297,20 @@  discard block
 block discarded – undo
297 297
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
298 298
         ($bbbsession['administrator'] || $bbbsession['moderator']));
299 299
     // Execute the redirect.
300
-    header('Location: '.$joinurl);
300
+    header('Location: ' . $joinurl);
301 301
 }
302 302
 
303 303
 function bigbluebutton_bbb_view_errors($serrors, $id) {
304 304
     global $CFG, $OUTPUT;
305 305
 
306
-    $errors = (array) json_decode(urldecode($serrors));
306
+    $errors = (array)json_decode(urldecode($serrors));
307 307
     $msgerrors = '';
308 308
     foreach ($errors as $error) {
309
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
309
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
310 310
     }
311 311
 
312 312
     echo $OUTPUT->header();
313 313
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
314
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
314
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
315 315
     echo $OUTPUT->footer();
316 316
 }
Please login to merge, or discard this patch.
classes/locallib/notifier.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         global $USER;
35 35
 
36 36
         // Prepare message.
37
-        $msg = (object) array();
37
+        $msg = (object)array();
38 38
         // Build the message_body.
39 39
         $msg->action = $action;
40 40
         $msg->activity_type = '';
@@ -54,26 +54,26 @@  discard block
 block discarded – undo
54 54
     }
55 55
 
56 56
     public static function notification_msg_html($msg) {
57
-        $messagetext = '<p>'.$msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
58
-            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
59
-        $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.
60
-            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
61
-        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
62
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
63
-            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
64
-        $messagetext .= $msg->activity_title.'</td></tr>'."\n";
65
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
66
-            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
67
-        $messagetext .= $msg->activity_description.'</td></tr>'."\n";
68
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
69
-            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
70
-        $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";
71
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
72
-            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
73
-        $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";
74
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.
75
-            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
76
-        $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
57
+        $messagetext = '<p>' . $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
58
+            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
59
+        $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .
60
+            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
61
+        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
62
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
63
+            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
64
+        $messagetext .= $msg->activity_title . '</td></tr>' . "\n";
65
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
66
+            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
67
+        $messagetext .= $msg->activity_description . '</td></tr>' . "\n";
68
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
69
+            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
70
+        $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";
71
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
72
+            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
73
+        $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";
74
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .
75
+            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
76
+        $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
77 77
         return $messagetext;
78 78
     }
79 79
 
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
         $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
84 84
 
85 85
         // Complete message.
86
-        $msg = (object) array();
86
+        $msg = (object)array();
87 87
         $msg->user_name = fullname($sender);
88 88
         $msg->user_email = $sender->email;
89 89
         $msg->course_name = "$course->fullname";
90
-        $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.
91
-            $msg->user_name.'('.$msg->user_email.') ';
92
-        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
90
+        $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' .
91
+            $msg->user_name . '(' . $msg->user_email . ') ';
92
+        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
93 93
 
94
-        $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
94
+        $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
95 95
         foreach ($users as $user) {
96 96
             if ($user->id != $sender->id) {
97 97
                 message_post_message($sender, $user, $message, FORMAT_HTML);
Please login to merge, or discard this patch.
locallib.php 2 patches
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
  */
99 99
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
100 100
     $data = ['meetingID' => $meetingid,
101
-              'fullName' => $username,
102
-              'password' => $pw,
103
-              'logoutURL' => $logouturl,
101
+                'fullName' => $username,
102
+                'password' => $pw,
103
+                'logoutURL' => $logouturl,
104 104
             ];
105 105
 
106 106
     if (!is_null($configtoken)) {
@@ -201,24 +201,24 @@  discard block
 block discarded – undo
201 201
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
202 202
     $xml = bigbluebuttonbn_wrap_xml_load_file(
203 203
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
204
-      );
204
+        );
205 205
 
206 206
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
207 207
         // Meeting info was returned.
208 208
         return array('returncode' => $xml->returncode,
209
-                     'meetingID' => $xml->meetingID,
210
-                     'moderatorPW' => $xml->moderatorPW,
211
-                     'attendeePW' => $xml->attendeePW,
212
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
213
-                     'running' => $xml->running,
214
-                     'recording' => $xml->recording,
215
-                     'startTime' => $xml->startTime,
216
-                     'endTime' => $xml->endTime,
217
-                     'participantCount' => $xml->participantCount,
218
-                     'moderatorCount' => $xml->moderatorCount,
219
-                     'attendees' => $xml->attendees,
220
-                     'metadata' => $xml->metadata,
221
-                   );
209
+                        'meetingID' => $xml->meetingID,
210
+                        'moderatorPW' => $xml->moderatorPW,
211
+                        'attendeePW' => $xml->attendeePW,
212
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
213
+                        'running' => $xml->running,
214
+                        'recording' => $xml->recording,
215
+                        'startTime' => $xml->startTime,
216
+                        'endTime' => $xml->endTime,
217
+                        'participantCount' => $xml->participantCount,
218
+                        'moderatorCount' => $xml->moderatorCount,
219
+                        'attendees' => $xml->attendees,
220
+                        'metadata' => $xml->metadata,
221
+                    );
222 222
     }
223 223
 
224 224
     if ($xml) {
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         // Do getRecordings is executed using a method GET (supported by all versions of BBB).
283 283
         $xml = bigbluebuttonbn_wrap_xml_load_file(
284 284
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getRecordings', ['meetingID' => implode(',', $mids)])
285
-          );
285
+            );
286 286
         if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
287 287
             // If there were meetings already created.
288 288
             foreach ($xml->recordings->recording as $recording) {
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 function bigbluebuttonbn_get_default_config_xml() {
349 349
     $xml = bigbluebuttonbn_wrap_xml_load_file(
350 350
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
351
-      );
351
+        );
352 352
 
353 353
     return $xml;
354 354
 }
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
     foreach ($ids as $id) {
421 421
         $xml = bigbluebuttonbn_wrap_xml_load_file(
422 422
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
423
-          );
423
+            );
424 424
         if ($xml && $xml->returncode != 'SUCCESS') {
425 425
             return false;
426 426
         }
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
     foreach ($ids as $id) {
439 439
         $xml = bigbluebuttonbn_wrap_xml_load_file(
440 440
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
441
-          );
441
+            );
442 442
         if ($xml && $xml->returncode != 'SUCCESS') {
443 443
             return false;
444 444
         }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
     foreach ($ids as $id) {
457 457
         $xml = bigbluebuttonbn_wrap_xml_load_file(
458 458
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
459
-          );
459
+            );
460 460
         if ($xml && $xml->returncode != 'SUCCESS') {
461 461
             return false;
462 462
         }
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
473 473
     $xml = bigbluebuttonbn_wrap_xml_load_file(
474 474
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
475
-      );
475
+        );
476 476
 
477 477
     if ($xml) {
478 478
         // If the xml packet returned failure it displays the message to the user.
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 function bigbluebuttonbn_is_meeting_running($meetingid) {
490 490
     $xml = bigbluebuttonbn_wrap_xml_load_file(
491 491
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('isMeetingRunning', ['meetingID' => $meetingid])
492
-      );
492
+        );
493 493
 
494 494
     if ($xml && $xml->returncode == 'SUCCESS') {
495 495
         return ($xml->running == 'true');
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 function bigbluebuttonbn_get_server_version() {
502 502
     $xml = bigbluebuttonbn_wrap_xml_load_file(
503 503
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
504
-      );
504
+        );
505 505
 
506 506
     if ($xml && $xml->returncode == 'SUCCESS') {
507 507
         return $xml->version;
@@ -562,10 +562,10 @@  discard block
 block discarded – undo
562 562
 
563 563
         $options = array();
564 564
         $options['CURLOPT_HTTPHEADER'] = array(
565
-                 'Content-Type: '.$contenttype,
566
-                 'Content-Length: '.strlen($data),
567
-                 'Content-Language: en-US',
568
-               );
565
+                    'Content-Type: '.$contenttype,
566
+                    'Content-Length: '.strlen($data),
567
+                    'Content-Language: en-US',
568
+                );
569 569
 
570 570
         return $c->post($url, $data, $options);
571 571
     }
@@ -640,13 +640,13 @@  discard block
 block discarded – undo
640 640
 
641 641
 function bigbluebuttonbn_role_unknown() {
642 642
     return array(
643
-              "id" => "0",
644
-              "name" => "",
645
-              "shortname" => "unknown",
646
-              "description" => "",
647
-              "sortorder" => "0",
648
-              "archetype" => "guest",
649
-              "localname" => "Unknown"
643
+                "id" => "0",
644
+                "name" => "",
645
+                "shortname" => "unknown",
646
+                "description" => "",
647
+                "sortorder" => "0",
648
+                "archetype" => "guest",
649
+                "localname" => "Unknown"
650 650
             );
651 651
 }
652 652
 
@@ -655,16 +655,16 @@  discard block
 block discarded – undo
655 655
         'all' => array(
656 656
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
657 657
             'children' => []
658
-          )
659
-      );
658
+            )
659
+        );
660 660
     $data['role'] = array(
661 661
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
662 662
         'children' => bigbluebuttonbn_get_roles_select($context)
663
-      );
663
+        );
664 664
     $data['user'] = array(
665 665
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
666 666
         'children' => bigbluebuttonbn_get_users_select($context)
667
-      );
667
+        );
668 668
     return $data;
669 669
 }
670 670
 
@@ -714,9 +714,9 @@  discard block
 block discarded – undo
714 714
             continue;
715 715
         }
716 716
         $participantlistarray[] = array(
717
-              'selectiontype' => 'role',
718
-              'selectionid' => $moderatordefault,
719
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
717
+                'selectiontype' => 'role',
718
+                'selectionid' => $moderatordefault,
719
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
720 720
     }
721 721
     return $participantlistarray;
722 722
 }
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
728 728
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
729 729
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
730
-          ],
730
+            ],
731 731
         'type_selected' => 'all',
732 732
         'options' => ['all' => '---------------'],
733 733
         'selected' => 'all',
734
-      ];
734
+        ];
735 735
 }
736 736
 
737 737
 function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) {
@@ -853,8 +853,8 @@  discard block
 block discarded – undo
853 853
         }
854 854
     }
855 855
     $parray = array('url' => $purl, 'name' => $pname,
856
-                               'icon' => $picon,
857
-                               'mimetype_description' => $pmimetypedescrip);
856
+                                'icon' => $picon,
857
+                                'mimetype_description' => $pmimetypedescrip);
858 858
     return $parray;
859 859
 }
860 860
 
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
         $eventproperties['other'] = $options['other'];
929 929
     }
930 930
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
931
-      array($eventproperties));
931
+        array($eventproperties));
932 932
     $event->trigger();
933 933
 }
934 934
 
@@ -973,7 +973,7 @@  discard block
 block discarded – undo
973 973
     // Ping again and refresh the cache.
974 974
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
975 975
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
976
-      );
976
+        );
977 977
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
978 978
     return $meetinginfo;
979 979
 }
@@ -1209,8 +1209,8 @@  discard block
 block discarded – undo
1209 1209
     }
1210 1210
     $id = 'playbacks-'.$recording['recordID'];
1211 1211
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1212
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1213
-          'title' => $title, $visibility => $visibility));
1212
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1213
+            'title' => $title, $visibility => $visibility));
1214 1214
     foreach ($recording['playbacks'] as $playback) {
1215 1215
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid,
1216 1216
             $playback).'&#32;';
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
     $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1225 1225
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1226 1226
     $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid.
1227
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1227
+        '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1228 1228
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1229 1229
         $href .= '&href='.urlencode($playback['url']);
1230 1230
     }
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
             'onclick' => $onclick,
1327 1327
             'data-action' => $data['action'],
1328 1328
             'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID'])
1329
-          );
1329
+            );
1330 1330
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
1331 1331
     }
1332 1332
 
@@ -1443,7 +1443,7 @@  discard block
 block discarded – undo
1443 1443
         $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1444 1444
         $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1445 1445
         $rowdata->duration_formatted
1446
-      );
1446
+        );
1447 1447
     if ($bbbsession['managerecordings']) {
1448 1448
         $row->cells[] = $rowdata->actionbar;
1449 1449
     }
@@ -1708,8 +1708,8 @@  discard block
 block discarded – undo
1708 1708
     $activitytime = '';
1709 1709
     if ($time) {
1710 1710
         $activitytime = calendar_day_representation($time).' '.
1711
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1712
-          calendar_time_representation($time);
1711
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1712
+            calendar_time_representation($time);
1713 1713
     }
1714 1714
 
1715 1715
     return $activitytime;
Please login to merge, or discard this patch.
Spacing   +98 added lines, -98 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
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     if (isset($meta)) {
83 83
         $log->meta = $meta;
84 84
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
85
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
85
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
86 86
     }
87 87
 
88 88
     $DB->insert_record('bigbluebuttonbn_logs', $log);
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 
135 135
     if (!is_null($pname) && !is_null($purl)) {
136 136
         $method = BIGBLUEBUTTONBN_METHOD_POST;
137
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='".
138
-            $purl."' /></module></modules>";
137
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='" .
138
+            $purl . "' /></module></modules>";
139 139
     }
140 140
 
141 141
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                                 'moderatorPW' => $meeting->moderatorPW,
181 181
                                 'attendeePW' => $meeting->attendeePW,
182 182
                                 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded,
183
-                                'running' => $meeting->running, );
183
+                                'running' => $meeting->running,);
184 184
         }
185 185
 
186 186
         return $meetings;
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
         // Override imported flag with actual ID.
338 338
         $recording['imported'] = $recordimported->id;
339 339
         if (isset($recordimported->protected)) {
340
-            $recording['protected'] = (string) $recordimported->protected;
340
+            $recording['protected'] = (string)$recordimported->protected;
341 341
         }
342 342
         $recordsimportedarray[$recording['recordID']] = $recording;
343 343
     }
@@ -356,37 +356,37 @@  discard block
 block discarded – undo
356 356
 function bigbluebuttonbn_get_default_config_xml_array() {
357 357
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
358 358
 
359
-    return (array) $defaultconfigxml;
359
+    return (array)$defaultconfigxml;
360 360
 }
361 361
 
362 362
 function bigbluebuttonbn_get_recording_array_value($recording) {
363 363
     // Add formats.
364 364
     $playbackarray = array();
365 365
     foreach ($recording->playback->format as $format) {
366
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
367
-            'url' => (string) $format->url, 'length' => (string) $format->length);
366
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
367
+            'url' => (string)$format->url, 'length' => (string)$format->length);
368 368
         // Add preview per format when existing.
369 369
         if ($format->preview) {
370 370
             $imagesarray = array();
371 371
             foreach ($format->preview->images->image as $image) {
372
-                $imagearray = array('url' => (string) $image);
372
+                $imagearray = array('url' => (string)$image);
373 373
                 foreach ($image->attributes() as $attkey => $attvalue) {
374
-                    $imagearray[$attkey] = (string) $attvalue;
374
+                    $imagearray[$attkey] = (string)$attvalue;
375 375
                 }
376 376
                 array_push($imagesarray, $imagearray);
377 377
             }
378
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
378
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
379 379
         }
380 380
     }
381 381
 
382 382
     // Add the metadata to the recordings array.
383 383
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
384
-    $recordingarray = array('recordID' => (string) $recording->recordID,
385
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
386
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
387
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
384
+    $recordingarray = array('recordID' => (string)$recording->recordID,
385
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
386
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
387
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
388 388
     if (isset($recording->protected)) {
389
-        $recordingarray['protected'] = (string) $recording->protected;
389
+        $recordingarray['protected'] = (string)$recording->protected;
390 390
     }
391 391
     return $recordingarray + $metadataarray;
392 392
 }
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
         if (is_object($value)) {
398 398
             $value = '';
399 399
         }
400
-        $metadataarray['meta_'.$key] = $value;
400
+        $metadataarray['meta_' . $key] = $value;
401 401
     }
402 402
     return $metadataarray;
403 403
 }
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
     $ids = explode(',', $recordids);
456 456
     foreach ($ids as $id) {
457 457
         $xml = bigbluebuttonbn_wrap_xml_load_file(
458
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
458
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
459 459
           );
460 460
         if ($xml && $xml->returncode != 'SUCCESS') {
461 461
             return false;
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
             return $xml;
533 533
         } catch (Exception $e) {
534 534
             libxml_use_internal_errors($previous);
535
-            $error = 'Caught exception: '.$e->getMessage();
535
+            $error = 'Caught exception: ' . $e->getMessage();
536 536
             debugging($error, DEBUG_DEVELOPER);
537 537
             return null;
538 538
         }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
545 545
         return $response;
546 546
     } catch (Exception $e) {
547
-        $error = 'Caught exception: '.$e->getMessage();
547
+        $error = 'Caught exception: ' . $e->getMessage();
548 548
         debugging($error, DEBUG_DEVELOPER);
549 549
         libxml_use_internal_errors($previous);
550 550
         return null;
@@ -562,8 +562,8 @@  discard block
 block discarded – undo
562 562
 
563 563
         $options = array();
564 564
         $options['CURLOPT_HTTPHEADER'] = array(
565
-                 'Content-Type: '.$contenttype,
566
-                 'Content-Length: '.strlen($data),
565
+                 'Content-Type: ' . $contenttype,
566
+                 'Content-Length: ' . strlen($data),
567 567
                  'Content-Language: en-US',
568 568
                );
569 569
 
@@ -580,9 +580,9 @@  discard block
 block discarded – undo
580 580
     if ($userroles) {
581 581
         $where = '';
582 582
         foreach ($userroles as $value) {
583
-            $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid;
583
+            $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid;
584 584
         }
585
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
585
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
586 586
     }
587 587
 
588 588
     return $userroles;
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 }
596 596
 
597 597
 function bigbluebuttonbn_get_users(context $context = null) {
598
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
598
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
599 599
     foreach ($users as $key => $value) {
600 600
         $users[$key] = fullname($value);
601 601
     }
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 }
604 604
 
605 605
 function bigbluebuttonbn_get_users_select(context $context = null) {
606
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
606
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
607 607
     foreach ($users as $key => $value) {
608 608
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
609 609
     }
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 }
612 612
 
613 613
 function bigbluebuttonbn_get_roles(context $context = null) {
614
-    $roles = (array) role_get_names($context);
614
+    $roles = (array)role_get_names($context);
615 615
     foreach ($roles as $key => $value) {
616 616
         $roles[$key] = $value->localname;
617 617
     }
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 }
620 620
 
621 621
 function bigbluebuttonbn_get_roles_select(context $context = null) {
622
-    $roles = (array) role_get_names($context);
622
+    $roles = (array)role_get_names($context);
623 623
     foreach ($roles as $key => $value) {
624 624
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
625 625
     }
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 }
628 628
 
629 629
 function bigbluebuttonbn_get_role($id) {
630
-    $roles = (array) role_get_names();
630
+    $roles = (array)role_get_names();
631 631
     if (is_numeric($id)) {
632 632
         return (object)$roles[$id];
633 633
     }
@@ -681,11 +681,11 @@  discard block
 block discarded – undo
681 681
         return array();
682 682
     }
683 683
     foreach ($rules as $key => $rule) {
684
-        if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) {
684
+        if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) {
685 685
             continue;
686 686
         }
687 687
         $role = bigbluebuttonbn_get_role($rule['selectionid']);
688
-        if ( $role == null ) {
688
+        if ($role == null) {
689 689
             unset($rules[$key]);
690 690
             continue;
691 691
         }
@@ -750,10 +750,10 @@  discard block
 block discarded – undo
750 750
     if (empty($userroles)) {
751 751
         $userroles = get_user_roles($context, $userid, true);
752 752
     }
753
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
753
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
754 754
 }
755 755
 
756
-function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) {
756
+function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) {
757 757
     // Iterate participant rules.
758 758
     foreach ($participantlist as $participant) {
759 759
         if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) {
@@ -798,9 +798,9 @@  discard block
 block discarded – undo
798 798
     $isunique = true;
799 799
     if ($voicebridge != 0) {
800 800
         $table = 'bigbluebuttonbn';
801
-        $select = 'voicebridge = '.$voicebridge;
801
+        $select = 'voicebridge = ' . $voicebridge;
802 802
         if ($id) {
803
-            $select .= ' AND id <> '.$id;
803
+            $select .= ' AND id <> ' . $id;
804 804
         }
805 805
         if ($DB->get_records_select($table, $select)) {
806 806
             $isunique = false;
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 function bigbluebuttonbn_generate_nonce() {
862 862
     $mt = microtime();
863 863
     $rand = mt_rand();
864
-    return md5($mt.$rand);
864
+    return md5($mt . $rand);
865 865
 }
866 866
 
867 867
 function bigbluebuttonbn_random_password($length = 8) {
@@ -872,41 +872,41 @@  discard block
 block discarded – undo
872 872
 
873 873
 function bigbluebuttonbn_events() {
874 874
     return array(
875
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
876
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
877
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
878
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
879
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
880
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
881
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
882
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
883
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
884
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
885
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
886
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
887
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
888
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
889
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
875
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
876
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
877
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
878
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
879
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
880
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
881
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
882
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
883
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
884
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
885
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
886
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
887
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
888
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
889
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
890 890
     );
891 891
 }
892 892
 
893 893
 function bigbluebuttonbn_events_action() {
894 894
     return array(
895
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
896
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
897
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
898
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
899
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
900
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
901
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
902
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
903
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
904
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
905
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
906
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
907
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
908
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
909
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
895
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
896
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
897
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
898
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
899
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
900
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
901
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
902
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
903
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
904
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
905
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
906
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
907
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
908
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
909
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
910 910
     );
911 911
 }
912 912
 
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
     if (array_key_exists('other', $options)) {
928 928
         $eventproperties['other'] = $options['other'];
929 929
     }
930
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
930
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
931 931
       array($eventproperties));
932 932
     $event->trigger();
933 933
 }
@@ -968,10 +968,10 @@  discard block
 block discarded – undo
968 968
     $now = time();
969 969
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
970 970
         // Use the value in the cache.
971
-        return (array) json_decode($result['meeting_info']);
971
+        return (array)json_decode($result['meeting_info']);
972 972
     }
973 973
     // Ping again and refresh the cache.
974
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
974
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
975 975
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
976 976
       );
977 977
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1046,8 +1046,8 @@  discard block
 block discarded – undo
1046 1046
  * @param string $configxml
1047 1047
  */
1048 1048
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1049
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1050
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1049
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1050
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1051 1051
     return $configxmlparams;
1052 1052
 }
1053 1053
 
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
  * @param string $configxml
1057 1057
  */
1058 1058
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1059
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1059
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1060 1060
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1061 1061
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
1062 1062
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
  */
1070 1070
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1071 1071
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1072
-    $configxmlarray = (array) $configxml;
1072
+    $configxmlarray = (array)$configxml;
1073 1073
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1074 1074
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1075 1075
         return '';
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
     global $USER;
1120 1120
     $starttime = $starttime - ($starttime % 1000);
1121 1121
     // Set formatted date.
1122
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1122
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1123 1123
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1124 1124
 }
1125 1125
 
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) {
1136 1136
     $actionbar = '';
1137 1137
     foreach ($tools as $tool) {
1138
-        if ( $tool == 'protect' && !isset($recording['protected']) ) {
1138
+        if ($tool == 'protect' && !isset($recording['protected'])) {
1139 1139
             continue;
1140 1140
         }
1141 1141
         $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool);
@@ -1179,7 +1179,7 @@  discard block
 block discarded – undo
1179 1179
         $visibility = 'hidden ';
1180 1180
     }
1181 1181
     $recordingpreview = html_writer::start_tag('div',
1182
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1182
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1183 1183
     foreach ($recording['playbacks'] as $playback) {
1184 1184
         if (isset($playback['preview'])) {
1185 1185
             foreach ($playback['preview'] as $image) {
@@ -1207,13 +1207,13 @@  discard block
 block discarded – undo
1207 1207
     if ($recording['published'] === 'false') {
1208 1208
         $visibility = 'hidden ';
1209 1209
     }
1210
-    $id = 'playbacks-'.$recording['recordID'];
1210
+    $id = 'playbacks-' . $recording['recordID'];
1211 1211
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1212 1212
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1213 1213
           'title' => $title, $visibility => $visibility));
1214 1214
     foreach ($recording['playbacks'] as $playback) {
1215 1215
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid,
1216
-            $playback).'&#32;';
1216
+            $playback) . '&#32;';
1217 1217
     }
1218 1218
     $recordingtypes .= html_writer::end_tag('div');
1219 1219
     return $recordingtypes;
@@ -1221,12 +1221,12 @@  discard block
 block discarded – undo
1221 1221
 
1222 1222
 function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) {
1223 1223
     global $CFG, $OUTPUT;
1224
-    $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1224
+    $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1225 1225
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1226
-    $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid.
1227
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1226
+    $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn=' . $bigbluebuttonbnid .
1227
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1228 1228
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1229
-        $href .= '&href='.urlencode($playback['url']);
1229
+        $href .= '&href=' . urlencode($playback['url']);
1230 1230
     }
1231 1231
     $linkattributes = array('title' => $title,
1232 1232
         'class' => 'btn btn-sm btn-default', 'onclick' => $onclick,
@@ -1314,11 +1314,11 @@  discard block
 block discarded – undo
1314 1314
         $target .= '-' . $data['target'];
1315 1315
     }
1316 1316
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1317
-    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);';
1317
+    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);';
1318 1318
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1319 1319
         // With icon for $manageaction.
1320 1320
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1321
-        $icon = new pix_icon('i/'.$data['tag'],
1321
+        $icon = new pix_icon('i/' . $data['tag'],
1322 1322
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1323 1323
             'moodle', $iconattributes);
1324 1324
         $linkattributes = array(
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
     if (isset($recordings) && !array_key_exists('messageKey', $recordings)) {
1410 1410
         // There are recordings for this meeting.
1411 1411
         foreach ($recordings as $recording) {
1412
-            if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) {
1412
+            if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
1413 1413
                 continue;
1414 1414
             }
1415 1415
             bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table);
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
     }
1428 1428
 
1429 1429
     $row = new html_table_row();
1430
-    $row->id = 'recording-td-'.$recording['recordID'];
1430
+    $row->id = 'recording-td-' . $recording['recordID'];
1431 1431
     $row->attributes['data-imported'] = 'false';
1432 1432
     $texthead = '';
1433 1433
     $texttail = '';
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
 }
1452 1452
 
1453 1453
 function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) {
1454
-    if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) {
1454
+    if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) {
1455 1455
         return true;
1456 1456
     }
1457 1457
     return false;
@@ -1466,9 +1466,9 @@  discard block
 block discarded – undo
1466 1466
     // Build the message_body.
1467 1467
     $msg->activity_type = '';
1468 1468
     $msg->activity_title = $bigbluebuttonbn->name;
1469
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1470
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1471
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1469
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1470
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1471
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1472 1472
 
1473 1473
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1474 1474
 }
@@ -1566,15 +1566,15 @@  discard block
 block discarded – undo
1566 1566
 
1567 1567
 function bigbluebuttonbn_get_recordings_sql_selectdeleted($courseid, $bigbluebuttonbnid = null, $subset = true) {
1568 1568
     if ($bigbluebuttonbnid === null) {
1569
-        return "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1569
+        return "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1570 1570
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1571 1571
     }
1572 1572
     if ($subset) {
1573
-        return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1573
+        return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1574 1574
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1575 1575
     }
1576
-    return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
1577
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1576
+    return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
1577
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1578 1578
 }
1579 1579
 
1580 1580
 function bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid = null, $subset = true,
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
 
1624 1624
     // Prepare select for loading records based on existent bigbluebuttonbns.
1625 1625
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
1626
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
1626
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
1627 1627
     // Include only Create events and exclude those with record not true.
1628 1628
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
1629 1629
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -1707,8 +1707,8 @@  discard block
 block discarded – undo
1707 1707
 function bigbluebuttonbn_format_activity_time($time) {
1708 1708
     $activitytime = '';
1709 1709
     if ($time) {
1710
-        $activitytime = calendar_day_representation($time).' '.
1711
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1710
+        $activitytime = calendar_day_representation($time) . ' ' .
1711
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
1712 1712
           calendar_time_representation($time);
1713 1713
     }
1714 1714
 
Please login to merge, or discard this patch.