Completed
Push — master ( 44031d...70a753 )
by Jesus
01:59
created
bbb_view.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
23 23
  */
24 24
 
25
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
26
-require_once(dirname(__FILE__).'/locallib.php');
25
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
26
+require_once(dirname(__FILE__) . '/locallib.php');
27 27
 
28 28
 $action = required_param('action', PARAM_TEXT);
29 29
 $id = optional_param('id', 0, PARAM_INT);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         }
91 91
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
92 92
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
93
-            header('Location: '.$bbbsession['logoutURL']);
93
+            header('Location: ' . $bbbsession['logoutURL']);
94 94
             break;
95 95
         }
96 96
         // As the meeting doesn't exist, try to create it.
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
             // The server is unreachable.
105 105
             if ($bbbsession['administrator']) {
106 106
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
107
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
107
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
108 108
                 break;
109 109
             }
110 110
             if ($bbbsession['moderator']) {
111 111
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
112
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
112
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
113 113
                 break;
114 114
             }
115 115
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
116
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
116
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
117 117
             break;
118 118
         }
119 119
         if ($response['returncode'] == 'FAILED') {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         // Moodle event logger: Create an event for meeting left.
143 143
         bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
144 144
         // Execute the redirect.
145
-        header('Location: '.urldecode($href));
145
+        header('Location: ' . urldecode($href));
146 146
         break;
147 147
     default:
148 148
         bigbluebutton_bbb_view_close_window();
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         $data['welcome'] .= '<br><br>';
197 197
         $data['welcome'] .= str_replace(
198 198
             '%duration%',
199
-            (string) $durationtime,
199
+            (string)$durationtime,
200 200
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
201 201
           );
202 202
     }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
260 260
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
261 261
         // No more users allowed to join.
262
-        header('Location: '.$bbbsession['logoutURL']);
262
+        header('Location: ' . $bbbsession['logoutURL']);
263 263
         return;
264 264
     }
265 265
     // Build the URL.
@@ -277,18 +277,18 @@  discard block
 block discarded – undo
277 277
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
278 278
         ($bbbsession['administrator'] || $bbbsession['moderator']));
279 279
     // Execute the redirect.
280
-    header('Location: '.$joinurl);
280
+    header('Location: ' . $joinurl);
281 281
 }
282 282
 
283 283
 function bigbluebutton_bbb_view_errors($serrors, $id) {
284 284
     global $CFG, $OUTPUT;
285
-    $errors = (array) json_decode(urldecode($serrors));
285
+    $errors = (array)json_decode(urldecode($serrors));
286 286
     $msgerrors = '';
287 287
     foreach ($errors as $error) {
288
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
288
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
289 289
     }
290 290
     echo $OUTPUT->header();
291 291
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
292
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
292
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
293 293
     echo $OUTPUT->footer();
294 294
 }
Please login to merge, or discard this patch.
lib.php 1 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
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $data->id));
126 126
         // Assuming the inserts work, we get to the following line.
127 127
         $transaction->allow_commit();
128
-    } catch(Exception $e) {
128
+    } catch (Exception $e) {
129 129
         $transaction->rollback($e);
130 130
     }
131 131
     if ($data->id) {
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         // Assuming the inserts work, we get to the following line.
155 155
         $transaction->allow_commit();
156 156
         $updated = true;
157
-    } catch(Exception $e) {
157
+    } catch (Exception $e) {
158 158
         $transaction->rollback($e);
159 159
         $updated = false;
160 160
     }
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
227 227
                                                               'bigbluebuttonbnid' => $bigbluebuttonbn->id,
228 228
                                                               'userid' => $user->id,
229
-                                                              'log' => 'Join', ), '*');
229
+                                                              'log' => 'Join',), '*');
230 230
     if ($completed > 0) {
231
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
232
-            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
231
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
232
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
233 233
             get_string('view_message_times', 'bigbluebuttonbn');
234 234
     }
235 235
     return '';
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id,
247 247
                                                               'bigbluebuttonbnid' => $bigbluebuttonbn->id,
248 248
                                                               'userid' => $user->id,
249
-                                                              'log' => 'Join', ), '*', IGNORE_MULTIPLE);
249
+                                                              'log' => 'Join',), '*', IGNORE_MULTIPLE);
250 250
     return $completed > 0;
251 251
 }
252 252
 
@@ -314,16 +314,16 @@  discard block
 block discarded – undo
314 314
     if ($bigbluebuttonbn->visible) {
315 315
         $classes = 'class="dimmed" ';
316 316
     }
