Completed
Push — master ( 1d1df5...87b1fe )
by Jesus
07:01
created
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   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
24 24
  */
25 25
 
26
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
27
-require_once(dirname(__FILE__).'/locallib.php');
26
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
27
+require_once(dirname(__FILE__) . '/locallib.php');
28 28
 
29 29
 $id = required_param('id', PARAM_INT);
30 30
 $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,11 +90,11 @@  discard block
 block discarded – undo
90 90
 if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) {
91 91
     echo $OUTPUT->header();
92 92
     if (isguestuser()) {
93
-        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
94
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
93
+        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
94
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
95 95
     } else {
96
-        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
97
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
96
+        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
97
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
98 98
     }
99 99
     echo $OUTPUT->footer();
100 100
     exit;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 // Operation URLs.
104 104
 $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
105
-$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .
105
+$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
106 106
     '&bn=' . $bbbsession['bigbluebuttonbn']->id;
107 107
 $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
108 108
     'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 echo $OUTPUT->footer();
123 123
 
124 124
 // Shows version as a comment.
125
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
125
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
126 126
 
127 127
 // Initialize session variable used across views.
128 128
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass;
153 153
 
154 154
     // Database info related to the activity.
155
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
155
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
156 156
         $bbbsession['bigbluebuttonbn']->id;
157 157
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
158 158
     $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro;
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
174 174
     }
175 175
     if ($bigbluebuttonbn->record) {
176
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
176
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
177 177
     }
178 178
 
179 179
     $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime;
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     $bbbsession['originServerName'] = $parsedurl['host'];
190 190
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
191 191
     $bbbsession['originServerCommonName'] = '';
192
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
192
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
193 193
 }
194 194
 
195 195
 function bigbluebuttonbn_view_bbbsession_roles($context, $userid) {
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
     $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true);
249 249
 
250 250
     // Assign group default values.
251
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
252
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
251
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
252
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
253 253
     $groupname = get_string('allparticipants');
254
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
254
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
255 255
 
256 256
     if (count($groups) == 0) {
257 257
         // Only the All participants group exists.
@@ -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 (count($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.
lib.php 2 patches
Doc Comments   +14 added lines, -1 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
  * $return->time = the time they did it
228 228
  * $return->info = a short text description.
229 229
  *
230
- * @return bool
230
+ * @return string
231 231
  */
232 232
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
233 233
     global $DB;
@@ -317,6 +317,9 @@  discard block
 block discarded – undo
317 317
     }
318 318
 }
319 319
 
320
+/**
321
+ * @param integer $now
322
+ */
320 323
 function bigbluebuttonbn_print_overview_element($bigbluebuttonbn, $now) {
321 324
     global $CFG;
322 325
 
@@ -542,6 +545,10 @@  discard block
 block discarded – undo
542 545
     send_stored_file($file, 0, 0, $forcedownload, $options); // download MUST be forced - security!
543 546
 }
544 547
 
548
+/**
549
+ * @param stdClass $context
550
+ * @param string $filearea
551
+ */
545 552
 function bigbluebuttonbn_pluginfile_valid($context, $filearea) {
546 553
     if ($context->contextlevel != CONTEXT_MODULE) {
547 554
         return false;
@@ -558,6 +565,12 @@  discard block
 block discarded – undo
558 565
     return true;
559 566
 }
560 567
 
568
+/**
569
+ * @param stdClass $course
570
+ * @param stdClass $cm
571
+ * @param stdClass $context
572
+ * @param string $filearea
573
+ */
561 574
 function bigbluebuttonbn_pluginfile_file($course, $cm, $context, $filearea, $args) {
562 575
     $filename = bigbluebuttonbn_pluginfile_filename($course, $cm, $context, $args);
563 576
     if (!$filename) {
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -27,32 +27,32 @@  discard block
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once($CFG->dirroot.'/calendar/lib.php');
31
-require_once($CFG->dirroot.'/message/lib.php');
32
-require_once($CFG->dirroot.'/mod/lti/OAuth.php');
33
-require_once($CFG->libdir.'/accesslib.php');
34
-require_once($CFG->libdir.'/completionlib.php');
35
-require_once($CFG->libdir.'/datalib.php');
36
-require_once($CFG->libdir.'/coursecatlib.php');
37
-require_once($CFG->libdir.'/enrollib.php');
38
-require_once($CFG->libdir.'/filelib.php');
39
-require_once($CFG->libdir.'/formslib.php');
40
-
41
-if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) {
42
-    require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php');
30
+require_once($CFG->dirroot . '/calendar/lib.php');
31
+require_once($CFG->dirroot . '/message/lib.php');
32
+require_once($CFG->dirroot . '/mod/lti/OAuth.php');
33
+require_once($CFG->libdir . '/accesslib.php');
34
+require_once($CFG->libdir . '/completionlib.php');
35
+require_once($CFG->libdir . '/datalib.php');
36
+require_once($CFG->libdir . '/coursecatlib.php');
37
+require_once($CFG->libdir . '/enrollib.php');
38
+require_once($CFG->libdir . '/filelib.php');
39
+require_once($CFG->libdir . '/formslib.php');
40
+
41
+if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) {
42
+    require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php');
43 43
 }
44 44
 
45 45
 if (!isset($CFG->bigbluebuttonbn)) {
46 46
     $CFG->bigbluebuttonbn = array();
47 47
 }
48 48
 
49
-if (file_exists(dirname(__FILE__).'/config.php')) {
50
-    require_once(dirname(__FILE__).'/config.php');
49
+if (file_exists(dirname(__FILE__) . '/config.php')) {
50
+    require_once(dirname(__FILE__) . '/config.php');
51 51
     // Old BigBlueButtonBN cfg schema. For backward compatibility.
52 52
     global $BIGBLUEBUTTONBN_CFG;
53 53
 
54 54
     if (isset($BIGBLUEBUTTONBN_CFG)) {
55
-        foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) {
55
+        foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) {
56 56
             $cfgkey = str_replace("bigbluebuttonbn_", "", $key);
57 57
             $CFG->bigbluebuttonbn[$cfgkey] = $value;
58 58
         }
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     $features = array(
86
-        (string) FEATURE_IDNUMBER => true,
87
-        (string) FEATURE_GROUPS => true,
88
-        (string) FEATURE_GROUPINGS => true,
89
-        (string) FEATURE_GROUPMEMBERSONLY => true,
90
-        (string) FEATURE_MOD_INTRO => true,
91
-        (string) FEATURE_BACKUP_MOODLE2 => true,
92
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
93
-        (string) FEATURE_GRADE_HAS_GRADE => false,
94
-        (string) FEATURE_GRADE_OUTCOMES => false,
95
-        (string) FEATURE_SHOW_DESCRIPTION => true,
86
+        (string)FEATURE_IDNUMBER => true,
87
+        (string)FEATURE_GROUPS => true,
88
+        (string)FEATURE_GROUPINGS => true,
89
+        (string)FEATURE_GROUPMEMBERSONLY => true,
90
+        (string)FEATURE_MOD_INTRO => true,
91
+        (string)FEATURE_BACKUP_MOODLE2 => true,
92
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
93
+        (string)FEATURE_GRADE_HAS_GRADE => false,
94
+        (string)FEATURE_GRADE_OUTCOMES => false,
95
+        (string)FEATURE_SHOW_DESCRIPTION => true,
96 96
     );
97 97
 
98
-    if (isset($features[(string) $feature])) {
98
+    if (isset($features[(string)$feature])) {
99 99
         return $features[$feature];
100 100
     }
101 101
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     }
176 176
 
177 177
     // End the session associated with this instance (if it's running).
178
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
178
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
179 179
     $modpw = $bigbluebuttonbn->moderatorpass;
180 180
 
181 181
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
236 236
                                                               'bigbluebuttonbnid' => $bigbluebuttonbn->id,
237 237
                                                               'userid' => $user->id,
238
-                                                              'log' => 'Join', ), '*');
238
+                                                              'log' => 'Join',), '*');
239 239
 
240 240
     if ($completed > 0) {
241
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
242
-            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
241
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
242
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
243 243
             get_string('view_message_times', 'bigbluebuttonbn');
244 244
     }
245 245
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
     $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id,
259 259
                                                               'bigbluebuttonbnid' => $bigbluebuttonbn->id,
260 260
                                                               'userid' => $user->id,
261
-                                                              'log' => 'Join', ), '*', IGNORE_MULTIPLE);
261
+                                                              'log' => 'Join',), '*', IGNORE_MULTIPLE);
262 262
 
