Completed
Pull Request — master (#141)
by Jesus
01:53
created
bbb_view.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -304,10 +304,10 @@  discard block
 block discarded – undo
304 304
  */
305 305
 function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession) {
306 306
     $data = ['meetingID' => $bbbsession['meetingid'],
307
-              'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64),
308
-              'attendeePW' => $bbbsession['viewerPW'],
309
-              'moderatorPW' => $bbbsession['modPW'],
310
-              'logoutURL' => $bbbsession['logoutURL'],
307
+                'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64),
308
+                'attendeePW' => $bbbsession['viewerPW'],
309
+                'moderatorPW' => $bbbsession['modPW'],
310
+                'logoutURL' => $bbbsession['logoutURL'],
311 311
             ];
312 312
     $data['record'] = bigbluebutton_bbb_view_create_meeting_data_record($bbbsession['record']);
313 313
     // Check if auto_start_record is enable.
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
             '%duration%',
330 330
             (string) $durationtime,
331 331
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
332
-          );
332
+            );
333 333
     }
334 334
     $voicebridge = intval($bbbsession['voicebridge']);
335 335
     if ($voicebridge > 0 && $voicebridge < 79999) {
@@ -380,22 +380,22 @@  discard block
 block discarded – undo
380 380
 function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) {
381 381
     global $USER;
382 382
     $metadata = ['bbb-origin' => $bbbsession['origin'],
383
-                 'bbb-origin-version' => $bbbsession['originVersion'],
384
-                 'bbb-origin-server-name' => $bbbsession['originServerName'],
385
-                 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
386
-                 'bbb-origin-tag' => $bbbsession['originTag'],
387
-                 'bbb-context' => $bbbsession['course']->fullname,
388
-                 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64),
389
-                 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
390
-                 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
383
+                    'bbb-origin-version' => $bbbsession['originVersion'],
384
+                    'bbb-origin-server-name' => $bbbsession['originServerName'],
385
+                    'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
386
+                    'bbb-origin-tag' => $bbbsession['originTag'],
387
+                    'bbb-context' => $bbbsession['course']->fullname,
388
+                    'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64),
389
+                    'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
390
+                    'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
391 391
                 ];
392 392
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
393 393
         $metadata["bn-recording-status"] = json_encode(
394 394
             array(
395 395
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
396 396
                 'context' => $bbbsession['bigbluebuttonbnURL']
397
-              )
398
-          );
397
+                )
398
+            );
399 399
     }
400 400
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
401 401
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
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
 global $SESSION;
30 30
 
@@ -70,23 +70,23 @@  discard block
 block discarded – undo
70 70
     if (is_null($serverversion)) {
71 71
         if ($bbbsession['administrator']) {
72 72
             print_error('view_error_unable_join', 'bigbluebuttonbn',
73
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
73
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
74 74
             exit;
75 75
         }
76 76
         if ($bbbsession['moderator']) {
77 77
             print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
78
-                $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
78
+                $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
79 79
             exit;
80 80
         }
81 81
         print_error('view_error_unable_join_student', 'bigbluebuttonbn',
82
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
82
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
83 83
         exit;
84 84
     }
85
-    $bbbsession['serverversion'] = (string) $serverversion;
85
+    $bbbsession['serverversion'] = (string)$serverversion;
86 86
 
87 87
     // Operation URLs.
88 88
     $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
89
-    $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .
89
+    $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
90 90
         '&bn=' . $bbbsession['bigbluebuttonbn']->id;
91 91
     $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
92 92
         'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
         }
115 115
 
116 116
         // Assign group default values.
117
-        $bbbsession['meetingid'] .= '['.$bbbsession['group'].']';
118
-        $bbbsession['meetingname'] .= ' ('.$groupname.')';
117
+        $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']';
118
+        $bbbsession['meetingname'] .= ' (' . $groupname . ')';
119 119
     }
120 120
 
121 121
     // Initialize session variable used across views.
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         }
179 179
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
180 180
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
181
-            header('Location: '.$bbbsession['logoutURL']);
181
+            header('Location: ' . $bbbsession['logoutURL']);
182 182
             break;
183 183
         }
184 184
         // As the meeting doesn't exist, try to create it.
@@ -192,16 +192,16 @@  discard block
 block discarded – undo
192 192
             // The server is unreachable.