317
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
318
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
319
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
320
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
321
-    $str .= '  </div>'."\n";
322
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
323
-        '</div>'."\n";
324
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
325
-      .'</div>'."\n";
326
-    $str .= '</div>'."\n";
317
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
318
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
319
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
320
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
321
+    $str .= '  </div>' . "\n";
322
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
323
+        '</div>' . "\n";
324
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
325
+      .'</div>' . "\n";
326
+    $str .= '</div>' . "\n";
327 327
     return $str;
328 328
 }
329 329
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
     if (count($files) == 1) {
483 483
         // Get the first (and only) file.
484 484
         $file = reset($files);
485
-        $filesrc = '/'.$file->get_filename();
485
+        $filesrc = '/' . $file->get_filename();
486 486
     }
487 487
     // Set the presentation column in the bigbluebuttonbn table.
488 488
     $DB->set_field('bigbluebuttonbn', 'presentation', $filesrc, array('id' => $bigbluebuttonbn->id));
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
         return false;
540 540
     }
541 541
 
542
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
542
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
543 543
     $fs = get_file_storage();
544 544
     $file = $fs->get_file_by_hash(sha1($fullpath));
545 545
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +18 added lines, -18 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
 $a = optional_param('a', 0, PARAM_INT);
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
     if ($moderator || $administrator) {
88 88
         bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $cm);
89 89
         echo get_string('index_ending', 'bigbluebuttonbn');
90
-        $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
90
+        $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
91 91
         if ($g != '0') {
92
-            $meetingid .= '['.$g.']';
92
+            $meetingid .= '[' . $g . ']';
93 93
         }
94 94
         bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingid));
95
-        redirect('index.php?id='.$id);
95
+        redirect('index.php?id=' . $id);
96 96
     }
97 97
 }
98 98
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         // Add a the data for the bigbluebuttonbn instance.
107 107
         $groupobj = null;
108 108
         if (groups_get_activity_groupmode($cm) > 0) {
109
-            $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants'));
109
+            $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants'));
110 110
         }
111 111
         $table->data[] = bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj);
112 112
         // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any.
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 
125 125
 // Functions.
126 126
 function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
127
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
127
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
128 128
     $paramgroup = '';
129 129
     $groupname = '';
130 130
     if ($groupobj) {
131
-        $meetingid .= '['.$groupobj->id.']';
132
-        $paramgroup = '&group='.$groupobj->id;
131
+        $meetingid .= '[' . $groupobj->id . ']';
132
+        $paramgroup = '&group=' . $groupobj->id;
133 133
         $groupname = $groupobj->name;
134 134
     }
135 135
     $meetinginfo = bigbluebuttonbn_get_meeting_info_array($meetingid);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         return;
145 145
     }
146 146
     // Output Users in the meeting.
147
-    $joinurl = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramgroup.'">'.format_string($bigbluebuttonbn->name).'</a>';
147
+    $joinurl = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramgroup . '">' . format_string($bigbluebuttonbn->name) . '</a>';
148 148
     $group = $groupname;
149 149
     $users = '';
150 150
     $viewerlist = '';
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $attendeecount = 0;
177 177
         foreach ($meetinginfo['attendees']->attendee as $attendee) {
178 178
             if ($attendee->role == $role) {
179
-                $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName;
179
+                $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName;
180 180
             }
181 181
         }
182 182
     }
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
196 196
     $actions = '';
197 197
     if ($moderator) {
198
-        $actions .= '<form name="form1" method="post" action="">'.'/n';
199
-        $actions .= '  <INPUT type="hidden" name="id" value="'.$course->id.'">'.'/n';
200
-        $actions .= '  <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'.'/n';
198
+        $actions .= '<form name="form1" method="post" action="">' . '/n';
199
+        $actions .= '  <INPUT type="hidden" name="id" value="' . $course->id . '">' . '/n';
200
+        $actions .= '  <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . '/n';
201 201
         if ($groupobj != null) {
202
-            $actions .= '  <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'.'/n';
202
+            $actions .= '  <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . '/n';
203 203
         }
204
-        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\''.
205
-            get_string('index_confirm_end', 'bigbluebuttonbn').'\')">'.'/n';
206
-        $actions .= '</form>'.'/n';
204
+        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' .
205
+            get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . '/n';
206
+        $actions .= '</form>' . '/n';
207 207
     }
208 208
     return $actions;
209 209
 }
Please login to merge, or discard this patch.