Completed
Push — master ( 10847d...32c9ae )
by Jesus
03:00
created
db/upgrade.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -36,23 +36,23 @@  discard block
 block discarded – undo
36 36
 
37 37
         // Change welcome, allow null.
38 38
         $fielddefinition = array('type' => XMLDB_TYPE_TEXT,
39
-                                  'precision' => null,
40
-                                  'unsigned' => null,
41
-                                  'notnull' => XMLDB_NOTNULL,
42
-                                  'sequence' => null,
43
-                                  'default' => null,
44
-                                  'previous' => 'type');
39
+                                    'precision' => null,
40
+                                    'unsigned' => null,
41
+                                    'notnull' => XMLDB_NOTNULL,
42
+                                    'sequence' => null,
43
+                                    'default' => null,
44
+                                    'previous' => 'type');
45 45
         xmldb_bigbluebuttonbn_add_change_field($dbman, 'bigbluebuttonbn', 'welcome',
46 46
             $fielddefinition);
47 47
 
48 48
         // Change userid definition in bigbluebuttonbn_log.
49 49
         $fielddefinition = array('type' => XMLDB_TYPE_INTEGER,
50
-                                  'precision' => '10',
51
-                                  'unsigned' => null,
52
-                                  'notnull' => XMLDB_NOTNULL,
53
-                                  'sequence' => null,
54
-                                  'default' => null,
55
-                                  'previous' => 'bigbluebuttonbnid');
50
+                                    'precision' => '10',
51
+                                    'unsigned' => null,
52
+                                    'notnull' => XMLDB_NOTNULL,
53
+                                    'sequence' => null,
54
+                                    'default' => null,
55
+                                    'previous' => 'bigbluebuttonbnid');
56 56
         xmldb_bigbluebuttonbn_add_change_field($dbman, 'bigbluebuttonbn_log', 'userid',
57 57
             $fielddefinition);
58 58
 
@@ -78,34 +78,34 @@  discard block
 block discarded – undo
78 78
 
79 79
         // Add field type.
80 80
         $fielddefinition = array('type' => XMLDB_TYPE_INTEGER,
81
-                                  'precision' => '2',
82
-                                  'unsigned' => null,
83
-                                  'notnull' => XMLDB_NOTNULL,
84
-                                  'sequence' => null,
85
-                                  'default' => 0,
86
-                                  'previous' => 'id');
81
+                                    'precision' => '2',
82
+                                    'unsigned' => null,
83
+                                    'notnull' => XMLDB_NOTNULL,
84
+                                    'sequence' => null,
85
+                                    'default' => 0,
86
+                                    'previous' => 'id');
87 87
         xmldb_bigbluebuttonbn_add_change_field($dbman, 'bigbluebuttonbn', 'type',
88 88
             $fielddefinition);
89 89
 
90 90
         // Add field recordings_html.
91 91
         $fielddefinition = array('type' => XMLDB_TYPE_INTEGER,
92
-                                  'precision' => '1',
93
-                                  'unsigned' => null,
94
-                                  'notnull' => XMLDB_NOTNULL,
95
-                                  'sequence' => null,
96
-                                  'default' => 0,
97
-                                  'previous' => null);
92
+                                    'precision' => '1',
93
+                                    'unsigned' => null,
94
+                                    'notnull' => XMLDB_NOTNULL,
95
+                                    'sequence' => null,
96
+                                    'default' => 0,
97
+                                    'previous' => null);
98 98
         xmldb_bigbluebuttonbn_add_change_field($dbman, 'bigbluebuttonbn', 'recordings_html',
99 99
             $fielddefinition);
100 100
 
101 101
         // Add field recordings_deleted_activities.
102 102
         $fielddefinition = array('type' => XMLDB_TYPE_INTEGER,
103
-                                  'precision' => '1',
104
-                                  'unsigned' => null,
105
-                                  'notnull' => XMLDB_NOTNULL,
106
-                                  'sequence' => null,
107
-                                  'default' => 1,
108
-                                  'previous' => null);
103
+                                    'precision' => '1',
104
+                                    'unsigned' => null,
105
+                                    'notnull' => XMLDB_NOTNULL,
106
+                                    'sequence' => null,
107
+                                    'default' => 1,
108
+                                    'previous' => null);
109 109
         xmldb_bigbluebuttonbn_add_change_field($dbman, 'bigbluebuttonbn', 'recordings_deleted_activities',
110 110
             $fielddefinition);
111 111
 
@@ -122,12 +122,12 @@  discard block
 block discarded – undo
122 122
     $table = new xmldb_table($tablename);
123 123
     $field = new xmldb_field($fieldname);
124 124
     $field->set_attributes($fielddefinition['type'],
125
-                           $fielddefinition['precision'],
126
-                           $fielddefinition['unsigned'],
127
-                           $fielddefinition['notnull'],
128
-                           $fielddefinition['sequence'],
129
-                           $fielddefinition['default'],
130
-                           $fielddefinition['previous']);
125
+                            $fielddefinition['precision'],
126
+                            $fielddefinition['unsigned'],
127
+                            $fielddefinition['notnull'],
128
+                            $fielddefinition['sequence'],
129
+                            $fielddefinition['default'],
130
+                            $fielddefinition['previous']);
131 131
     if ($dbman->field_exists($table, $field)) {
132 132
         $dbman->change_field_type($table, $field, true, true);
133 133
         $dbman->change_field_precision($table, $field, true, true);
Please login to merge, or discard this patch.
view.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -272,11 +272,11 @@  discard block
 block discarded – undo
272 272
 
273 273
     echo $OUTPUT->box_start('generalbox boxaligncenter');
274 274
     echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').
275
-      '</div>';
275
+        '</div>';
276 276
     echo $OUTPUT->box_end();
277 277
 
278 278
     groups_print_activity_menu(
279
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id, false, $onlyexistentgroups);
279
+        $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id, false, $onlyexistentgroups);
280 280
     echo '<br><br>';
281 281
 }
282 282
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     // JavaScript variables for recordings.
389 389
     $jsvars += array(
390 390
             'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1',
391
-          );
391
+            );
392 392
 
393 393
     // If there are meetings with recordings load the data to the table.
394 394
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
     $jsvars += array(
401 401
             'columns' => bigbluebuttonbn_get_recording_columns($bbbsession),
402 402
             'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings),
403
-          );
403
+            );
404 404
 
405 405
     // Render a YUI table.
406 406
     return html_writer::div('', '', array('id' => 'bigbluebuttonbn_yui_table'));
@@ -411,10 +411,10 @@  discard block
 block discarded – undo
411 411
 
412 412
     $button = html_writer::tag('input', '',
413 413
         array('type' => 'button',
414
-              'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
415
-              'class' => 'btn btn-secondary',
416
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
417
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
414
+                'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
415
+                'class' => 'btn btn-secondary',
416
+                'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
417
+                    $bbbsession['bigbluebuttonbn']->id.'\''));
418 418
     $output = html_writer::start_tag('br');
419 419
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
420 420
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
         return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
433 433
                 ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
434 434
                 ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
435
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
435
+                        $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
436 436
     }
437 437
 
438 438
     return '';
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 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
 $b = optional_param('n', 0, PARAM_INT);