263 263
     return $completed > 0;
264 264
 }
@@ -328,16 +328,16 @@  discard block
 block discarded – undo
328 328
     if ($bigbluebuttonbn->visible) {
329 329
         $classes = 'class="dimmed" ';
330 330
     }
331
-    $str = '<div class="bigbluebuttonbn overview">'."\n";
332
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
333
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
334
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
335
-    $str .= '  </div>'."\n";
336
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
337
-        '</div>'."\n";
338
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
339
-      .'</div>'."\n";
340
-    $str .= '</div>'."\n";
331
+    $str = '<div class="bigbluebuttonbn overview">' . "\n";
332
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
333
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
334
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
335
+    $str .= '  </div>' . "\n";
336
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
337
+        '</div>' . "\n";
338
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
339
+      .'</div>' . "\n";
340
+    $str .= '</div>' . "\n";
341 341
 
342 342
     return $str;
343 343
 }
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
     /* Now that an id was assigned, generate and set the meetingid property based on
426 426
      * [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) */
427 427
     if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) {
428
-        $meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
428
+        $meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
429 429
         $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $bigbluebuttonbn->id));
430 430
 
431 431
         $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn');
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
     if (count($files) == 1) {
508 508
         // Get the first (and only) file.
509 509
         $file = reset($files);
510
-        $filesrc = '/'.$file->get_filename();
510
+        $filesrc = '/' . $file->get_filename();
511 511
     }
512 512
     // Set the presentation column in the bigbluebuttonbn table.
513 513
     $DB->set_field('bigbluebuttonbn', 'presentation', $filesrc, array('id' => $bigbluebuttonbnid));
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
         return false;
565 565
     }
566 566
 
567
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
567
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
568 568
     $fs = get_file_storage();
569 569
     $file = $fs->get_file_by_hash(sha1($fullpath));
570 570
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
locallib.php 3 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
56 56
 const BIGBLUEBUTTON_EVENT_RECORDING_EDITED = 'recording_edited';
57 57
 const BIGBLUEBUTTON_EVENT_RECORDING_VIEWED = 'recording_viewed';
58 58
 
59
+/**
60
+ * @param string $meta
61
+ */
59 62
 function bigbluebuttonbn_logs(array $bbbsession, $event, array $overrides = [], $meta = null) {
60 63
     global $DB;
61 64
 
@@ -580,6 +583,12 @@  discard block
 block discarded – undo
580 583
     }
581 584
 }
582 585
 