193 193
             if ($bbbsession['administrator']) {
194 194
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
195
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
195
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
196 196
                 break;
197 197
             }
198 198
             if ($bbbsession['moderator']) {
199 199
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
200
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
200
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
201 201
                 break;
202 202
             }
203 203
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
204
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
204
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
205 205
             break;
206 206
         }
207 207
         if ($response['returncode'] == 'FAILED') {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn);
223 223
         // Internal logger: Insert a record with the meeting created.
224 224
         $overrides = array('meetingid' => $bbbsession['meetingid']);
225
-        $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
225
+        $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
226 226
         bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta);
227 227
         // Since the meeting is already running, we just join the session.
228 228
         bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn, $origin);
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         $overrides = array('meetingid' => $bbbsession['meetingid']);
237 237
         bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_PLAYED, $overrides);
238 238
         // Execute the redirect.
239
-        header('Location: '.urldecode($href));
239
+        header('Location: ' . urldecode($href));
240 240
         break;
241 241
     default:
242 242
         bigbluebutton_bbb_view_close_window();
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
         $data['welcome'] .= '<br><br>';
331 331
         $data['welcome'] .= str_replace(
332 332
             '%duration%',
333
-            (string) $durationtime,
333
+            (string)$durationtime,
334 334
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
335 335
           );
336 336
     }
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
     $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE);
421 421
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
422 422
         // No more users allowed to join.
423
-        header('Location: '.$bbbsession['logoutURL']);
423
+        header('Location: ' . $bbbsession['logoutURL']);
424 424
         return;
425 425
     }
426 426
     // Build the URL.
@@ -434,13 +434,13 @@  discard block
 block discarded – undo
434 434
     bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_join'], $bigbluebuttonbn);
435 435
     // Internal logger: Instert a record with the meeting created.
436 436
     $overrides = array('meetingid' => $bbbsession['meetingid']);
437
-    $meta = '{"origin":'.$origin.'}';
437
+    $meta = '{"origin":' . $origin . '}';
438 438
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_JOIN, $overrides, $meta);
439 439
     // Before executing the redirect, increment the number of participants.
440 440
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
441 441
         ($bbbsession['administrator'] || $bbbsession['moderator']));
442 442
     // Execute the redirect.
443
-    header('Location: '.$joinurl);
443
+    header('Location: ' . $joinurl);
444 444
 }
445 445
 
446 446
 /**
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function bigbluebutton_bbb_view_errors($serrors, $id) {
454 454
     global $CFG, $OUTPUT;
455
-    $errors = (array) json_decode(urldecode($serrors));
455
+    $errors = (array)json_decode(urldecode($serrors));
456 456
     $msgerrors = '';
457 457
     foreach ($errors as $error) {
458
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
458
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
459 459
     }
460 460
     echo $OUTPUT->header();
461 461
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
462
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
462
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
463 463
     echo $OUTPUT->footer();
464 464
 }
Please login to merge, or discard this patch.
classes/locallib/mobileview.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $session['importrecordings'] = ($session['managerecordings']);
59 59
         $session['modPW'] = $session['bigbluebuttonbn']->moderatorpass;
60 60
         $session['viewerPW'] = $session['bigbluebuttonbn']->viewerpass;
61
-        $session['meetingid'] = $session['bigbluebuttonbn']->meetingid.'-'.$session['course']->id.'-'.
61
+        $session['meetingid'] = $session['bigbluebuttonbn']->meetingid . '-' . $session['course']->id . '-' .
62 62
             $session['bigbluebuttonbn']->id;
63 63
         $session['meetingname'] = $session['bigbluebuttonbn']->name;
64 64
         $session['meetingdescription'] = $session['bigbluebuttonbn']->intro;
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
         if ($session['bigbluebuttonbn']->record) {
91 91
             // Check if is enable record all from start.
92 92
             if ($session['recordallfromstart']) {
93
-                $session['welcome'] .= '<br><br>'.get_string('bbbrecordallfromstartwarning',
93
+                $session['welcome'] .= '<br><br>' . get_string('bbbrecordallfromstartwarning',
94 94
                         'bigbluebuttonbn');
95 95
             } else {
96
-                $session['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
96
+                $session['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
97 97
             }
98 98
         }
99 99
         $session['openingtime'] = $session['bigbluebuttonbn']->openingtime;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $session['originServerName'] = $parsedurl['host'];
107 107
         $session['originServerUrl'] = $CFG->wwwroot;
108 108
         $session['originServerCommonName'] = '';
109
-        $session['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
109
+        $session['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
110 110
         $session['bnserver'] = bigbluebuttonbn_is_bn_server();
111 111
         $session['clienttype'] = \mod_bigbluebuttonbn\locallib\config::get('clienttype_default');
112 112
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
             $data['welcome'] .= '<br><br>';
229 229
             $data['welcome'] .= str_replace(
230 230
                 '%duration%',
231
-                (string) $durationtime,
231
+                (string)$durationtime,
232 232
                 get_string('bbbdurationwarning', 'bigbluebuttonbn')
233 233
             );
234 234
         }
Please login to merge, or discard this patch.
classes/search/tags.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
  */