@@ -59,18 +59,18 @@  discard block
 block discarded – undo
59 59
 if (is_null($serverversion)) {
60 60
     if ($bbbsession['administrator']) {
61 61
         print_error('view_error_unable_join', 'bigbluebuttonbn',
62
-            $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
62
+            $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
63 63
         exit;
64 64
     }
65 65
 
66 66
     if ($bbbsession['moderator']) {
67 67
         print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
68
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
68
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
69 69
         exit;
70 70
     }
71 71
 
72 72
     print_error('view_error_unable_join_student', 'bigbluebuttonbn',
73
-        $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
73
+        $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
74 74
     exit;
75 75
 }
76 76
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 // Print the page header.
82 82
 $PAGE->set_context($context);
83
-$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
83
+$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
84 84
 $PAGE->set_title(format_string($bigbluebuttonbn->name));
85 85
 $PAGE->set_cacheable(false);
86 86
 $PAGE->set_heading($course->fullname);
@@ -90,26 +90,26 @@  discard block
 block discarded – undo
90 90
 if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) {
91 91
     echo $OUTPUT->header();
92 92
     if (isguestuser()) {
93
-        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
94
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
93
+        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
94
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
95 95
     } else {
96
-        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
97
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
96
+        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
97
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
98 98
     }
99 99
     echo $OUTPUT->footer();
100 100
     exit;
101 101
 }
102 102
 
103 103
 // Operation URLs.
104
-$bbbsession['courseURL'] = $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course;
105
-$bbbsession['logoutURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id.
106
-    '&bn='.$bbbsession['bigbluebuttonbn']->id;
107
-$bbbsession['recordingReadyURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=recording_'.
108
-    'ready&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id;
109
-$bbbsession['meetingEventsURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=meeting'.
110
-    '_events&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id;
111
-$bbbsession['joinURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=join&id='.$id.
112
-    '&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id;
104
+$bbbsession['courseURL'] = $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course;
105
+$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
106
+    '&bn=' . $bbbsession['bigbluebuttonbn']->id;
107
+$bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
108
+    'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
109
+$bbbsession['meetingEventsURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=meeting' .
110
+    '_events&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
111
+$bbbsession['joinURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=join&id=' . $id .
112
+    '&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
113 113
 
114 114
 // Output starts.
115 115
 echo $OUTPUT->header();
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 echo $OUTPUT->footer();
123 123
 
124 124
 // Shows version as a comment.
125
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
125
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
126 126
 
127 127
 // Initialize session variable used across views.
128 128
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass;
159 159
 
160 160
     // Database info related to the activity.
161
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
161
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
162 162
         $bbbsession['bigbluebuttonbn']->id;
163 163
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
164 164
     $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro;
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
180 180
     }
181 181
     if ($bigbluebuttonbn->record) {
182
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
182
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
183 183
     }
184 184
 
185 185
     $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     $bbbsession['originServerName'] = $parsedurl['host'];
196 196
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
197 197
     $bbbsession['originServerCommonName'] = '';
198
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
198
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
199 199
 }
200 200
 
201 201
 function bigbluebuttonbn_view_get_activity_status(&$bbbsession, $bigbluebuttonbn) {
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
     $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true);
248 248
 
249 249
     // Assign group default values.
250
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
251
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
250
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
251
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
252 252
     $groupname = get_string('allparticipants');
253
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
253
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
254 254
 
255 255
 
256 256
     if (sizeof($groups) == 0) {
@@ -262,10 +262,10 @@  discard block
 block discarded – undo
262 262
         $bbbsession['group'] = array_values($groups)[0]->id;
263 263
     }
264 264
 
265
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
266
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
265
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
266
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
267 267
     $groupname = groups_get_group_name($bbbsession['group']);
268
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
268
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
269 269
 
270 270
     if (sizeof($groups) == 1) {
271 271
         // There only one group and the user has access to.
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
     }
274 274
 
275 275
     echo $OUTPUT->box_start('generalbox boxaligncenter');
276
-    echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').
276
+    echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') .
277 277
       '</div>';
278 278
     echo $OUTPUT->box_end();
279 279
 
280 280
     groups_print_activity_menu(
281
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id, false, $onlyexistentgroups);
281
+      $bbbsession['cm'], $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id, false, $onlyexistentgroups);
282 282
     echo '<br><br>';
283 283
 }
284 284
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             'M.mod_bigbluebuttonbn.recordings.init', array($jsvars));
321 321
     }
322 322
 
323
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
323
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
324 324
 
325 325
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
326 326
 }
@@ -331,12 +331,12 @@  discard block
 block discarded – undo
331 331
     // JavaScript variables for room.
332 332
     $openingtime = '';
333 333
     if ($bbbsession['openingtime']) {
334
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
334
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
335 335
             userdate($bbbsession['openingtime']);
336 336
     }
337 337
     $closingtime = '';
338 338
     if ($bbbsession['closingtime']) {
339
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
339
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
340 340
             userdate($bbbsession['closingtime']);
341 341
     }
342 342
     $jsvars += array(
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     $output .= $OUTPUT->box_end();
354 354
 
355 355
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
356
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
356
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
357 357
     $output .= $OUTPUT->box_end();
358 358
 
359 359
     if ($activity == 'ended') {
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
     // If there are meetings with recordings load the data to the table.
390 390
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
391 391
         // Render a plain html table.
392
-        return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n";
392
+        return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n";
393 393
     }
394 394
 
395 395
     // JavaScript variables for recordings with YUI.
@@ -409,8 +409,8 @@  discard block
 block discarded – undo
409 409
         array('type' => 'button',
410 410
               'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
411 411
               'class' => 'btn btn-secondary',
412
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
413
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
412
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
413
+                  $bbbsession['bigbluebuttonbn']->id . '\''));
414 414
     $output = html_writer::start_tag('br');
415 415
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
416 416
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -425,10 +425,10 @@  discard block
 block discarded – undo
425 425
         $attributes = array('title' => $bbbsession['presentation']['name']);
426 426
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
427 427
 
428
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
429
-                ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
430
-                ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
431
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
428
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
429
+                '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' .
430
+                '' . $OUTPUT->action_link($bbbsession['presentation']['url'],
431
+                      $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
432 432
     }
433 433
 
434 434
     return '';
Please login to merge, or discard this patch.
locallib.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 // BigBlueButton API Calls.
85 85
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
86 86
     $data = ['meetingID' => $meetingid,
87
-              'fullName' => $username,
88
-              'password' => $pw,
89
-              'logoutURL' => $logouturl,
87
+                'fullName' => $username,
88
+                'password' => $pw,
89
+                'logoutURL' => $logouturl,
90 90
             ];
91 91
 
92 92
     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
         bigbluebuttonbn_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) {
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
         // Do getRecordings is executed using a method GET (supported by all versions of BBB).
285 285
         $xml = bigbluebuttonbn_wrap_xml_load_file(
286 286
             bigbluebuttonbn_bigbluebutton_action_url('getRecordings', ['meetingID' => implode(',', $mids)])
287
-          );
287
+            );
288 288
         if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
289 289
             // If there were meetings already created.