586
+/**
587
+ * @param string $url
588
+ * @param string $data
589
+ *
590
+ * @return string
591
+ */
583 592
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = BIGBLUEBUTTONBN_METHOD_GET,
584 593
     $data = null, $contenttype = 'text/xml') {
585 594
     $c = new curl();
@@ -1515,6 +1524,9 @@  discard block
 block discarded – undo
1515 1524
     return html_writer::div(html_writer::table($table), '', array('id' => 'bigbluebuttonbn_html_table'));
1516 1525
 }
1517 1526
 
1527
+/**
1528
+ * @param integer $len
1529
+ */
1518 1530
 function bigbluebuttonbn_html2text($html, $len) {
1519 1531
     $text = strip_tags($html);
1520 1532
     $text = str_replace('&nbsp;', ' ', $text);
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 // BigBlueButton API Calls.
86 86
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
87 87
     $data = ['meetingID' => $meetingid,
88
-              'fullName' => $username,
89
-              'password' => $pw,
90
-              'logoutURL' => $logouturl,
88
+                'fullName' => $username,
89
+                'password' => $pw,
90
+                'logoutURL' => $logouturl,
91 91
             ];
92 92
 
93 93
     if (!is_null($configtoken)) {
@@ -188,24 +188,24 @@  discard block
 block discarded – undo
188 188
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
189 189
     $xml = bigbluebuttonbn_wrap_xml_load_file(
190 190
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
191
-      );
191
+        );
192 192
 
193 193
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
194 194
         // Meeting info was returned.
195 195
         return array('returncode' => $xml->returncode,
196
-                     'meetingID' => $xml->meetingID,
197
-                     'moderatorPW' => $xml->moderatorPW,
198
-                     'attendeePW' => $xml->attendeePW,
199
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
200
-                     'running' => $xml->running,
201
-                     'recording' => $xml->recording,
202
-                     'startTime' => $xml->startTime,
203
-                     'endTime' => $xml->endTime,
204
-                     'participantCount' => $xml->participantCount,
205
-                     'moderatorCount' => $xml->moderatorCount,
206
-                     'attendees' => $xml->attendees,
207
-                     'metadata' => $xml->metadata,
208
-                   );
196
+                        'meetingID' => $xml->meetingID,
197
+                        'moderatorPW' => $xml->moderatorPW,
198
+                        'attendeePW' => $xml->attendeePW,
199
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
200
+                        'running' => $xml->running,
201
+                        'recording' => $xml->recording,
202
+                        'startTime' => $xml->startTime,
203
+                        'endTime' => $xml->endTime,
204
+                        'participantCount' => $xml->participantCount,
205
+                        'moderatorCount' => $xml->moderatorCount,
206
+                        'attendees' => $xml->attendees,
207
+                        'metadata' => $xml->metadata,
208
+                    );
209 209
     }
210 210
 
211 211
     if ($xml) {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         // Do getRecordings is executed using a method GET (supported by all versions of BBB).
270 270
         $xml = bigbluebuttonbn_wrap_xml_load_file(
271 271
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getRecordings', ['meetingID' => implode(',', $mids)])
272
-          );
272
+            );
273 273
         if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
274 274
             // If there were meetings already created.
275 275
             foreach ($xml->recordings->recording as $recording) {
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 function bigbluebuttonbn_get_default_config_xml() {
333 333
     $xml = bigbluebuttonbn_wrap_xml_load_file(
334 334
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
335
-      );
335
+        );
336 336
 
337 337
     return $xml;
338 338
 }
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
     foreach ($ids as $id) {
407 407
         $xml = bigbluebuttonbn_wrap_xml_load_file(
408 408
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
409
-          );
409
+            );
410 410
         if ($xml && $xml->returncode != 'SUCCESS') {
411 411
             return false;
412 412
         }
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
     foreach ($ids as $id) {
425 425
         $xml = bigbluebuttonbn_wrap_xml_load_file(
426 426
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
427
-          );
427
+            );
428 428
         if ($xml && $xml->returncode != 'SUCCESS') {
429 429
             return false;
430 430
         }
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     foreach ($ids as $id) {
443 443
         $xml = bigbluebuttonbn_wrap_xml_load_file(
444 444
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
445
-          );
445
+            );
446 446
         if ($xml && $xml->returncode != 'SUCCESS') {
447 447
             return false;
448 448
         }
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
502 502
     $xml = bigbluebuttonbn_wrap_xml_load_file(
503 503
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
504
-      );
504
+        );
505 505
 
506 506
     if ($xml) {
507 507
         // If the xml packet returned failure it displays the message to the user.
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 function bigbluebuttonbn_is_meeting_running($meetingid) {
519 519
     $xml = bigbluebuttonbn_wrap_xml_load_file(
520 520
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('isMeetingRunning', ['meetingID' => $meetingid])
521
-      );
521
+        );
522 522
 
523 523
     if ($xml && $xml->returncode == 'SUCCESS') {
524 524
         return ($xml->running == 'true');
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 function bigbluebuttonbn_get_server_version() {
531 531
     $xml = bigbluebuttonbn_wrap_xml_load_file(
532 532
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
533
-      );
533
+        );
534 534
 
535 535
     if ($xml && $xml->returncode == 'SUCCESS') {
536 536
         return $xml->version;
@@ -591,10 +591,10 @@  discard block
 block discarded – undo
591 591
 
592 592
         $options = array();
593 593
         $options['CURLOPT_HTTPHEADER'] = array(
594
-                 'Content-Type: '.$contenttype,
595
-                 'Content-Length: '.strlen($data),
596
-                 'Content-Language: en-US',
597
-               );
594
+                    'Content-Type: '.$contenttype,
595
+                    'Content-Length: '.strlen($data),
596
+                    'Content-Language: en-US',
597
+                );
598 598
 
599 599
         return $c->post($url, $data, $options);
600 600
     }
@@ -673,18 +673,18 @@  discard block
 block discarded – undo
673 673
         'all' => array(
674 674
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
675 675
             'children' => []
676
-          )
677
-      );
676
+            )
677
+        );
678 678
 