25 25
 
26 26
 namespace mod_bigbluebuttonbn\search;
27
-use core_tag\output\tag;
28 27
 
29 28
 defined('MOODLE_INTERNAL') || die();
30 29
 
Please login to merge, or discard this patch.
lib.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  * Remove this block when restored
62 62
  */
63 63
 
64
- /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */
64
+    /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */
65 65
 const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/';
66 66
 /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */
67 67
 const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6';
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     $sql = "SELECT count(*) FROM {bigbluebuttonbn_logs} ";
269 269
     $sql .= "WHERE courseid = ? AND bigbluebuttonbnid = ? AND userid = ? AND (log = ? OR log = ?)";
270 270
     $result = $DB->get_record_sql($sql, array($course->id, $bigbluebuttonbn->id, $user->id,
271
-                                              BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED));
271
+                                                BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED));
272 272
     return (int)$result->count;
273 273
 }
274 274
 
@@ -356,12 +356,12 @@  discard block
 block discarded – undo
356 356
     $str  = '<div class="bigbluebuttonbn overview">'."\n";
357 357
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
358 358
     $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
359
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
359
+        '">'.$bigbluebuttonbn->name.'</a>'."\n";
360 360
     $str .= '  </div>'."\n";
361 361
     $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
362 362
         '</div>'."\n";
363 363
     $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
364
-      .'</div>'."\n";
364
+        .'</div>'."\n";
365 365
     $str .= '</div>'."\n";
366 366
     return $str;
367 367
 }
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
             $bigbluebuttonbn->coursemodule,
560 560
             'bigbluebuttonbn',
561 561
             $bigbluebuttonbn->id, $bigbluebuttonbn->completionexpected
562
-          );
562
+            );
563 563
     }
564 564
 }