290 290
             foreach ($xml->recordings->recording as $recording) {
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 function bigbluebuttonbn_get_default_config_xml() {
356 356
     $xml = bigbluebuttonbn_wrap_xml_load_file(
357 357
         bigbluebuttonbn_bigbluebutton_action_url('getDefaultConfigXML')
358
-      );
358
+        );
359 359
 
360 360
     return $xml;
361 361
 }
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
     foreach ($ids as $id) {
424 424
         $xml = bigbluebuttonbn_wrap_xml_load_file(
425 425
             bigbluebuttonbn_bigbluebutton_action_url('deleteRecordings', ['recordID' => $id])
426
-          );
426
+            );
427 427
         if ($xml && $xml->returncode != 'SUCCESS') {
428 428
             return false;
429 429
         }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     foreach ($ids as $id) {
442 442
         $xml = bigbluebuttonbn_wrap_xml_load_file(
443 443
             bigbluebuttonbn_bigbluebutton_action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
444
-          );
444
+            );
445 445
         if ($xml && $xml->returncode != 'SUCCESS') {
446 446
             return false;
447 447
         }
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
     foreach ($ids as $id) {
460 460
         $xml = bigbluebuttonbn_wrap_xml_load_file(
461 461
             bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array) $params)
462
-          );
462
+            );
463 463
         if ($xml && $xml->returncode != 'SUCCESS') {
464 464
             return false;
465 465
         }
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
488 488
     $xml = bigbluebuttonbn_wrap_xml_load_file(
489 489
         bigbluebuttonbn_bigbluebutton_action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
490
-      );
490
+        );
491 491
 
492 492
     if ($xml) {
493 493
         // If the xml packet returned failure it displays the message to the user.
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 function bigbluebuttonbn_is_meeting_running($meetingid) {
505 505
     $xml = bigbluebuttonbn_wrap_xml_load_file(
506 506
         bigbluebuttonbn_bigbluebutton_action_url('isMeetingRunning', ['meetingID' => $meetingid])
507
-      );
507
+        );
508 508
 
509 509
     if ($xml && $xml->returncode == 'SUCCESS') {
510 510
         return ($xml->running == 'true');
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 function bigbluebuttonbn_get_server_version() {
517 517
     $xml = bigbluebuttonbn_wrap_xml_load_file(
518 518
         bigbluebuttonbn_bigbluebutton_action_url()
519
-      );
519
+        );
520 520
 
521 521
     if ($xml && $xml->returncode == 'SUCCESS') {
522 522
         return $xml->version;
@@ -582,10 +582,10 @@  discard block
 block discarded – undo
582 582
 
583 583
         $options = array();
584 584
         $options['CURLOPT_HTTPHEADER'] = array(
585
-                 'Content-Type: '.$contenttype,
586
-                 'Content-Length: '.strlen($data),
587
-                 'Content-Language: en-US',
588
-               );
585
+                    'Content-Type: '.$contenttype,
586
+                    'Content-Length: '.strlen($data),
587
+                    'Content-Language: en-US',
588
+                );
589 589
 
590 590
         return $c->post($url, $data, $options);
591 591
     }
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
645 645
     }
646 646
     return $roles;
647
- }
647
+    }
648 648
 
649 649
 function bigbluebuttonbn_get_role($id) {
650 650
     $roles = (array) role_get_names();
@@ -664,18 +664,18 @@  discard block
 block discarded – undo
664 664
         'all' => array(
665 665
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
666 666
             'children' => []
667
-          )
668
-      );
667
+            )
668
+        );
669 669
 
670 670
     $data['role'] = array(
671 671
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
672 672
         'children' => bigbluebuttonbn_get_roles_select($context)
673
-      );
673
+        );
674 674
 
675 675
     $data['user'] = array(
676 676
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
677 677
         'children' => bigbluebuttonbn_get_users_select($context)
678
-      );
678
+        );
679 679
 
680 680
     return $data;
681 681
 }
@@ -722,9 +722,9 @@  discard block
 block discarded – undo
722 722
         }
723 723
 
724 724
         $participantlistarray[] = array(
725
-              'selectiontype' => 'role',
726
-              'selectionid' => $moderatordefault,
727
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
725
+                'selectiontype' => 'role',
726
+                'selectionid' => $moderatordefault,
727
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
728 728
     }
729 729
 
730 730
     return $participantlistarray;
@@ -736,11 +736,11 @@  discard block
 block discarded – undo
736 736
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
737 737
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
738 738
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
739
-          ],
739
+            ],
740 740
         'type_selected' => 'all',
741 741
         'options' => ['all' => '---------------'],
742 742
         'selected' => 'all',
743
-      ];
743
+        ];
744 744
 }
745 745
 
746 746
 function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) {
@@ -871,8 +871,8 @@  discard block
 block discarded – undo
871 871
     }
872 872
 
873 873
     $parray = array('url' => $purl, 'name' => $pname,
874
-                               'icon' => $picon,
875
-                               'mimetype_description' => $pmimetypedescrip);
874
+                                'icon' => $picon,
875
+                                'mimetype_description' => $pmimetypedescrip);
876 876
 
877 877
     return $parray;
878 878
 }
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
         $eventproperties['other'] = $eventsubtype;
957 957
     }
958 958
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
959
-      array($eventproperties));
959
+        array($eventproperties));
960 960
     $event->trigger();
961 961
 }
962 962
 
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
     // Ping again and refresh the cache.
1004 1004
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1005 1005
         bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid])
1006
-      );
1006
+        );
1007 1007
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1008 1008
 
1009 1009
     return $meetinginfo;
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
         $actionbar .= bigbluebuttonbn_actionbar_render_button(
1142 1142
             $recording,
1143 1143
             bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool)
1144
-          );
1144
+            );
1145 1145
     }
1146 1146
 
1147 1147
     $head = html_writer::start_tag('div', array(
@@ -1227,7 +1227,7 @@  discard block
 block discarded – undo
1227 1227
 
1228 1228
     $recordingtypes = html_writer::start_tag('div',
1229 1229
         array('id' => 'playbacks-'.$recording['recordID'], 'data-imported' => $dataimported,
1230
-              'title' => $title, $visibility => $visibility));
1230
+                'title' => $title, $visibility => $visibility));
1231 1231
     foreach ($recording['playbacks'] as $playback) {
1232 1232
         $recordingtypes .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'],
1233 1233
             'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'],
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
         $payload['source'] = 'meta_contextactivitydescription';
1270 1270
         $metadescription = trim($recording[$payload['source']]);
1271 1271
         if (!empty($metadescription)) {
1272
-          return bigbluebuttonbn_get_recording_data_row_text($recording, $metadescription, $payload);
1272
+            return bigbluebuttonbn_get_recording_data_row_text($recording, $metadescription, $payload);
1273 1273
         }
1274 1274
     }
1275 1275
 
@@ -1324,7 +1324,7 @@  discard block
 block discarded – undo
1324 1324
             'onclick' => $onclick,
1325 1325
             'data-action' => $data['action'],
1326 1326
             'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID'])
1327
-          );
1327
+            );
1328 1328
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
1329 1329
     }
1330 1330
 
@@ -1925,22 +1925,22 @@  discard block
 block discarded – undo
1925 1925
  */
