Completed
Push — master ( 20d163...ca6f65 )
by Jesus
01:59
created
classes/output/mobile.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@
 block discarded – undo
27 27
 
28 28
 defined('MOODLE_INTERNAL') || die();
29 29
 
30
-use context_module;
31 30
 use mod_bigbluebuttonbn\locallib\bigbluebutton;
32 31
 
33 32
 require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
         global $OUTPUT, $SESSION;
58 58
 
59
-        $args = (object) $args;
59
+        $args = (object)$args;
60 60
         $viewinstance = bigbluebuttonbn_view_validator($args->cmid, null);
61 61
         if (!$viewinstance) {
62 62
             $error = get_string('view_error_url_missing_parameters', 'bigbluebuttonbn');
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             }
165 165
             if ($response['returncode'] == 'FAILED') {
166 166
                 // The meeting could not be created.
167
-                $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'],  'view_error_create');
167
+                $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
168 168
                 $e = get_string($errorkey, 'bigbluebuttonbn');
169 169
                 return(self::mobile_print_error($e));
170 170
             }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn);
178 178
             // Insert a record that meeting was created.
179 179
             $overrides = array('meetingid' => $bbbsession['meetingid']);
180
-            $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
180
+            $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
181 181
             bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta);
182 182
         }
183 183
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 
204 204
         $data = array(
205 205
             'bigbluebuttonbn' => $bigbluebuttonbn,
206
-            'bbbsession' => (object) $bbbsession,
206
+            'bbbsession' => (object)$bbbsession,
207 207
             'msjgroup' => $msjgroup,
208 208
             'urltojoin' => $urltojoin,
209 209
             'cmid' => $cm->id,
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
 mod_bigbluebuttonbn\locallib\bigbluebutton::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.
bbb_view.php 1 patch
Spacing   +20 added lines, -20 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
 
@@ -63,16 +63,16 @@  discard block
 block discarded – undo
63 63
     if (is_null($serverversion)) {
64 64
         if ($bbbsession['administrator']) {
65 65
             print_error('view_error_unable_join', 'bigbluebuttonbn',
66
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
66
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
67 67
             exit;
68 68
         }
69 69
         if ($bbbsession['moderator']) {
70 70
             print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
71
-                $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
71
+                $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
72 72
             exit;
73 73
         }
74 74
         print_error('view_error_unable_join_student', 'bigbluebuttonbn',
75
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
75
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
76 76
         exit;
77 77
     }
78 78
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
         }
98 98
 
99 99
         // Assign group default values.
100
-        $bbbsession['meetingid'] .= '['.$bbbsession['group'].']';
101
-        $bbbsession['meetingname'] .= ' ('.$groupname.')';
100
+        $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']';
101
+        $bbbsession['meetingname'] .= ' (' . $groupname . ')';
102 102
     }
103 103
 
104 104
     // Initialize session variable used across views.
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         }
164 164
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
165 165
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
166
-            header('Location: '.$bbbsession['logoutURL']);
166
+            header('Location: ' . $bbbsession['logoutURL']);
167 167
             break;
168 168
         }
169 169
         // As the meeting doesn't exist, try to create it.
@@ -177,16 +177,16 @@  discard block
 block discarded – undo
177 177
             // The server is unreachable.
178 178
             if ($bbbsession['administrator']) {
179 179
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
180
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
180
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
181 181
                 break;
182 182
             }
183 183
             if ($bbbsession['moderator']) {
184 184
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
185
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
185
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
186 186
                 break;
187 187
             }
188 188
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
189
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
189
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
190 190
             break;
191 191
         }
192 192
         if ($response['returncode'] == 'FAILED') {
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn);
208 208
         // Internal logger: Insert a record with the meeting created.
209 209
         $overrides = array('meetingid' => $bbbsession['meetingid']);
210
-        $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
210
+        $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
211 211
         bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta);
212 212
         // Since the meeting is already running, we just join the session.
213 213
         bigbluebuttonbn_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn, $origin);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $overrides = array('meetingid' => $bbbsession['meetingid']);
222 222
         bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_PLAYED, $overrides);
223 223
         // Execute the redirect.
224
-        header('Location: '.urldecode($href));
224
+        header('Location: ' . urldecode($href));
225 225
         break;
226 226
     default:
227 227
         bigbluebuttonbn_bbb_view_close_window();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         $data['welcome'] .= '<br><br>';
316 316
         $data['welcome'] .= str_replace(
317 317
             '%duration%',
318
-            (string) $durationtime,
318
+            (string)$durationtime,
319 319
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
320 320
           );
321 321
     }
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
     $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE);
382 382
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
383 383
         // No more users allowed to join.
384
-        header('Location: '.$bbbsession['logoutURL']);
384
+        header('Location: ' . $bbbsession['logoutURL']);
385 385
         return;