565 565
 /**
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -28,23 +28,23 @@  discard block
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once($CFG->dirroot.'/calendar/lib.php');
32
-require_once($CFG->dirroot.'/message/lib.php');
33
-require_once($CFG->dirroot.'/mod/lti/OAuth.php');
34
-require_once($CFG->dirroot.'/tag/lib.php');
35
-require_once($CFG->libdir.'/accesslib.php');
36
-require_once($CFG->libdir.'/completionlib.php');
37
-require_once($CFG->libdir.'/datalib.php');
38
-require_once($CFG->libdir.'/enrollib.php');
39
-require_once($CFG->libdir.'/filelib.php');
40
-require_once($CFG->libdir.'/formslib.php');
31
+require_once($CFG->dirroot . '/calendar/lib.php');
32
+require_once($CFG->dirroot . '/message/lib.php');
33
+require_once($CFG->dirroot . '/mod/lti/OAuth.php');
34
+require_once($CFG->dirroot . '/tag/lib.php');
35
+require_once($CFG->libdir . '/accesslib.php');
36
+require_once($CFG->libdir . '/completionlib.php');
37
+require_once($CFG->libdir . '/datalib.php');
38
+require_once($CFG->libdir . '/enrollib.php');
39
+require_once($CFG->libdir . '/filelib.php');
40
+require_once($CFG->libdir . '/formslib.php');
41 41
 
42 42
 // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility.
43 43
 if (!class_exists('\Firebase\JWT\JWT')) {
44 44
     if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) {
45 45
         require_once($CFG->libdir . '/php-jwt/src/JWT.php');
46 46
     } else {
47
-        require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php');
47
+        require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php');
48 48
     }
49 49
 }
50 50
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     $CFG->bigbluebuttonbn = array();
53 53
 }
54 54
 
55
-if (file_exists(dirname(__FILE__).'/config.php')) {
56
-    require_once(dirname(__FILE__).'/config.php');
55
+if (file_exists(dirname(__FILE__) . '/config.php')) {
56
+    require_once(dirname(__FILE__) . '/config.php');
57 57
 }
58 58
 
59 59
 /*
@@ -108,18 +108,18 @@  discard block
 block discarded – undo
108 108
         return null;
109 109
     }
110 110
     $features = array(
111
-        (string) FEATURE_IDNUMBER => true,
112
-        (string) FEATURE_GROUPS => true,
113
-        (string) FEATURE_GROUPINGS => true,
114
-        (string) FEATURE_GROUPMEMBERSONLY => true,
115
-        (string) FEATURE_MOD_INTRO => true,
116
-        (string) FEATURE_BACKUP_MOODLE2 => true,
117
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
118
-        (string) FEATURE_GRADE_HAS_GRADE => false,
119
-        (string) FEATURE_GRADE_OUTCOMES => false,
120
-        (string) FEATURE_SHOW_DESCRIPTION => true,
111
+        (string)FEATURE_IDNUMBER => true,
112
+        (string)FEATURE_GROUPS => true,
113
+        (string)FEATURE_GROUPINGS => true,
114
+        (string)FEATURE_GROUPMEMBERSONLY => true,
115
+        (string)FEATURE_MOD_INTRO => true,
116
+        (string)FEATURE_BACKUP_MOODLE2 => true,
117
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
118
+        (string)FEATURE_GRADE_HAS_GRADE => false,
119
+        (string)FEATURE_GRADE_OUTCOMES => false,
120
+        (string)FEATURE_SHOW_DESCRIPTION => true,
121 121
     );
122
-    if (isset($features[(string) $feature])) {
122
+    if (isset($features[(string)$feature])) {
123 123
         return $features[$feature];
124 124
     }
125 125
     return null;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) {
219 219
     global $DB;
220 220
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
221
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
221
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
222 222
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
223 223
     $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}";
224 224
     bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta);
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
  */
239 239
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
240 240
     if ($completed = bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn)) {
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
     return '';
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
  * @return array status array
430 430
  */
431 431
 function bigbluebuttonbn_reset_recordings($courseid) {
432
-    require_once(__DIR__.'/locallib.php');
432
+    require_once(__DIR__ . '/locallib.php');
433 433
     // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true].
434 434
     $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true);
435 435
     // Remove all the recordings.
@@ -497,16 +497,16 @@  discard block
 block discarded – undo
497 497
     if ($bigbluebuttonbn->visible) {
498 498
         $classes = 'class="dimmed" ';
499 499
     }
500
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
501
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
502
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
503
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
504
-    $str .= '  </div>'."\n";
505
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
506
-        '</div>'."\n";
507
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
508
-      .'</div>'."\n";
509
-    $str .= '</div>'."\n";
500
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
501
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
502
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
503
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
504
+    $str .= '  </div>' . "\n";
505
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
506
+        '</div>' . "\n";
507
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
508
+      .'</div>' . "\n";
509
+    $str .= '</div>' . "\n";
510 510
     return $str;
511 511
 }
512 512
 
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
     if (count($files) == 1) {
739 739
         // Get the first (and only) file.
740 740
         $file = reset($files);
741
-        $filesrc = '/'.$file->get_filename();
741
+        $filesrc = '/' . $file->get_filename();
742 742
     }
743 743
     return $filesrc;
744 744
 }
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
     if (!$filename) {
808 808
         return false;
809 809
     }
810
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
810
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
811 811
     $fs = get_file_storage();
812 812
     $file = $fs->get_file_by_hash(sha1($fullpath));
813 813
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
  * @uses FEATURE_GRADE_OUTCOMES
102 102
  * @uses FEATURE_SHOW_DESCRIPTION
103 103
  * @param string $feature
104
- * @return mixed True if yes (some features may use other values)
104
+ * @return null|boolean True if yes (some features may use other values)
105 105
  */