1926 1926
 function bigbluebuttonbn_get_cfg_options() {
1927 1927
     return [
1928
-          'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(),
1929
-          'recording_default' => bigbluebuttonbn_get_cfg_recording_default(),
1930
-          'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(),
1931
-          'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(),
1932
-          'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(),
1933
-          'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(),
1934
-          'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(),
1935
-          'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(),
1936
-          'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(),
1937
-          'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(),
1938
-          'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(),
1939
-          'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(),
1940
-          'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(),
1941
-          'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(),
1942
-          'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(),
1943
-          'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
1928
+            'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(),
1929
+            'recording_default' => bigbluebuttonbn_get_cfg_recording_default(),
1930
+            'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(),
1931
+            'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(),
1932
+            'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(),
1933
+            'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(),
1934
+            'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(),
1935
+            'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(),
1936
+            'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(),
1937
+            'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(),
1938
+            'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(),
1939
+            'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(),
1940
+            'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(),
1941
+            'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(),
1942
+            'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(),
1943
+            'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
1944 1944
         ];
1945 1945
 }
1946 1946
 
@@ -2141,8 +2141,8 @@  discard block
 block discarded – undo
2141 2141
     $activitytime = '';
2142 2142
     if ($time) {
2143 2143
         $activitytime = calendar_day_representation($time).' '.
2144
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2145
-          calendar_time_representation($time);
2144
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2145
+            calendar_time_representation($time);
2146 2146
     }
2147 2147
 
2148 2148
     return $activitytime;
Please login to merge, or discard this patch.
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once(dirname(__FILE__).'/lib.php');
30
+require_once(dirname(__FILE__) . '/lib.php');
31 31
 
32 32
 const BIGBLUEBUTTONBN_FORCED = true;
33 33
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     if (isset($meta)) {
76 76
         $log->meta = $meta;
77 77
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
78
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
78
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
79 79
     }
80 80
 
81 81
     $DB->insert_record('bigbluebuttonbn_logs', $log);
@@ -113,18 +113,18 @@  discard block
 block discarded – undo
113 113
  * @param array  $metadata
114 114
  */
115 115
 function bigbluebuttonbn_bigbluebutton_action_url($action = '', $data = array(), $metadata = array()) {
116
-    $baseurl = bigbluebuttonbn_get_cfg_server_url().'api/'.$action.'?';
116
+    $baseurl = bigbluebuttonbn_get_cfg_server_url() . 'api/' . $action . '?';
117 117
     $params = '';
118 118
 
119 119
     foreach ($data as $key => $value) {
120
-        $params .= '&'.$key.'='.urlencode($value);
120
+        $params .= '&' . $key . '=' . urlencode($value);
121 121
     }
122 122
 
123 123
     foreach ($metadata as $key => $value) {
124
-        $params .= '&'.'meta_'.$key.'='.urlencode($value);
124
+        $params .= '&' . 'meta_' . $key . '=' . urlencode($value);
125 125
     }
126 126
 
127
-    return $baseurl.$params.'&checksum='.sha1($action.$params.bigbluebuttonbn_get_cfg_shared_secret());
127
+    return $baseurl . $params . '&checksum=' . sha1($action . $params . bigbluebuttonbn_get_cfg_shared_secret());
128 128
 }
129 129
 
130 130
 function bigbluebuttonbn_get_create_meeting_array($data, $metadata = array(), $pname = null, $purl = null) {
@@ -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='presentation'><document url='".
138
-            $purl."' /></module></modules>";
137
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><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;
@@ -323,12 +323,12 @@  discard block
 block discarded – undo
323 323
 function bigbluebuttonbn_get_recordings_imported_array($courseid, $bigbluebuttonbnid = null, $subset = true) {
324 324
     global $DB;
325 325
 
326
-    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
327
-        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
326
+    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
327
+        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
328 328
     if ($bigbluebuttonbnid === null) {
329
-        $select = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
329
+        $select = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
330 330
     } else if ($subset) {
331
-        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
331
+        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
332 332
     }
333 333
     $recordsimported = $DB->get_records_select('bigbluebuttonbn_logs', $select);
334 334
 
@@ -363,35 +363,35 @@  discard block
 block discarded – undo
363 363
 function bigbluebuttonbn_get_default_config_xml_array() {
364 364
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
365 365
 
366
-    return (array) $defaultconfigxml;
366
+    return (array)$defaultconfigxml;
367 367
 }
368 368
 
369 369
 function bigbluebuttonbn_get_recording_array_value($recording) {
370 370
     // Add formats.
371 371
     $playbackarray = array();
372 372
     foreach ($recording->playback->format as $format) {
373
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
374
-            'url' => (string) $format->url, 'length' => (string) $format->length);
373
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
374
+            'url' => (string)$format->url, 'length' => (string)$format->length);
375 375
         // Add preview per format when existing.
376 376
         if ($format->preview) {
377 377
             $imagesarray = array();
378 378
             foreach ($format->preview->images->image as $image) {
379
-                $imagearray = array('url' => (string) $image);
379
+                $imagearray = array('url' => (string)$image);
380 380
                 foreach ($image->attributes() as $attkey => $attvalue) {
381
-                    $imagearray[$attkey] = (string) $attvalue;
381
+                    $imagearray[$attkey] = (string)$attvalue;
382 382
                 }
383 383
                 array_push($imagesarray, $imagearray);
384 384
             }
385
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
385
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
386 386
         }
387 387
     }
388 388
 
389 389
     // Add the metadata to the recordings array.
390 390
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
391
-    return array('recordID' => (string) $recording->recordID,
392
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
393
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
394
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray) + $metadataarray;
391
+    return array('recordID' => (string)$recording->recordID,
392
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
393
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
394
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray) + $metadataarray;
395 395
 }
396 396
 
397 397
 function bigbluebuttonbn_get_recording_array_meta($metadata) {
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
         if (is_object($value)) {
401 401
             $value = '';
402 402
         }
403
-        $metadataarray['meta_'.$key] = $value;
403
+        $metadataarray['meta_' . $key] = $value;
404 404
     }
405 405
     return $metadataarray;
406 406
 }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
     $ids = explode(',', $recordids);
459 459
     foreach ($ids as $id) {
460 460
         $xml = bigbluebuttonbn_wrap_xml_load_file(
461
-            bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array) $params)
461
+            bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array)$params)
462 462
           );
463 463
         if ($xml && $xml->returncode != 'SUCCESS') {
464 464
             return false;
@@ -582,8 +582,8 @@  discard block
 block discarded – undo
582 582
 
583 583
         $options = array();
584 584
         $options['CURLOPT_HTTPHEADER'] = array(
585
-                 'Content-Type: '.$contenttype,
586
-                 'Content-Length: '.strlen($data),
585
+                 'Content-Type: ' . $contenttype,
586
+                 'Content-Length: ' . strlen($data),
587 587
                  'Content-Language: en-US',
588 588
                );
589 589
 
@@ -600,9 +600,9 @@  discard block
 block discarded – undo
600 600
     if ($userroles) {
601 601
         $where = '';
602 602
         foreach ($userroles as $value) {
603
-            $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid;
603
+            $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid;
604 604
         }
605
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
605
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
606 606
     }
607 607
 
608 608
     return $userroles;
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 }
616 616
 