679 679
     $data['role'] = array(
680 680
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
681 681
         'children' => bigbluebuttonbn_get_roles_select($context)
682
-      );
682
+        );
683 683
 
684 684
     $data['user'] = array(
685 685
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
686 686
         'children' => bigbluebuttonbn_get_users_select($context)
687
-      );
687
+        );
688 688
 
689 689
     return $data;
690 690
 }
@@ -731,9 +731,9 @@  discard block
 block discarded – undo
731 731
         }
732 732
 
733 733
         $participantlistarray[] = array(
734
-              'selectiontype' => 'role',
735
-              'selectionid' => $moderatordefault,
736
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
734
+                'selectiontype' => 'role',
735
+                'selectionid' => $moderatordefault,
736
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
737 737
     }
738 738
 
739 739
     return $participantlistarray;
@@ -745,11 +745,11 @@  discard block
 block discarded – undo
745 745
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
746 746
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
747 747
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
748
-          ],
748
+            ],
749 749
         'type_selected' => 'all',
750 750
         'options' => ['all' => '---------------'],
751 751
         'selected' => 'all',
752
-      ];
752
+        ];
753 753
 }
754 754
 
755 755
 function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) {
@@ -880,8 +880,8 @@  discard block
 block discarded – undo
880 880
     }
881 881
 
882 882
     $parray = array('url' => $purl, 'name' => $pname,
883
-                               'icon' => $picon,
884
-                               'mimetype_description' => $pmimetypedescrip);
883
+                                'icon' => $picon,
884
+                                'mimetype_description' => $pmimetypedescrip);
885 885
 
886 886
     return $parray;
887 887
 }
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
     }
962 962
 
963 963
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
964
-      array($eventproperties));
964
+        array($eventproperties));
965 965
     $event->trigger();
966 966
 }
967 967
 
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
     // Ping again and refresh the cache.
1010 1010
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1011 1011
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1012
-      );
1012
+        );
1013 1013
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1014 1014
 
1015 1015
     return $meetinginfo;
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
         $actionbar .= bigbluebuttonbn_actionbar_render_button(
1151 1151
             $recording,
1152 1152
             bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool)
1153
-          );
1153
+            );
1154 1154
     }
1155 1155
     $head = html_writer::start_tag('div', array(
1156 1156
         'id' => 'recording-actionbar-' . $recording['recordID'],
@@ -1233,8 +1233,8 @@  discard block
 block discarded – undo
1233 1233
 
1234 1234
     $id = 'playbacks-'.$recording['recordID'];
1235 1235
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1236
-          'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'],
1237
-          'title' => $title, $visibility => $visibility));
1236
+            'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'],
1237
+            'title' => $title, $visibility => $visibility));
1238 1238
     foreach ($recording['playbacks'] as $playback) {
1239 1239
         $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1240 1240
         $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid.
@@ -1340,7 +1340,7 @@  discard block
 block discarded – undo
1340 1340
             'onclick' => $onclick,
1341 1341
             'data-action' => $data['action'],
1342 1342
             'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID'])
1343
-          );
1343
+            );
1344 1344
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
1345 1345
     }
1346 1346
 
@@ -1679,8 +1679,8 @@  discard block
 block discarded – undo
1679 1679
     $activitytime = '';
1680 1680
     if ($time) {
1681 1681
         $activitytime = calendar_day_representation($time).' '.
1682
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1683
-          calendar_time_representation($time);
1682
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1683
+            calendar_time_representation($time);
1684 1684
     }
1685 1685
 
1686 1686
     return $activitytime;
Please login to merge, or discard this patch.
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once(dirname(__FILE__).'/lib.php');
30
+require_once(dirname(__FILE__) . '/lib.php');
31 31
 
32 32
 const BIGBLUEBUTTONBN_FORCED = true;
33 33
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     if (isset($meta)) {
77 77
         $log->meta = $meta;
78 78
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
79
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
79
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
80 80
     }
81 81
 
82 82
     $DB->insert_record('bigbluebuttonbn_logs', $log);
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 
122 122
     if (!is_null($pname) && !is_null($purl)) {
123 123
         $method = BIGBLUEBUTTONBN_METHOD_POST;
124
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='".
125
-            $purl."' /></module></modules>";
124
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='" . $pname . "'><document url='" .
125
+            $purl . "' /></module></modules>";
126 126
     }
127 127
 
128 128
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                                 'moderatorPW' => $meeting->moderatorPW,
168 168
                                 'attendeePW' => $meeting->attendeePW,
169 169
                                 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded,
170
-                                'running' => $meeting->running, );
170
+                                'running' => $meeting->running,);
171 171
         }
172 172
 
173 173
         return $meetings;
@@ -308,12 +308,12 @@  discard block
 block discarded – undo