106 106
 function bigbluebuttonbn_supports($feature) {
107 107
     if (!$feature) {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
  *
221 221
  * @param object $bigbluebuttonbn Id of the module instance
222 222
  *
223
- * @return bool Success/Failure
223
+ * @return boolean|null Success/Failure
224 224
  */
225 225
 function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) {
226 226
     global $DB;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
  * @param object $mod
242 242
  * @param object $bigbluebuttonbn
243 243
  *
244
- * @return bool
244
+ * @return string
245 245
  */
246 246
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
247 247
     if ($completed = bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn)) {
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
  * @param object $mod
262 262
  * @param object $bigbluebuttonbn
263 263
  *
264
- * @return bool
264
+ * @return integer
265 265
  */
266 266
 function bigbluebuttonbn_user_complete($courseorid, $userorid, $mod, $bigbluebuttonbn) {
267 267
     global $DB;
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
  * @param stdClass $context       context object
783 783
  * @param string   $filearea      file area
784 784
  *
785
- * @return false|null false if file not valid
785
+ * @return boolean false if file not valid
786 786
  */
787 787
 function bigbluebuttonbn_pluginfile_valid($context, $filearea) {
788 788
 
Please login to merge, or discard this patch.
classes/output/index.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
      * Displays the general view.
111 111
      *
112 112
      * @param boolean $moderator
113
-     * @param object $course
113
+     * @param stdClass $course
114 114
      * @param object $bigbluebuttonbn
115 115
      * @param object $groupobj
116 116
      * @return array
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 defined('MOODLE_INTERNAL') || die();
36 36
 
37
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/locallib.php');
37
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
38 38
 
39 39
 /**
40 40
  * Class index
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 // Add a the data for the bigbluebuttonbn instance.
93 93
                 $groupobj = null;
94 94
                 if (groups_get_activity_groupmode($cm) > 0) {
95
-                    $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants'));
95
+                    $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants'));
96 96
                 }
97 97
                 $table->data[] = self::bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj);
98 98
                 // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any.
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             $attendeecount = 0;
183 183
             foreach ($meetinginfo['attendees']->attendee as $attendee) {
184 184
                 if ($attendee->role == $role) {
185
-                    $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName;
185
+                    $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName;
186 186
                 }
187 187
             }
188 188
         }
@@ -216,17 +216,17 @@  discard block
 block discarded – undo
216 216
     public static function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
217 217
         $actions = '';
218 218
         if ($moderator) {
219
-            $actions .= '<form name="form1" method="post" action="">'."\n";
220
-            $actions .= '  <INPUT type="hidden" name="id" value="'.$course->id.'">'."\n";
221
-            $actions .= '  <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'."\n";
219
+            $actions .= '<form name="form1" method="post" action="">' . "\n";
220
+            $actions .= '  <INPUT type="hidden" name="id" value="' . $course->id . '">' . "\n";
221
+            $actions .= '  <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . "\n";
222 222
             if ($groupobj != null) {
223
-                $actions .= '  <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'."\n";
223
+                $actions .= '  <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . "\n";
224 224
             }
225 225
             $actions .= '  <INPUT type="submit" name="submit" value="' .
226 226
                 get_string('view_conference_action_end', 'bigbluebuttonbn') .
227 227
                 '" class="btn btn-primary btn-sm" onclick="return confirm(\'' .
228 228
                 get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . "\n";
229
-            $actions .= '</form>'."\n";
229
+            $actions .= '</form>' . "\n";
230 230
         }
231 231
         return $actions;
232 232
     }
Please login to merge, or discard this patch.
classes/output/mobile.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,6 @@
 block discarded – undo
28 28
 defined('MOODLE_INTERNAL') || die();
29 29
 
30 30
 use context_module;
31
-use mod_bigbluebuttonbn_external;
32 31
 require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
33 32
 require_once($CFG->dirroot . '/lib/grouplib.php');
34 33
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         global $OUTPUT, $SESSION, $CFG;
57 57
 
58
-        $args = (object) $args;
58
+        $args = (object)$args;
59 59
         $viewinstance = bigbluebuttonbn_view_validator($args->cmid, null);
60 60
         if (!$viewinstance) {
61 61
             $error = get_string('view_error_url_missing_parameters', 'bigbluebuttonbn');
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $bigbluebuttonbn = $viewinstance['bigbluebuttonbn'];
68 68
         $context = context_module::instance($cm->id);
69 69
 
70
-        require_login($course->id, false , $cm, true, true);
70
+        require_login($course->id, false, $cm, true, true);
71 71
         require_capability('mod/bigbluebuttonbn:join', $context);
72 72
 
73 73
         // Add view event.
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
         // Check if the BBB server is working.
114 114
         $serverversion = bigbluebuttonbn_get_server_version();
115
-        $bbbsession['serverversion'] = (string) $serverversion;
115
+        $bbbsession['serverversion'] = (string)$serverversion;
116 116
         if (is_null($serverversion)) {
117 117
 
118 118
             if ($bbbsession['administrator']) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
         // Operation URLs.
141 141
         $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
142
-        $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$args->cmid .
142
+        $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $args->cmid .
143 143
             '&bn=' . $bbbsession['bigbluebuttonbn']->id;
144 144
         $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
145 145
             'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             }
183 183
             if ($response['returncode'] == 'FAILED') {
184 184
                 // The meeting could not be created.
185
-                $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'],  'view_error_create');
185
+                $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
186 186
                 $e = get_string($errorkey, 'bigbluebuttonbn');
187 187
                 return(self::mobile_print_error($e));
188 188
             }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn);
196 196
             // Insert a record that meeting was created.
197 197
             $overrides = array('meetingid' => $bbbsession['meetingid']);
198
-            $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
198
+            $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
199 199
             bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta);
200 200
         }
201 201
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
         $data = array(
223 223
             'bigbluebuttonbn' => $bigbluebuttonbn,
224
-            'bbbsession' => (object) $bbbsession,
224
+            'bbbsession' => (object)$bbbsession,
225 225
             'msjgroup' => $msjgroup,
226 226
             'urltojoin' => $urltojoin,
227 227
             'cmid' => $cm->id,
Please login to merge, or discard this patch.
import_view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
 use mod_bigbluebuttonbn\output\import_view;
28 28
 use mod_bigbluebuttonbn\output\renderer;
29 29
 
30
-require(__DIR__.'/../../config.php');
31
-require_once(__DIR__.'/locallib.php');
30
+require(__DIR__ . '/../../config.php');
31
+require_once(__DIR__ . '/locallib.php');
32 32
 
33 33
 $bn = required_param('bn', PARAM_INT);
34 34
 $tc = optional_param('tc', 0, PARAM_INT);
Please login to merge, or discard this patch.
settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once(__DIR__.'/locallib.php');
31
+require_once(__DIR__ . '/locallib.php');
32 32
 
33 33
 if ($hassiteconfig) {
34 34
     // Configuration for BigBlueButton.
Please login to merge, or discard this patch.
view.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
 use mod_bigbluebuttonbn\plugin;
29 29
 
30
-require(__DIR__.'/../../config.php');
31
-require_once(__DIR__.'/locallib.php');
32
-require_once(__DIR__.'/viewlib.php');
30
+require(__DIR__ . '/../../config.php');
31
+require_once(__DIR__ . '/locallib.php');
32
+require_once(__DIR__ . '/viewlib.php');
33 33
 
34 34
 $id = required_param('id', PARAM_INT);
35 35
 $bn = optional_param('bn', 0, PARAM_INT);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 bigbluebuttonbn_view_bbbsession_set($PAGE->context, $bbbsession);
59 59
 
60 60
 // Validates if the BigBlueButton server is working.
61
-$serverversion = bigbluebuttonbn_get_server_version();  // In locallib.
61
+$serverversion = bigbluebuttonbn_get_server_version(); // In locallib.
62 62
 if ($serverversion === null) {
63 63
     $errmsg = 'view_error_unable_join_student';
64 64
     $errurl = '/course/view.php';
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     }
73 73
     print_error($errmsg, plugin::COMPONENT, new moodle_url($errurl, $errurlparams));
74 74
 }
75
-$bbbsession['serverversion'] = (string) $serverversion;
75
+$bbbsession['serverversion'] = (string)$serverversion;
76 76
 
77 77
 // Mark viewed by user (if required).
78 78
 $completion = new completion_info($course);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 echo $OUTPUT->footer();
117 117
 
118 118
 // Shows version as a comment.
119
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
119
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
120 120
 
121 121
 // Initialize session variable used across views.
122 122
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
123 123
\ No newline at end of file
Please login to merge, or discard this patch.