617 617
 function bigbluebuttonbn_get_users(context $context = null) {
618
-    $users = (array) get_enrolled_users($context);
618
+    $users = (array)get_enrolled_users($context);
619 619
     foreach ($users as $key => $value) {
620 620
         $users[$key] = fullname($value);
621 621
     }
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 }
624 624
 
625 625
 function bigbluebuttonbn_get_users_select(context $context = null) {
626
-    $users = (array) get_enrolled_users($context);
626
+    $users = (array)get_enrolled_users($context);
627 627
     foreach ($users as $key => $value) {
628 628
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
629 629
     }
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 }
632 632
 
633 633
 function bigbluebuttonbn_get_roles(context $context = null) {
634
-    $roles = (array) role_get_names($context);
634
+    $roles = (array)role_get_names($context);
635 635
     foreach ($roles as $key => $value) {
636 636
         $roles[$key] = $value->localname;
637 637
     }
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 }
640 640
 
641 641
 function bigbluebuttonbn_get_roles_select(context $context = null) {
642
-    $roles = (array) role_get_names($context);
642
+    $roles = (array)role_get_names($context);
643 643
     foreach ($roles as $key => $value) {
644 644
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
645 645
     }
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
  }
648 648
 
649 649
 function bigbluebuttonbn_get_role($id) {
650
-    $roles = (array) role_get_names();
650
+    $roles = (array)role_get_names();
651 651
     if (is_numeric($id)) {
652 652
         return $roles[$id];
653 653
     }
@@ -811,9 +811,9 @@  discard block
 block discarded – undo
811 811
     $isunique = true;
812 812
     if ($voicebridge != 0) {
813 813
         $table = 'bigbluebuttonbn';
814
-        $select = 'voicebridge = '.$voicebridge;
814
+        $select = 'voicebridge = ' . $voicebridge;
815 815
         if ($id) {
816
-            $select .= ' AND id <> '.$id;
816
+            $select .= ' AND id <> ' . $id;
817 817
         }
818 818
         if ($DB->get_records_select($table, $select)) {
819 819
             $isunique = false;
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
     $mt = microtime();
882 882
     $rand = mt_rand();
883 883
 
884
-    return md5($mt.$rand);
884
+    return md5($mt . $rand);
885 885
 }
886 886
 
887 887
 function bigbluebuttonbn_random_password($length = 8) {
@@ -901,39 +901,39 @@  discard block
 block discarded – undo
901 901
 
902 902
 function bigbluebuttonbn_events() {
903 903
     return array(
904
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
905
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
906
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
907
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
908
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
909
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
910
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
911
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
912
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
913
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
914
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
915
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
916
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
917
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED
904
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
905
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
906
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
907
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
908
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
909
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
910
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
911
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
912
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
913
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
914
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
915
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
916
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
917
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED
918 918
     );
919 919
 }
920 920
 
921 921
 function bigbluebuttonbn_events_action() {
922 922
     return array(
923
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
924
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
925
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
926
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
927
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
928
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
929
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
930
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
931
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
932
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
933
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
934
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
935
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
936
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED
923
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
924
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
925
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
926
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
927
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
928
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
929
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
930
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
931
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
932
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
933
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
934
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
935
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
936
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED
937 937
     );
938 938
 }
939 939
 
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
         $eventproperties['timecreated'] = $timecreated;
956 956
         $eventproperties['other'] = $eventsubtype;
957 957
     }
958
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
958
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
959 959
       array($eventproperties));
960 960
     $event->trigger();
961 961
 }
@@ -997,11 +997,11 @@  discard block
 block discarded – undo
997 997
     $now = time();
998 998
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
999 999
         // Use the value in the cache.
1000
-        return (array) json_decode($result['meeting_info']);
1000
+        return (array)json_decode($result['meeting_info']);
1001 1001
     }
1002 1002
 
1003 1003
     // Ping again and refresh the cache.
1004
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1004
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1005 1005
         bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid])
1006 1006
       );
1007 1007
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1055,8 +1055,8 @@  discard block
 block discarded – undo
1055 1055
  * @param string $configxml
1056 1056
  */
1057 1057
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1058
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1059
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.bigbluebuttonbn_get_cfg_shared_secret());
1058
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1059
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . bigbluebuttonbn_get_cfg_shared_secret());
1060 1060
 
1061 1061
     return $configxmlparams;
1062 1062
 }
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
  * @param string $configxml
1067 1067
  */
1068 1068
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1069
-    $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url().'api/setConfigXML?';
1069
+    $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url() . 'api/setConfigXML?';
1070 1070
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1071 1071
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
1072 1072
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
  */
1081 1081
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1082 1082
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1083
-    $configxmlarray = (array) $configxml;
1083
+    $configxmlarray = (array)$configxml;
1084 1084
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1085 1085
         //debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1086 1086
         return '';
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
         $starttime = $starttime - ($starttime % 1000);
1118 1118
 
1119 1119
         // Set formatted date.
1120
-        $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1120
+        $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1121 1121
         $row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1122 1122
 
1123 1123
         // Set formatted duration.
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
     }
1193 1193
 
1194 1194
     $recordingpreview = html_writer::start_tag('div',
1195
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1195
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1196 1196
     foreach ($recording['playbacks'] as $playback) {
1197 1197
         if (isset($playback['preview'])) {
1198 1198
             foreach ($playback['preview'] as $image) {
@@ -1226,12 +1226,12 @@  discard block
 block discarded – undo
1226 1226
     }
1227 1227
 
1228 1228
     $recordingtypes = html_writer::start_tag('div',
1229
-        array('id' => 'playbacks-'.$recording['recordID'], 'data-imported' => $dataimported,
1229
+        array('id' => 'playbacks-' . $recording['recordID'], 'data-imported' => $dataimported,
1230 1230
               'title' => $title, $visibility => $visibility));
1231 1231
     foreach ($recording['playbacks'] as $playback) {
1232
-        $recordingtypes .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'],
1233
-            'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'],
1234
-            'bigbluebuttonbn'), 'target' => '_new')).'&#32;';
1232
+        $recordingtypes .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_' . $playback['type'],
1233
+            'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_' . $playback['type'],
1234
+            'bigbluebuttonbn'), 'target' => '_new')) . '&#32;';
1235 1235
     }
1236 1236
     $recordingtypes .= html_writer::end_tag('div');
1237 1237
 
@@ -1312,11 +1312,11 @@  discard block
 block discarded – undo
1312 1312
         $target .= '-' . $data['target'];
1313 1313
     }