308 308
 function bigbluebuttonbn_get_recordings_imported_array($courseid, $bigbluebuttonbnid = null, $subset = true) {
309 309
     global $DB;
310 310
 
311
-    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
312
-        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
311
+    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
312
+        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
313 313
     if ($bigbluebuttonbnid === null) {
314
-        $select = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
314
+        $select = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
315 315
     } else if ($subset) {
316
-        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
316
+        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
317 317
     }
318 318
     $recordsimported = $DB->get_records_select('bigbluebuttonbn_logs', $select);
319 319
 
@@ -340,37 +340,37 @@  discard block
 block discarded – undo
340 340
 function bigbluebuttonbn_get_default_config_xml_array() {
341 341
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
342 342
 
343
-    return (array) $defaultconfigxml;
343
+    return (array)$defaultconfigxml;
344 344
 }
345 345
 
346 346
 function bigbluebuttonbn_get_recording_array_value($recording) {
347 347
     // Add formats.
348 348
     $playbackarray = array();
349 349
     foreach ($recording->playback->format as $format) {
350
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
351
-            'url' => (string) $format->url, 'length' => (string) $format->length);
350
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
351
+            'url' => (string)$format->url, 'length' => (string)$format->length);
352 352
         // Add preview per format when existing.
353 353
         if ($format->preview) {
354 354
             $imagesarray = array();
355 355
             foreach ($format->preview->images->image as $image) {
356
-                $imagearray = array('url' => (string) $image);
356
+                $imagearray = array('url' => (string)$image);
357 357
                 foreach ($image->attributes() as $attkey => $attvalue) {
358
-                    $imagearray[$attkey] = (string) $attvalue;
358
+                    $imagearray[$attkey] = (string)$attvalue;
359 359
                 }
360 360
                 array_push($imagesarray, $imagearray);
361 361
             }
362
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
362
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
363 363
         }
364 364
     }
365 365
 
366 366
     // Add the metadata to the recordings array.
367 367
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
368
-    $recordingarray = array('recordID' => (string) $recording->recordID,
369
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
370
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
371
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
368
+    $recordingarray = array('recordID' => (string)$recording->recordID,
369
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
370
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
371
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
372 372
     if (isset($recording->protected)) {
373
-        $recordingarray['protected'] = (string) $recording->protected;
373
+        $recordingarray['protected'] = (string)$recording->protected;
374 374
     }
375 375
     // Force protected.
376 376
     $recordingarray['protected'] = 'false';
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         if (is_object($value)) {
384 384
             $value = '';
385 385
         }
386
-        $metadataarray['meta_'.$key] = $value;
386
+        $metadataarray['meta_' . $key] = $value;
387 387
     }
388 388
     return $metadataarray;
389 389
 }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     $ids = explode(',', $recordids);
442 442
     foreach ($ids as $id) {
443 443
         $xml = bigbluebuttonbn_wrap_xml_load_file(
444
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
444
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
445 445
           );
446 446
         if ($xml && $xml->returncode != 'SUCCESS') {
447 447
             return false;
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
             return $xml;
562 562
         } catch (Exception $e) {
563 563
             libxml_use_internal_errors($previous);
564
-            $error = 'Caught exception: '.$e->getMessage();
564
+            $error = 'Caught exception: ' . $e->getMessage();
565 565
             debugging($error, DEBUG_DEVELOPER);
566 566
             return null;
567 567
         }
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
574 574
         return $response;
575 575
     } catch (Exception $e) {
576
-        $error = 'Caught exception: '.$e->getMessage();
576
+        $error = 'Caught exception: ' . $e->getMessage();
577 577
         debugging($error, DEBUG_DEVELOPER);
578 578
         libxml_use_internal_errors($previous);
579 579
         return null;
@@ -591,8 +591,8 @@  discard block
 block discarded – undo
591 591
 
592 592
         $options = array();
593 593
         $options['CURLOPT_HTTPHEADER'] = array(
594
-                 'Content-Type: '.$contenttype,
595
-                 'Content-Length: '.strlen($data),
594
+                 'Content-Type: ' . $contenttype,
595
+                 'Content-Length: ' . strlen($data),
596 596
                  'Content-Language: en-US',
597 597
                );
598 598
 
@@ -609,9 +609,9 @@  discard block
 block discarded – undo
609 609
     if ($userroles) {
610 610
         $where = '';
611 611
         foreach ($userroles as $value) {
612
-            $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid;
612
+            $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid;
613 613
         }
614
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
614
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
615 615
     }
616 616
 
617 617
     return $userroles;
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 }
625 625
 
626 626
 function bigbluebuttonbn_get_users(context $context = null) {
627
-    $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
627
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
628 628
     foreach ($users as $key => $value) {
629 629
         $users[$key] = fullname($value);
630 630
     }
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 }
633 633
 
634 634
 function bigbluebuttonbn_get_users_select(context $context = null) {
635
-    $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
635
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
636 636
     foreach ($users as $key => $value) {
637 637
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
638 638
     }
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 }
641 641
 
642 642
 function bigbluebuttonbn_get_roles(context $context = null) {
643
-    $roles = (array) role_get_names($context);
643
+    $roles = (array)role_get_names($context);
644 644
     foreach ($roles as $key => $value) {
645 645
         $roles[$key] = $value->localname;
646 646
     }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 }
649 649
 
650 650
 function bigbluebuttonbn_get_roles_select(context $context = null) {
651
-    $roles = (array) role_get_names($context);
651
+    $roles = (array)role_get_names($context);
652 652
     foreach ($roles as $key => $value) {
653 653
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
654 654
     }
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 }
657 657
 