386 386
     }
387 387
     // Build the URL.
@@ -395,13 +395,13 @@  discard block
 block discarded – undo
395 395
     bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_join'], $bigbluebuttonbn);
396 396
     // Internal logger: Instert a record with the meeting created.
397 397
     $overrides = array('meetingid' => $bbbsession['meetingid']);
398
-    $meta = '{"origin":'.$origin.'}';
398
+    $meta = '{"origin":' . $origin . '}';
399 399
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_JOIN, $overrides, $meta);
400 400
     // Before executing the redirect, increment the number of participants.
401 401
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
402 402
         ($bbbsession['administrator'] || $bbbsession['moderator']));
403 403
     // Execute the redirect.
404
-    header('Location: '.$joinurl);
404
+    header('Location: ' . $joinurl);
405 405
 }
406 406
 
407 407
 /**
@@ -413,13 +413,13 @@  discard block
 block discarded – undo
413 413
  */
414 414
 function bigbluebuttonbn_bbb_view_errors($serrors, $id) {
415 415
     global $CFG, $OUTPUT;
416
-    $errors = (array) json_decode(urldecode($serrors));
416
+    $errors = (array)json_decode(urldecode($serrors));
417 417
     $msgerrors = '';
418 418
     foreach ($errors as $error) {
419
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
419
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
420 420
     }
421 421
     echo $OUTPUT->header();
422 422
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
423
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
423
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
424 424
     echo $OUTPUT->footer();
425 425
 }
Please login to merge, or discard this patch.
classes/locallib/mobileview.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
             $data['welcome'] .= '<br><br>';
114 114
             $data['welcome'] .= str_replace(
115 115
                 '%duration%',
116
-                (string) $durationtime,
116
+                (string)$durationtime,
117 117
                 get_string('bbbdurationwarning', 'bigbluebuttonbn')
118 118
             );
119 119
         }
Please login to merge, or discard this patch.
classes/locallib/bigbluebutton.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         self::view_bbbsession_set($context, $bbbsession);
150 150
 
151 151
         $serverversion = bigbluebuttonbn_get_server_version();
152
-        $bbbsession['serverversion'] = (string) $serverversion;
152
+        $bbbsession['serverversion'] = (string)$serverversion;
153 153
 
154 154
         // Operation URLs.
155 155
         $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $cm->id;
@@ -187,12 +187,12 @@  discard block
 block discarded – undo
187 187
         $session['importrecordings'] = ($session['managerecordings']);
188 188
         $session['modPW'] = $session['bigbluebuttonbn']->moderatorpass;
189 189
         $session['viewerPW'] = $session['bigbluebuttonbn']->viewerpass;
190
-        $session['meetingid'] = $session['bigbluebuttonbn']->meetingid.'-'.$session['course']->id.'-'.
190
+        $session['meetingid'] = $session['bigbluebuttonbn']->meetingid . '-' . $session['course']->id . '-' .
191 191
             $session['bigbluebuttonbn']->id;
192 192
         $session['meetingname'] = $session['bigbluebuttonbn']->name;
193 193
         $session['meetingdescription'] = $session['bigbluebuttonbn']->intro;
194
-        $session['userlimit'] = intval((int) config::get('userlimit_default'));
195
-        if ((boolean) config::get('userlimit_editable')) {
194
+        $session['userlimit'] = intval((int)config::get('userlimit_default'));
195
+        if ((boolean)config::get('userlimit_editable')) {
196 196
             $session['userlimit'] = intval($session['bigbluebuttonbn']->userlimit);
197 197
         }
198 198
         $session['voicebridge'] = $session['bigbluebuttonbn']->voicebridge;
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
         if ($session['bigbluebuttonbn']->record) {
220 220
             // Check if is enable record all from start.
221 221
             if ($session['recordallfromstart']) {
222
-                $session['welcome'] .= '<br><br>'.get_string('bbbrecordallfromstartwarning',
222
+                $session['welcome'] .= '<br><br>' . get_string('bbbrecordallfromstartwarning',
223 223
                         'bigbluebuttonbn');
224 224
             } else {
225
-                $session['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
225
+                $session['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
226 226
             }
227 227
         }
228 228
         $session['openingtime'] = $session['bigbluebuttonbn']->openingtime;
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         $session['originServerName'] = $parsedurl['host'];
236 236
         $session['originServerUrl'] = $CFG->wwwroot;
237 237
         $session['originServerCommonName'] = '';
238
-        $session['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
238
+        $session['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
239 239
         $session['bnserver'] = bigbluebuttonbn_is_bn_server();
240 240
         $session['clienttype'] = config::get('clienttype_default');
241 241
 
Please login to merge, or discard this patch.