1314 1314
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1315
-    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);';
1315
+    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);';
1316 1316
     if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) {
1317 1317
         // With icon for $manageaction.
1318 1318
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1319
-        $icon = new pix_icon('i/'.$data['tag'],
1319
+        $icon = new pix_icon('i/' . $data['tag'],
1320 1320
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1321 1321
             'moodle', $iconattributes);
1322 1322
         $linkattributes = array(
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
         // There are recordings for this meeting.
1408 1408
         foreach ($recordings as $recording) {
1409 1409
             $row = new html_table_row();
1410
-            $row->id = 'recording-td-'.$recording['recordID'];
1410
+            $row->id = 'recording-td-' . $recording['recordID'];
1411 1411
             $row->attributes['data-imported'] = 'false';
1412 1412
             $texthead = '';
1413 1413
             $texttail = '';
@@ -1421,9 +1421,9 @@  discard block
 block discarded – undo
1421 1421
             $rowdata = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools);
1422 1422
             if ($rowdata != null) {
1423 1423
                 $rowdata->date_formatted = str_replace(' ', '&nbsp;', $rowdata->date_formatted);
1424
-                $row->cells = array($texthead.$rowdata->recording.$texttail,
1425
-                    $texthead.$rowdata->activity.$texttail, $texthead.$rowdata->description.$texttail,
1426
-                    $rowdata->preview, $texthead.$rowdata->date_formatted.$texttail,
1424
+                $row->cells = array($texthead . $rowdata->recording . $texttail,
1425
+                    $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1426
+                    $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1427 1427
                     $rowdata->duration_formatted);
1428 1428
                 if ($bbbsession['managerecordings']) {
1429 1429
                     $row->cells[] = $rowdata->actionbar;
@@ -1445,9 +1445,9 @@  discard block
 block discarded – undo
1445 1445
     // Build the message_body.
1446 1446
     $msg->activity_type = '';
1447 1447
     $msg->activity_title = $bigbluebuttonbn->name;
1448
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1449
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1450
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1448
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1449
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1450
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1451 1451
 
1452 1452
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1453 1453
 }
@@ -1473,15 +1473,15 @@  discard block
 block discarded – undo
1473 1473
     global $CFG;
1474 1474
 
1475 1475
     if (isset($CFG->bigbluebuttonbn['server_url'])) {
1476
-        return trim(trim($CFG->bigbluebuttonbn['server_url']), '/').'/';
1476
+        return trim(trim($CFG->bigbluebuttonbn['server_url']), '/') . '/';
1477 1477
     }
1478 1478
 
1479 1479
     if (isset($CFG->bigbluebuttonbn_server_url)) {
1480
-        return trim(trim($CFG->bigbluebuttonbn_server_url), '/').'/';
1480
+        return trim(trim($CFG->bigbluebuttonbn_server_url), '/') . '/';
1481 1481
     }
1482 1482
 
1483 1483
     if (isset($CFG->BigBlueButtonBNServerURL)) {
1484
-        return trim(trim($CFG->BigBlueButtonBNServerURL), '/').'/';
1484
+        return trim(trim($CFG->BigBlueButtonBNServerURL), '/') . '/';
1485 1485
     }
1486 1486
 
1487 1487
     return  BIGBLUEBUTTONBN_DEFAULT_SERVER_URL;
@@ -2018,15 +2018,15 @@  discard block
 block discarded – undo
2018 2018
 
2019 2019
     // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'.
2020 2020
     $select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'";
2021
-    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
2022
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
2021
+    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
2022
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2023 2023
     if ($bigbluebuttonbnid === null) {
2024 2024
         $select = "course = '{$courseid}'";
2025
-        $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
2025
+        $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
2026 2026
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
2027 2027
     } else if ($subset) {
2028 2028
         $select = "id = '{$bigbluebuttonbnid}'";
2029
-        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
2029
+        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
2030 2030
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
2031 2031
     }
2032 2032
     $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid');
@@ -2048,7 +2048,7 @@  discard block
 block discarded – undo
2048 2048
     if (!empty($bigbluebuttonbns)) {
2049 2049
         // Prepare select for loading records based on existent bigbluebuttonbns.
2050 2050
         $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
2051
-        $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
2051
+        $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
2052 2052
         // Include only Create events and exclude those with record not true.
2053 2053
         $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
2054 2054
         // Execute select for loading records based on existent bigbluebuttonbns.
@@ -2140,8 +2140,8 @@  discard block
 block discarded – undo
2140 2140
 function bigbluebuttonbn_format_activity_time($time) {
2141 2141
     $activitytime = '';
2142 2142
     if ($time) {
2143
-        $activitytime = calendar_day_representation($time).' '.
2144
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2143
+        $activitytime = calendar_day_representation($time) . ' ' .
2144
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2145 2145
           calendar_time_representation($time);
2146 2146
     }
2147 2147
 
Please login to merge, or discard this patch.
bbb_broker.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -369,10 +369,10 @@  discard block
 block discarded – undo
369 369
     if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) {
370 370
         // Execute unpublish on imported recording link.
371 371
         return array(
372
-          'status' => bigbluebuttonbn_publish_recording_imported(
373
-              $params['id'], $bbbsession['bigbluebuttonbn']->id, false
372
+            'status' => bigbluebuttonbn_publish_recording_imported(
373
+                $params['id'], $bbbsession['bigbluebuttonbn']->id, false
374 374
             )
375
-          );
375
+            );
376 376
     }
377 377
 
378 378
     // As the recordingid was not identified as imported recording link, execute unpublish on a real recording.
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
     }
393 393
     // Second: Execute the real unpublish.
394 394
     return array(
395
-      'status' => bigbluebuttonbn_publish_recordings($params['id'], 'false')
396
-      );
395
+        'status' => bigbluebuttonbn_publish_recordings($params['id'], 'false')
396
+        );
397 397
 }
398 398
 
399 399
 function bigbluebuttonbn_broker_recording_action_edit($bbbsession, $params, $recordings) {
@@ -401,10 +401,10 @@  discard block
 block discarded – undo
401 401
         error_log("Updating imported");
402 402
         // Execute update on imported recording link.
403 403
         return array(
404
-          'status' => bigbluebuttonbn_update_recording_imported(
405
-              $params['id'], $bbbsession['bigbluebuttonbn']->id, json_decode($params['meta'])
404
+            'status' => bigbluebuttonbn_update_recording_imported(
405
+                $params['id'], $bbbsession['bigbluebuttonbn']->id, json_decode($params['meta'])
406 406
             )
407
-          );
407
+            );
408 408
     }
409 409
 
410 410
     // As the recordingid was not identified as imported recording link, execute update on a real recording.
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
     // Execute update on actual recording.
413 413
     error_log("Updating real");
414 414
     return array(
415
-      'status' => bigbluebuttonbn_update_recordings($params['id'], json_decode($params['meta']))
416
-      );
415
+        'status' => bigbluebuttonbn_update_recordings($params['id'], json_decode($params['meta']))
416
+        );
417 417
 }
418 418
 
419 419
 function bigbluebuttonbn_broker_recording_action_delete($bbbsession, $params, $recordings) {
@@ -422,10 +422,10 @@  discard block
 block discarded – undo
422 422
     if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) {
423 423
         // Execute delete on imported recording link.
424 424
         return array(
425
-          'status' => bigbluebuttonbn_delete_recording_imported(
426
-              $params['id'], $bbbsession['bigbluebuttonbn']->id
425
+            'status' => bigbluebuttonbn_delete_recording_imported(
426
+                $params['id'], $bbbsession['bigbluebuttonbn']->id
427 427
             )
428
-          );
428
+            );
429 429
     }
430 430
 
431 431
     // As the recordingid was not identified as imported recording link, execute delete on a real recording.
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
     }
441 441
     // Execute the actual delete.
442 442
     return array(
443
-      'status' => bigbluebuttonbn_delete_recordings($params['id'])
444
-      );
443
+        'status' => bigbluebuttonbn_delete_recordings($params['id'])
444
+        );
445 445
 }
446 446
 