658 658
 function bigbluebuttonbn_get_role($id) {
659
-    $roles = (array) role_get_names();
659
+    $roles = (array)role_get_names();
660 660
     if (is_numeric($id)) {
661 661
         return $roles[$id];
662 662
     }
@@ -820,9 +820,9 @@  discard block
 block discarded – undo
820 820
     $isunique = true;
821 821
     if ($voicebridge != 0) {
822 822
         $table = 'bigbluebuttonbn';
823
-        $select = 'voicebridge = '.$voicebridge;
823
+        $select = 'voicebridge = ' . $voicebridge;
824 824
         if ($id) {
825
-            $select .= ' AND id <> '.$id;
825
+            $select .= ' AND id <> ' . $id;
826 826
         }
827 827
         if ($DB->get_records_select($table, $select)) {
828 828
             $isunique = false;
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
     $mt = microtime();
891 891
     $rand = mt_rand();
892 892
 
893
-    return md5($mt.$rand);
893
+    return md5($mt . $rand);
894 894
 }
895 895
 
896 896
 function bigbluebuttonbn_random_password($length = 8) {
@@ -902,41 +902,41 @@  discard block
 block discarded – undo
902 902
 
903 903
 function bigbluebuttonbn_events() {
904 904
     return array(
905
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
906
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
907
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
908
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
909
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
910
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
911
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
912
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
913
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
914
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
915
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
916
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
917
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
918
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
919
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
905
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
906
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
907
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
908
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
909
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
910
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
911
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
912
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
913
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
914
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
915
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
916
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
917
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
918
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
919
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
920 920
     );
921 921
 }
922 922
 
923 923
 function bigbluebuttonbn_events_action() {
924 924
     return array(
925
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
926
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
927
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
928
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
929
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
930
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
931
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
932
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
933
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
934
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
935
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
936
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
937
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
938
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
939
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
925
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
926
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
927
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
928
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
929
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
930
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
931
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
932
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
933
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
934
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
935
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
936
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
937
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
938
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
939
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
940 940
     );
941 941
 }
942 942
 
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
         $eventproperties['other'] = $options['other'];
961 961
     }
962 962
 
963
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
963
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
964 964
       array($eventproperties));
965 965
     $event->trigger();
966 966
 }
@@ -1003,11 +1003,11 @@  discard block
 block discarded – undo
1003 1003
     $now = time();
1004 1004
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1005 1005
         // Use the value in the cache.
1006
-        return (array) json_decode($result['meeting_info']);
1006
+        return (array)json_decode($result['meeting_info']);
1007 1007
     }
1008 1008
 
1009 1009
     // Ping again and refresh the cache.
1010
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1010
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1011 1011
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1012 1012
       );
1013 1013
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1065,8 +1065,8 @@  discard block
 block discarded – undo
1065 1065
  * @param string $configxml
1066 1066
  */
1067 1067
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1068
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1069
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1068
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1069
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1070 1070
 
1071 1071
     return $configxmlparams;
1072 1072
 }
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
  * @param string $configxml
1077 1077
  */
1078 1078
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1079
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1079
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1080 1080
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1081 1081
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
1082 1082
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1092 1092
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1093
-    $configxmlarray = (array) $configxml;
1093
+    $configxmlarray = (array)$configxml;
1094 1094
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1095 1095
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1096 1096
         return '';
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
         $starttime = $starttime - ($starttime % 1000);
1128 1128
 
1129 1129
         // Set formatted date.
1130
-        $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1130
+        $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1131 1131
         $row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1132 1132
 
1133 1133
         // Set formatted duration.
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
     }
1199 1199
 
1200 1200
     $recordingpreview = html_writer::start_tag('div',
1201
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1201
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1202 1202
     foreach ($recording['playbacks'] as $playback) {
1203 1203
         if (isset($playback['preview'])) {
1204 1204
             foreach ($playback['preview'] as $image) {
@@ -1231,19 +1231,19 @@  discard block
 block discarded – undo
1231 1231
         $visibility = 'hidden ';
1232 1232
     }
1233 1233
 
1234
-    $id = 'playbacks-'.$recording['recordID'];
1234
+    $id = 'playbacks-' . $recording['recordID'];
1235 1235
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1236 1236
           'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'],
1237 1237
           'title' => $title, $visibility => $visibility));
1238 1238
     foreach ($recording['playbacks'] as $playback) {
1239 1239
         $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1240
-        $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid.
1241
-            '&href='.urlencode($playback['url']).'&rid='.$recording['recordID'];
1242
-        $linkattributes = array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'),
1240
+        $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn=' . $bigbluebuttonbnid .
1241
+            '&href=' . urlencode($playback['url']) . '&rid=' . $recording['recordID'];
1242
+        $linkattributes = array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'),
1243 1243
             'class' => 'btn btn-sm btn-default', 'onclick' => $onclick,
1244 1244
             'data-action' => 'play', 'data-href' => $href);
1245
-        $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_'.$playback['type'],
1246
-            'bigbluebuttonbn'), null, $linkattributes).'&#32;';
1245
+        $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_' . $playback['type'],
1246
+            'bigbluebuttonbn'), null, $linkattributes) . '&#32;';
1247 1247
     }
1248 1248
     $recordingtypes .= html_writer::end_tag('div');
1249 1249
 
@@ -1328,11 +1328,11 @@  discard block
 block discarded – undo
1328 1328
         $target .= '-' . $data['target'];
1329 1329
     }
1330 1330
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1331
-    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);';
1331
+    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);';
1332 1332
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1333 1333
         // With icon for $manageaction.