447 447
 function bigbluebuttonbn_broker_recording_ready($params, $bigbluebuttonbn) {
@@ -581,11 +581,11 @@  discard block
 block discarded – undo
581 581
         'recording_import' => ['id' => 'The recordingID must be specified.'],
582 582
         'recording_ready' => [
583 583
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
584
-          ],
584
+            ],
585 585
         'live_session_events' => [
586 586
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
587
-          ]
588
-      ];
587
+            ]
588
+        ];
589 589
 }
590 590
 
591 591
 function bigbluebuttonbn_broker_recording_is_imported($recordings, $recordingid) {
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
 
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
         return;
134 134
     }
135 135
 
136
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
136
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
137 137
     return;
138 138
 
139 139
 } catch (Exception $e) {
140
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
140
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
141 141
     return;
142 142
 }
143 143
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
284 284
     $callbackresponse['status'] = true;
285
-    $callbackresponse['published'] = (string) $recording['published'];
285
+    $callbackresponse['published'] = (string)$recording['published'];
286 286
     if (!isset($params['meta'])) {
287 287
         return $callbackresponse;
288 288
     }
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
         $decodedparameters = JWT::decode($params['signed_parameters'], bigbluebuttonbn_get_cfg_shared_secret(),
452 452
             array('HS256'));
453 453
     } catch (Exception $e) {
454
-        $error = 'Caught exception: '.$e->getMessage();
455
-        header('HTTP/1.0 400 Bad Request. '.$error);
454
+        $error = 'Caught exception: ' . $e->getMessage();
455
+        header('HTTP/1.0 400 Bad Request. ' . $error);
456 456
         return;
457 457
     }
458 458
 
@@ -470,8 +470,8 @@  discard block
 block discarded – undo
470 470
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
471 471
         header('HTTP/1.0 202 Accepted');
472 472
     } catch (Exception $e) {
473
-        $error = 'Caught exception: '.$e->getMessage();
474
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
473
+        $error = 'Caught exception: ' . $e->getMessage();
474
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
475 475
     }
476 476
 }
477 477
 
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
487 487
     if (!isset($importrecordings[$params['id']])) {
488 488
         $error = "Recording {$params['id']} could not be found. It can not be imported";
489
-        header('HTTP/1.0 404 Not found. '.$error);
489
+        header('HTTP/1.0 404 Not found. ' . $error);
490 490
         return;
491 491
     }
492 492
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 
495 495
     $importrecordings[$params['id']]['imported'] = true;
496 496
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
497
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
497
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
498 498
     bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
499 499
     // Moodle event logger: Create an event for recording imported.
500 500
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -511,8 +511,8 @@  discard block
 block discarded – undo
511 511
         $decodedparameters = JWT::decode($params['signed_parameters'], bigbluebuttonbn_get_cfg_shared_secret(),
512 512
             array('HS256'));
513 513
     } catch (Exception $e) {
514
-        $error = 'Caught exception: '.$e->getMessage();
515
-        header('HTTP/1.0 400 Bad Request. '.$error);
514
+        $error = 'Caught exception: ' . $e->getMessage();
515
+        header('HTTP/1.0 400 Bad Request. ' . $error);
516 516
         return;
517 517
     }
518 518
 
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 
551 551
     $action = strtolower($params['action']);
552 552
     if (!array_key_exists($action, $requiredparams)) {
553
-        return 'Action '.$params['action'].' can not be performed.';
553
+        return 'Action ' . $params['action'] . ' can not be performed.';
554 554
     }
555 555
 
556 556
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
Please login to merge, or discard this patch.
import_view.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,8 @@
 block discarded – undo
96 96
     $output .= html_writer::start_tag('br');
97 97
     $output .= html_writer::tag('input', '',
98 98
         array('type' => 'button', 'class' => 'btn btn-secondary',
99
-              'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'),
100
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\''));
99
+                'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'),
100
+                'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\''));
101 101
 
102 102
     // JavaScript for locales.
103 103
     $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn');
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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
 $bn = required_param('bn', PARAM_INT);
29 29
 $tc = optional_param('tc', 0, PARAM_INT);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     $output .= html_writer::tag('input', '',
98 98
         array('type' => 'button', 'class' => 'btn btn-secondary',
99 99
               'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'),
100
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\''));
100
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $cm->id . '\''));
101 101
 
102 102
     // JavaScript for locales.
103 103
     $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn');
Please login to merge, or discard this patch.
bbb_view.php 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 
167 167
 function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession, $bigbluebuttonbn) {
168 168
     $data = ['meetingID' => $bbbsession['meetingid'],
169
-              'name' => $bbbsession['meetingname'],
170
-              'attendeePW' => $bbbsession['viewerPW'],
171
-              'moderatorPW' => $bbbsession['modPW'],
172
-              'logoutURL' => $bbbsession['logoutURL'],
169
+                'name' => $bbbsession['meetingname'],
170
+                'attendeePW' => $bbbsession['viewerPW'],
171
+                'moderatorPW' => $bbbsession['modPW'],
172
+                'logoutURL' => $bbbsession['logoutURL'],
173 173
             ];
174 174
 
175 175
     $data['record'] = 'false';
@@ -206,16 +206,16 @@  discard block
 block discarded – undo
206 206
 }
207 207
 
208 208
 function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) {
209
-      $metadata = ['bbb-origin' => $bbbsession['origin'],
210
-                   'bbb-origin-version' => $bbbsession['originVersion'],
211
-                   'bbb-origin-server-name' => $bbbsession['originServerName'],
212
-                   'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
213
-                   'bbb-origin-tag' => $bbbsession['originTag'],
214
-                   'bbb-context' => $bbbsession['course']->fullname,
215
-                   'bbb-recording-name' => $bbbsession['meetingname'],
216
-                   'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
217
-                   'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
218
-                  ];
209
+        $metadata = ['bbb-origin' => $bbbsession['origin'],
210
+                    'bbb-origin-version' => $bbbsession['originVersion'],
211
+                    'bbb-origin-server-name' => $bbbsession['originServerName'],
212
+                    'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
213
+                    'bbb-origin-tag' => $bbbsession['originTag'],
214
+                    'bbb-context' => $bbbsession['course']->fullname,
215
+                    'bbb-recording-name' => $bbbsession['meetingname'],
216
+                    'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
217
+                    'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
218
+                    ];
219 219
 
220 220
     if (bigbluebuttonbn_is_bn_server()) {
221 221
         if (bigbluebuttonbn_get_cfg_recordingready_enabled()) {
Please login to merge, or discard this patch.
Switch Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -60,96 +60,96 @@
 block discarded – undo
60 60
 }
61 61
 
62 62
 switch (strtolower($action)) {
63
-    case 'logout':
64
-        if (isset($errors) && $errors != '') {
65
-            bigbluebutton_bbb_view_errors($errors, $id);
66
-            break;
67
-        }
68
-
69
-        if (is_null($bbbsession)) {
70
-            bigbluebutton_bbb_view_close_window_manually();
71
-            break;
72
-        }
63
+        case 'logout':
64
+            if (isset($errors) && $errors != '') {
65
+                bigbluebutton_bbb_view_errors($errors, $id);
66
+                break;
67
+            }
73 68
 
74
-        // Moodle event logger: Create an event for meeting left.
75
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
69
+            if (is_null($bbbsession)) {
70
+                bigbluebutton_bbb_view_close_window_manually();
71
+                break;
72
+            }
76 73
 
77
-        // Update the cache.
78
-        $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
74
+            // Moodle event logger: Create an event for meeting left.
75
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
79 76
 
80
-        // Close the tab or window where BBB was opened.
81
-        bigbluebutton_bbb_view_close_window();
82
-        break;
83
-    case 'join':
84
-        if (is_null($bbbsession)) {
85
-            print_error('view_error_unable_join', 'bigbluebuttonbn');
86
-            break;
87
-        }
77
+            // Update the cache.
78
+            $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
88 79
 
89
-        // See if the session is in progress.
90
-        if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
91
-            // Since the meeting is already running, we just join the session.
92
-            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
80
+            // Close the tab or window where BBB was opened.
81
+            bigbluebutton_bbb_view_close_window();
93 82
             break;
94
-        }
83
+        case 'join':
84
+            if (is_null($bbbsession)) {
85
+                print_error('view_error_unable_join', 'bigbluebuttonbn');
86
+                break;
87
+            }
95 88
 
96
-        // If user is not administrator nor moderator (user is steudent) and waiting is required.
97
-        if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
98
-            header('Location: '.$bbbsession['logoutURL']);
99
-            break;
100
-        }
89
+            // See if the session is in progress.
90
+            if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
91
+                // Since the meeting is already running, we just join the session.
92
+                bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
93
+                break;
94
+            }
101 95
 
102
-        // As the meeting doesn't exist, try to create it.
103
-        $response = bigbluebuttonbn_get_create_meeting_array(
104
-            bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
105
-            bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
106
-            $bbbsession['presentation']['name'],
107
-            $bbbsession['presentation']['url']
108
-        );
109
-
110
-        if (!$response) {
111
-            // The server is unreachable.
112
-            if ($bbbsession['administrator']) {
113
-                print_error('view_error_unable_join', 'bigbluebuttonbn',
114
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
96
+            // If user is not administrator nor moderator (user is steudent) and waiting is required.
97
+            if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
98
+                header('Location: '.$bbbsession['logoutURL']);
115 99
                 break;
116 100
             }
117
-            if ($bbbsession['moderator']) {
118
-                print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
101
+
102
+            // As the meeting doesn't exist, try to create it.
103
+            $response = bigbluebuttonbn_get_create_meeting_array(
104
+                bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
105
+                bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
106
+                $bbbsession['presentation']['name'],
107
+                $bbbsession['presentation']['url']
108
+            );
109
+
110
+            if (!$response) {
111
+                // The server is unreachable.
112
+                if ($bbbsession['administrator']) {
113
+                    print_error('view_error_unable_join', 'bigbluebuttonbn',
114
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
115
+                    break;
116
+                }
117
+                if ($bbbsession['moderator']) {
118
+                    print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
119
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
120
+                    break;
121
+                }
122
+
123
+                print_error('view_error_unable_join_student', 'bigbluebuttonbn',
119 124
                     $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
120 125
                 break;
121 126
             }
122 127
 
123
-            print_error('view_error_unable_join_student', 'bigbluebuttonbn',
124
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
125
-            break;
126
-        }
128
+            if ($response['returncode'] == 'FAILED') {
129
+                // The meeting was not created.
130
+                if (!$printerrorkey) {
131
+                    print_error($response['message'], 'bigbluebuttonbn');
132
+                    break;
133
+                }
134
+                $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
135
+                print_error($printerrorkey, 'bigbluebuttonbn');
136
+                break;
137
+            }
127 138
 
128
-        if ($response['returncode'] == 'FAILED') {
129
-            // The meeting was not created.
130
-            if (!$printerrorkey) {
131
-                print_error($response['message'], 'bigbluebuttonbn');
139
+            if ($response['hasBeenForciblyEnded'] == 'true') {
140
+                print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
132 141
                 break;
133 142
             }
134
-            $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
135
-            print_error($printerrorkey, 'bigbluebuttonbn');
136
-            break;
137
-        }
138 143
 
139
-        if ($response['hasBeenForciblyEnded'] == 'true') {
140
-            print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
144
+            // Moodle event logger: Create an event for meeting created.
145
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
146
+            // Internal logger: Insert a record with the meeting created.
147
+            bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
148
+            // Since the meeting is already running, we just join the session.
149
+            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
141 150
             break;
142
-        }
143
-
144
-        // Moodle event logger: Create an event for meeting created.
145
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
146
-        // Internal logger: Insert a record with the meeting created.
147
-        bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
148
-        // Since the meeting is already running, we just join the session.
149
-        bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
150
-        break;
151
-    default:
152
-        bigbluebutton_bbb_view_close_window();
151
+        default:
152
+            bigbluebutton_bbb_view_close_window();
153 153
 }
154 154
 
155 155
 function bigbluebutton_bbb_view_close_window() {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 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
 $id = optional_param('id', 0, PARAM_INT);
29 29
 $bn = optional_param('bn', 0, PARAM_INT);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
97 97
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
98
-            header('Location: '.$bbbsession['logoutURL']);
98
+            header('Location: ' . $bbbsession['logoutURL']);
99 99
             break;
100 100
         }
101 101
 
@@ -111,17 +111,17 @@  discard block
 block discarded – undo
111 111
             // The server is unreachable.
112 112
             if ($bbbsession['administrator']) {
113 113
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
114
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
114
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
115 115
                 break;
116 116
             }
117 117
             if ($bbbsession['moderator']) {
118 118
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
119
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
119
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
120 120
                 break;
121 121
             }
122 122
 
123 123
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
124
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
124
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
125 125
             break;
126 126
         }
127 127
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     }
190 190
     if ($durationtime > 0) {
191 191
         $data['duration'] = $durationtime;
192
-        $data['welcome'] .= '<br><br>'.str_replace('%duration%', ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn'));
192
+        $data['welcome'] .= '<br><br>' . str_replace('%duration%', '' . $durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn'));
193 193
     }
194 194
 
195 195
     $voicebridge = intval($bbbsession['voicebridge']);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
237 237
         // No more users allowed to join.
238
-        header('Location: '.$bbbsession['logoutURL']);
238
+        header('Location: ' . $bbbsession['logoutURL']);
239 239
 
240 240
         return;
241 241
     }
@@ -255,20 +255,20 @@  discard block
 block discarded – undo
255 255
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
256 256
         ($bbbsession['administrator'] || $bbbsession['moderator']));
257 257
     // Execute the redirect.
258
-    header('Location: '.$joinurl);
258
+    header('Location: ' . $joinurl);
259 259
 }
260 260
 
261 261
 function bigbluebutton_bbb_view_errors($serrors, $id) {
262 262
     global $CFG, $OUTPUT;
263 263
 
264
-    $errors = (array) json_decode(urldecode($serrors));
264
+    $errors = (array)json_decode(urldecode($serrors));
265 265
     $msgerrors = '';
266 266
     foreach ($errors as $error) {
267
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
267
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
268 268
     }
269 269
 
270 270
     echo $OUTPUT->header();
271 271
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
272
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
272
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
273 273
     echo $OUTPUT->footer();
274 274
 }
Please login to merge, or discard this patch.