1334 1334
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1335
-        $icon = new pix_icon('i/'.$data['tag'],
1335
+        $icon = new pix_icon('i/' . $data['tag'],
1336 1336
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1337 1337
             'moodle', $iconattributes);
1338 1338
         $linkattributes = array(
@@ -1423,7 +1423,7 @@  discard block
 block discarded – undo
1423 1423
         // There are recordings for this meeting.
1424 1424
         foreach ($recordings as $recording) {
1425 1425
             $row = new html_table_row();
1426
-            $row->id = 'recording-td-'.$recording['recordID'];
1426
+            $row->id = 'recording-td-' . $recording['recordID'];
1427 1427
             $row->attributes['data-imported'] = 'false';
1428 1428
             $texthead = '';
1429 1429
             $texttail = '';
@@ -1437,9 +1437,9 @@  discard block
 block discarded – undo
1437 1437
             $rowdata = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools);
1438 1438
             if ($rowdata != null) {
1439 1439
                 $rowdata->date_formatted = str_replace(' ', '&nbsp;', $rowdata->date_formatted);
1440
-                $row->cells = array($texthead.$rowdata->recording.$texttail,
1441
-                    $texthead.$rowdata->activity.$texttail, $texthead.$rowdata->description.$texttail,
1442
-                    $rowdata->preview, $texthead.$rowdata->date_formatted.$texttail,
1440
+                $row->cells = array($texthead . $rowdata->recording . $texttail,
1441
+                    $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1442
+                    $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1443 1443
                     $rowdata->duration_formatted);
1444 1444
                 if ($bbbsession['managerecordings']) {
1445 1445
                     $row->cells[] = $rowdata->actionbar;
@@ -1461,9 +1461,9 @@  discard block
 block discarded – undo
1461 1461
     // Build the message_body.
1462 1462
     $msg->activity_type = '';
1463 1463
     $msg->activity_title = $bigbluebuttonbn->name;
1464
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1465
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1466
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1464
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1465
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1466
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1467 1467
 
1468 1468
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1469 1469
 }
@@ -1556,15 +1556,15 @@  discard block
 block discarded – undo
1556 1556
 
1557 1557
     // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'.
1558 1558
     $select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'";
1559
-    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
1560
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1559
+    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
1560
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1561 1561
     if ($bigbluebuttonbnid === null) {
1562 1562
         $select = "course = '{$courseid}'";
1563
-        $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1563
+        $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1564 1564
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1565 1565
     } else if ($subset) {
1566 1566
         $select = "id = '{$bigbluebuttonbnid}'";
1567
-        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1567
+        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1568 1568
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1569 1569
     }
1570 1570
     $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid');
@@ -1586,7 +1586,7 @@  discard block
 block discarded – undo
1586 1586
     if (!empty($bigbluebuttonbns)) {
1587 1587
         // Prepare select for loading records based on existent bigbluebuttonbns.
1588 1588
         $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
1589
-        $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
1589
+        $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
1590 1590
         // Include only Create events and exclude those with record not true.
1591 1591
         $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
1592 1592
         // Execute select for loading records based on existent bigbluebuttonbns.
@@ -1678,8 +1678,8 @@  discard block
 block discarded – undo
1678 1678
 function bigbluebuttonbn_format_activity_time($time) {
1679 1679
     $activitytime = '';
1680 1680
     if ($time) {
1681
-        $activitytime = calendar_day_representation($time).' '.
1682
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1681
+        $activitytime = calendar_day_representation($time) . ' ' .
1682
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
1683 1683
           calendar_time_representation($time);
1684 1684
     }
1685 1685
 
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
 
1706 1706
 function bigbluebuttonbn_get_moderator_email($context) {
1707 1707
     $moderatoremails = array();
1708
-    $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
1708
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
1709 1709
     $counter = 0;
1710 1710
     foreach ($users as $key => $user) {
1711 1711
         if ($counter == 5) {
Please login to merge, or discard this patch.
classes/locallib/notifier.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         global $USER;
35 35
 
36 36
         // Prepare message.
37
-        $msg = (object) array();
37
+        $msg = (object)array();
38 38
         // Build the message_body.
39 39
         $msg->action = $action;
40 40
         $msg->activity_type = '';
@@ -54,26 +54,26 @@  discard block
 block discarded – undo
54 54
     }
55 55
 
56 56
     public static function notification_msg_html($msg) {
57
-        $messagetext = '<p>'.$msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
58
-            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
59
-        $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.
60
-            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
61
-        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
62
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
63
-            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
64
-        $messagetext .= $msg->activity_title.'</td></tr>'."\n";
65
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
66
-            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
67
-        $messagetext .= $msg->activity_description.'</td></tr>'."\n";
68
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
69
-            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
70
-        $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";
71
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
72
-            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
73
-        $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";
74
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.
75
-            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
76
-        $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
57
+        $messagetext = '<p>' . $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
58
+            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
59
+        $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .
60
+            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
61
+        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
62
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
63
+            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
64
+        $messagetext .= $msg->activity_title . '</td></tr>' . "\n";
65
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
66
+            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
67
+        $messagetext .= $msg->activity_description . '</td></tr>' . "\n";
68
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
69
+            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
70
+        $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";
71
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
72
+            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
73
+        $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";
74
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .
75
+            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
76
+        $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
77 77
         return $messagetext;
78 78
     }
79 79
 
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
         $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
84 84
 
85 85
         // Complete message.
86
-        $msg = (object) array();
86
+        $msg = (object)array();
87 87
         $msg->user_name = fullname($sender);
88 88
         $msg->user_email = $sender->email;
89 89
         $msg->course_name = "$course->fullname";
90
-        $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.
91
-            $msg->user_name.'('.$msg->user_email.') ';
92
-        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
90
+        $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' .
91
+            $msg->user_name . '(' . $msg->user_email . ') ';
92
+        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
93 93
 
94
-        $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
94
+        $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
95 95
         foreach ($users as $user) {
96 96
             if ($user->id != $sender->id) {
97 97
                 message_post_message($sender, $user, $message, FORMAT_HTML);
Please login to merge, or discard this patch.
classes/locallib/bigbluebutton.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,17 +37,17 @@
 block discarded – undo
37 37
      * @return string
38 38
      */
39 39
     public static function action_url($action = '', $data = array(), $metadata = array()) {
40
-        $baseurl = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/'.$action.'?';
40
+        $baseurl = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/' . $action . '?';
41 41
         $params = '';
42 42
 
43 43
         foreach ($data as $key => $value) {
44
-            $params .= '&'.$key.'='.urlencode($value);
44
+            $params .= '&' . $key . '=' . urlencode($value);
45 45
         }
46 46
 
47 47
         foreach ($metadata as $key => $value) {
48
-            $params .= '&'.'meta_'.$key.'='.urlencode($value);
48
+            $params .= '&' . 'meta_' . $key . '=' . urlencode($value);
49 49
         }
50 50
 
51
-        return $baseurl.$params.'&checksum='.sha1($action.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
51
+        return $baseurl . $params . '&checksum=' . sha1($action . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
classes/locallib/config.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -118,28 +118,28 @@
 block discarded – undo
118 118
                  isset($CFG->bigbluebuttonbn['recording_editable']));
119 119
     }
120 120
 
121
-     /**
122
-      * @return array
123
-      */
121
+        /**
122
+         * @return array
123
+         */
124 124
     public static function get_options() {
125 125
         return [
126
-               'version_major' => self::get_moodle_version_major(),
127
-               'voicebridge_editable' => self::get('voicebridge_editable'),
128
-               'recording_default' => self::get('recording_default'),
129
-               'recording_editable' => self::get('recording_editable'),
130
-               'waitformoderator_default' => self::get('waitformoderator_default'),
131
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
132
-               'userlimit_default' => self::get('userlimit_default'),
133
-               'userlimit_editable' => self::get('userlimit_editable'),
134
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
135
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
136
-               'recordings_html_default' => self::get('recordings_html_default'),
137
-               'recordings_html_editable' => self::get('recordings_html_editable'),
138
-               'recordings_deleted_activities_default' => self::get('recordings_deleted_activities_default'),
139
-               'recordings_deleted_activities_editable' => self::get('recordings_deleted_activities_editable'),
140
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
141
-               'instance_type_enabled' => self::recordings_enabled(),
142
-               'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
143
-          ];
126
+                'version_major' => self::get_moodle_version_major(),
127
+                'voicebridge_editable' => self::get('voicebridge_editable'),
128
+                'recording_default' => self::get('recording_default'),
129
+                'recording_editable' => self::get('recording_editable'),
130
+                'waitformoderator_default' => self::get('waitformoderator_default'),
131
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
132
+                'userlimit_default' => self::get('userlimit_default'),
133
+                'userlimit_editable' => self::get('userlimit_editable'),
134
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
135
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
136
+                'recordings_html_default' => self::get('recordings_html_default'),
137
+                'recordings_html_editable' => self::get('recordings_html_editable'),
138
+                'recordings_deleted_activities_default' => self::get('recordings_deleted_activities_default'),
139
+                'recordings_deleted_activities_editable' => self::get('recordings_deleted_activities_editable'),
140
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
141
+                'instance_type_enabled' => self::recordings_enabled(),
142
+                'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
143
+            ];
144 144
     }
145 145
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public static function defaultvalues() {
49 49
         return array(
50
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
51
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
50
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
51
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
52 52
             'importrecordings_enabled' => 'false',
53 53
             'voicebridge_editable' => 'false',
54 54
             'recording_default' => 'true',
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
         global $CFG;
99 99
 
100 100
         if (isset($CFG->bigbluebuttonbn[$setting])) {
101
-            return (string) $CFG->bigbluebuttonbn[$setting];
101
+            return (string)$CFG->bigbluebuttonbn[$setting];
102 102
         }
103 103
 
104
-        if (isset($CFG->{'bigbluebuttonbn_'.$setting})) {
105
-            return (string)$CFG->{'bigbluebuttonbn_'.$setting};
104
+        if (isset($CFG->{'bigbluebuttonbn_' . $setting})) {
105
+            return (string)$CFG->{'bigbluebuttonbn_' . $setting};
106 106
         }
107 107
 
108 108
         return  self::defaultvalue($setting);
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_live_session_event.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
      */
35 35
     protected function init() {
36 36
         parent::init();
37
-        $this->description = "The user with id '$this->userid' triggered action $this->other in a ".
38
-        "bigbluebutton meeting for the bigbluebuttonbn activity with id ".
37
+        $this->description = "The user with id '$this->userid' triggered action $this->other in a " .
38
+        "bigbluebutton meeting for the bigbluebuttonbn activity with id " .
39 39
         "'$this->objectid' for the course id '$this->contextinstanceid'.";
40 40
     }
41 41
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_recording_unprotected.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     protected function init() {
36 36
         parent::init();
37
-        $this->description = "The user with id '$this->userid' has unprotected a recording with id ".
37
+        $this->description = "The user with id '$this->userid' has unprotected a recording with id " .
38 38
             "'$this->other' in the course id '$this->contextinstanceid'.";
39 39
     }
40 40
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_meeting_created.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     protected function init() {
36 36
         parent::init();
37
-        $this->description = "The user with id '$this->userid' created a bigbluebutton meeting for".
37
+        $this->description = "The user with id '$this->userid' created a bigbluebutton meeting for" .
38 38
             "the bigbluebuttonbn activity with id '$this->objectid' for the course id '$this->contextinstanceid'.";
39 39
     }
40 40
 
Please login to merge, or discard this patch.