Completed
Push — master ( 32c9ae...514091 )
by Jesus
04:47
created
view.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
24 24
  */
25 25
 
26
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
27
-require_once(dirname(__FILE__).'/locallib.php');
26
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
27
+require_once(dirname(__FILE__) . '/locallib.php');
28 28
 
29 29
 $id = required_param('id', PARAM_INT);
30 30
 $b = optional_param('n', 0, PARAM_INT);
@@ -59,18 +59,18 @@  discard block
 block discarded – undo
59 59
 if (is_null($serverversion)) {
60 60
     if ($bbbsession['administrator']) {
61 61
         print_error('view_error_unable_join', 'bigbluebuttonbn',
62
-            $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
62
+            $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
63 63
         exit;
64 64
     }
65 65
 
66 66
     if ($bbbsession['moderator']) {
67 67
         print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
68
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
68
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
69 69
         exit;
70 70
     }
71 71
 
72 72
     print_error('view_error_unable_join_student', 'bigbluebuttonbn',
73
-        $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
73
+        $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
74 74
     exit;
75 75
 }
76 76
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 // Print the page header.
82 82
 $PAGE->set_context($context);
83
-$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
83
+$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
84 84
 $PAGE->set_title(format_string($bigbluebuttonbn->name));
85 85
 $PAGE->set_cacheable(false);
86 86
 $PAGE->set_heading($course->fullname);
@@ -90,26 +90,26 @@  discard block
 block discarded – undo
90 90
 if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) {
91 91
     echo $OUTPUT->header();
92 92
     if (isguestuser()) {
93
-        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
94
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
93
+        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
94
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
95 95
     } else {
96
-        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
97
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
96
+        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
97
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
98 98
     }
99 99
     echo $OUTPUT->footer();
100 100
     exit;
101 101
 }
102 102
 
103 103
 // Operation URLs.
104
-$bbbsession['courseURL'] = $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course;
105
-$bbbsession['logoutURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id.
106
-    '&bn='.$bbbsession['bigbluebuttonbn']->id;
107
-$bbbsession['recordingReadyURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=recording_'.
108
-    'ready&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id;
109
-$bbbsession['meetingEventsURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_broker.php?action=meeting'.
110
-    '_events&bigbluebuttonbn='.$bbbsession['bigbluebuttonbn']->id;
111
-$bbbsession['joinURL'] = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=join&id='.$id.
112
-    '&bn='.$bbbsession['bigbluebuttonbn']->id;
104
+$bbbsession['courseURL'] = $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course;
105
+$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
106
+    '&bn=' . $bbbsession['bigbluebuttonbn']->id;
107
+$bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
108
+    'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
109
+$bbbsession['meetingEventsURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=meeting' .
110
+    '_events&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
111
+$bbbsession['joinURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=join&id=' . $id .
112
+    '&bn=' . $bbbsession['bigbluebuttonbn']->id;
113 113
 
114 114
 // Output starts.
115 115
 echo $OUTPUT->header();
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 echo $OUTPUT->footer();
123 123
 
124 124
 // Shows version as a comment.
125
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
125
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
126 126
 
127 127
 // Initialize session variable used across views.
128 128
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass;
155 155
 
156 156
     // Database info related to the activity.
157
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
157
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
158 158
         $bbbsession['bigbluebuttonbn']->id;
159 159
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
160 160
     $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
176 176
     }
177 177
     if ($bigbluebuttonbn->record) {
178
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
178
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
179 179
     }
180 180
 
181 181
     $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime;
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     $bbbsession['originServerName'] = $parsedurl['host'];
192 192
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
193 193
     $bbbsession['originServerCommonName'] = '';
194
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
194
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
195 195
 }
196 196
 
197 197
 function bigbluebuttonbn_view_bbbsession_roles($context, $userid) {
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
     $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true);
251 251
 
252 252
     // Assign group default values.
253
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
254
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
253
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
254
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
255 255
     $groupname = get_string('allparticipants');
256
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
256
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
257 257
 
258 258
 
259 259
     if (sizeof($groups) == 0) {
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
         $bbbsession['group'] = array_values($groups)[0]->id;
266 266
     }
267 267
 
268
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
269
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
268
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
269
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
270 270
     $groupname = groups_get_group_name($bbbsession['group']);
271
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
271
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
272 272
 
273 273
     if (sizeof($groups) == 1) {
274 274
         // There only one group and the user has access to.
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
     }
277 277
 
278 278
     echo $OUTPUT->box_start('generalbox boxaligncenter');
279
-    echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').
279
+    echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') .
280 280
       '</div>';
281 281
     echo $OUTPUT->box_end();
282 282
 
283 283
     groups_print_activity_menu(
284
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id, false, $onlyexistentgroups);
284
+      $bbbsession['cm'], $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id, false, $onlyexistentgroups);
285 285
     echo '<br><br>';
286 286
 }
287 287
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             'M.mod_bigbluebuttonbn.recordings.init', array($jsvars));
324 324
     }
325 325
 
326
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
326
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
327 327
 
328 328
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
329 329
 }
@@ -334,12 +334,12 @@  discard block
 block discarded – undo
334 334
     // JavaScript variables for room.
335 335
     $openingtime = '';
336 336
     if ($bbbsession['openingtime']) {
337
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
337
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
338 338
             userdate($bbbsession['openingtime']);
339 339
     }
340 340
     $closingtime = '';
341 341
     if ($bbbsession['closingtime']) {
342
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
342
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
343 343
             userdate($bbbsession['closingtime']);
344 344
     }
345 345
     $jsvars += array(
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     $output .= $OUTPUT->box_end();
357 357
 
358 358
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
359
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
359
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
360 360
     $output .= $OUTPUT->box_end();
361 361
 
362 362
     if ($activity == 'ended') {
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
     // If there are meetings with recordings load the data to the table.
393 393
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
394 394
         // Render a plain html table.
395
-        return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n";
395
+        return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n";
396 396
     }
397 397
 
398 398
     // JavaScript variables for recordings with YUI.
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
         array('type' => 'button',
413 413
               'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
414 414
               'class' => 'btn btn-secondary',
415
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
416
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
415
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
416
+                  $bbbsession['bigbluebuttonbn']->id . '\''));
417 417
     $output = html_writer::start_tag('br');
418 418
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
419 419
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -428,10 +428,10 @@  discard block
 block discarded – undo
428 428
         $attributes = array('title' => $bbbsession['presentation']['name']);
429 429
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
430 430
 
431
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
432
-                ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
433
-                ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
434
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
431
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
432
+                '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' .
433
+                '' . $OUTPUT->action_link($bbbsession['presentation']['url'],
434
+                      $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
435 435
     }
436 436
 
437 437
     return '';
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_recording_viewed.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function get_description() {
55 55
         $rid = isset($this->other) ? $this->other : 'unknown';
56
-        $a = (object) array('userid' => $this->userid,
56
+        $a = (object)array('userid' => $this->userid,
57 57
                             'recordingid' => $rid,
58 58
                             'courseid' => $this->contextinstanceid);
59 59
 
60
-        return "The user with id '$a->userid' has viewed a recording with id ".
60
+        return "The user with id '$a->userid' has viewed a recording with id " .
61 61
         "'$a->recordingid' from the course id '$a->courseid'.";
62 62
     }
63 63
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function get_legacy_logdata() {
70 70
         return array($this->courseid, 'bigbluebuttonbn', 'recording viewed',
71
-                'view.php?pageid='.$this->objectid, 'Recording viewed',
71
+                'view.php?pageid=' . $this->objectid, 'Recording viewed',
72 72
                 $this->contextinstanceid);
73 73
     }
74 74
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_recording_published.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function get_description() {
55 55
         $rid = isset($this->other) ? $this->other : 'unknown';
56
-        $a = (object) array('userid' => $this->userid,
56
+        $a = (object)array('userid' => $this->userid,
57 57
                             'recordingid' => $rid,
58 58
                             'courseid' => $this->contextinstanceid);
59 59
 
60
-        return "The user with id '$a->userid' has published a recording with id ".
60
+        return "The user with id '$a->userid' has published a recording with id " .
61 61
         "'$a->recordingid' in the course id '$a->courseid'.";
62 62
     }
63 63
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function get_legacy_logdata() {
70 70
         return array($this->courseid, 'bigbluebuttonbn', 'recording published',
71
-                'view.php?pageid='.$this->objectid, 'Recording published',
71
+                'view.php?pageid=' . $this->objectid, 'Recording published',
72 72
                 $this->contextinstanceid);
73 73
     }
74 74
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_recording_unpublished.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function get_description() {
55 55
         $rid = isset($this->other) ? $this->other : 'unknown';
56
-        $a = (object) array('userid' => $this->userid,
56
+        $a = (object)array('userid' => $this->userid,
57 57
                             'recordingid' => $rid,
58 58
                             'courseid' => $this->contextinstanceid);
59 59
 
60
-        return "The user with id '$a->userid' has unpublished a recording with id ".
60
+        return "The user with id '$a->userid' has unpublished a recording with id " .
61 61
         "'$a->recordingid' in the course id '$a->courseid'.";
62 62
     }
63 63
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function get_legacy_logdata() {
70 70
         return array($this->courseid, 'bigbluebuttonbn', 'recording unpublished',
71
-                'view.php?pageid='.$this->objectid, 'Recording unpublished',
71
+                'view.php?pageid=' . $this->objectid, 'Recording unpublished',
72 72
                 $this->contextinstanceid);
73 73
     }
74 74
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_recording_deleted.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function get_description() {
55 55
         $rid = isset($this->other) ? $this->other : 'unknown';
56
-        $a = (object) array('userid' => $this->userid,
56
+        $a = (object)array('userid' => $this->userid,
57 57
                             'recordingid' => $rid,
58 58
                             'courseid' => $this->contextinstanceid);
59 59
 
60
-        return "The user with id '$a->userid' has deleted a recording with id ".
60
+        return "The user with id '$a->userid' has deleted a recording with id " .
61 61
         "'$a->recordingid' from the course id '$a->courseid'.";
62 62
     }
63 63
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function get_legacy_logdata() {
70 70
         return array($this->courseid, 'bigbluebuttonbn', 'recording deleted',
71
-                'view.php?pageid='.$this->objectid, 'Recording deleted',
71
+                'view.php?pageid=' . $this->objectid, 'Recording deleted',
72 72
                 $this->contextinstanceid);
73 73
     }
74 74
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_recording_edited.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function get_description() {
55 55
         $rid = isset($this->other) ? $this->other : 'unknown';
56
-        $a = (object) array('userid' => $this->userid,
56
+        $a = (object)array('userid' => $this->userid,
57 57
                             'recordingid' => $rid,
58 58
                             'courseid' => $this->contextinstanceid);
59 59
 
60
-        return "The user with id '$a->userid' has edited a recording with id ".
60
+        return "The user with id '$a->userid' has edited a recording with id " .
61 61
         "'$a->recordingid' in the course id '$a->courseid'.";
62 62
     }
63 63
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function get_legacy_logdata() {
70 70
         return array($this->courseid, 'bigbluebuttonbn', 'recording edited',
71
-                'view.php?pageid='.$this->objectid, 'Recording edited',
71
+                'view.php?pageid=' . $this->objectid, 'Recording edited',
72 72
                 $this->contextinstanceid);
73 73
     }
74 74
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_recording_imported.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function get_description() {
55 55
         $rid = isset($this->other) ? $this->other : 'unknown';
56
-        $a = (object) array('userid' => $this->userid,
56
+        $a = (object)array('userid' => $this->userid,
57 57
                             'recordingid' => $rid,
58 58
                             'courseid' => $this->contextinstanceid);
59 59
 
60
-        return "The user with id '$a->userid' has imported a recording with id ".
60
+        return "The user with id '$a->userid' has imported a recording with id " .
61 61
         "'$a->recordingid' into the course id '$a->courseid'.";
62 62
     }
63 63
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function get_legacy_logdata() {
70 70
         return array($this->courseid, 'bigbluebuttonbn', 'recording imported',
71
-                'view.php?pageid='.$this->objectid, 'Recording imported',
71
+                'view.php?pageid=' . $this->objectid, 'Recording imported',
72 72
                 $this->contextinstanceid);
73 73
     }
74 74
 
Please login to merge, or discard this patch.
locallib.php 1 patch
Spacing   +101 added lines, -101 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);
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
  * @param array  $metadata
115 115
  */
116 116
 function bigbluebuttonbn_bigbluebutton_action_url($action = '', $data = array(), $metadata = array()) {
117
-    $baseurl = bigbluebuttonbn_get_cfg_server_url().'api/'.$action.'?';
117
+    $baseurl = bigbluebuttonbn_get_cfg_server_url() . 'api/' . $action . '?';
118 118
     $params = '';
119 119
 
120 120
     foreach ($data as $key => $value) {
121
-        $params .= '&'.$key.'='.urlencode($value);
121
+        $params .= '&' . $key . '=' . urlencode($value);
122 122
     }
123 123
 
124 124
     foreach ($metadata as $key => $value) {
125
-        $params .= '&'.'meta_'.$key.'='.urlencode($value);
125
+        $params .= '&' . 'meta_' . $key . '=' . urlencode($value);
126 126
     }
127 127
 
128
-    return $baseurl.$params.'&checksum='.sha1($action.$params.bigbluebuttonbn_get_cfg_shared_secret());
128
+    return $baseurl . $params . '&checksum=' . sha1($action . $params . bigbluebuttonbn_get_cfg_shared_secret());
129 129
 }
130 130
 
131 131
 function bigbluebuttonbn_get_create_meeting_array($data, $metadata = array(), $pname = null, $purl = null) {
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 
136 136
     if (!is_null($pname) && !is_null($purl)) {
137 137
         $method = BIGBLUEBUTTONBN_METHOD_POST;
138
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
139
-            $purl."' /></module></modules>";
138
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
139
+            $purl . "' /></module></modules>";
140 140
     }
141 141
 
142 142
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                                 'moderatorPW' => $meeting->moderatorPW,
182 182
                                 'attendeePW' => $meeting->attendeePW,
183 183
                                 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded,
184
-                                'running' => $meeting->running, );
184
+                                'running' => $meeting->running,);
185 185
         }
186 186
 
187 187
         return $meetings;
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
 function bigbluebuttonbn_get_recordings_imported_array($courseid, $bigbluebuttonbnid = null, $subset = true) {
325 325
     global $DB;
326 326
 
327
-    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
328
-        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
327
+    $select = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
328
+        BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
329 329
     if ($bigbluebuttonbnid === null) {
330
-        $select = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
330
+        $select = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
331 331
     } else if ($subset) {
332
-        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
332
+        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
333 333
     }
334 334
     $recordsimported = $DB->get_records_select('bigbluebuttonbn_logs', $select);
335 335
 
@@ -354,35 +354,35 @@  discard block
 block discarded – undo
354 354
 function bigbluebuttonbn_get_default_config_xml_array() {
355 355
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
356 356
 
357
-    return (array) $defaultconfigxml;
357
+    return (array)$defaultconfigxml;
358 358
 }
359 359
 
360 360
 function bigbluebuttonbn_get_recording_array_value($recording) {
361 361
     // Add formats.
362 362
     $playbackarray = array();
363 363
     foreach ($recording->playback->format as $format) {
364
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
365
-            'url' => (string) $format->url, 'length' => (string) $format->length);
364
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
365
+            'url' => (string)$format->url, 'length' => (string)$format->length);
366 366
         // Add preview per format when existing.
367 367
         if ($format->preview) {
368 368
             $imagesarray = array();
369 369
             foreach ($format->preview->images->image as $image) {
370
-                $imagearray = array('url' => (string) $image);
370
+                $imagearray = array('url' => (string)$image);
371 371
                 foreach ($image->attributes() as $attkey => $attvalue) {
372
-                    $imagearray[$attkey] = (string) $attvalue;
372
+                    $imagearray[$attkey] = (string)$attvalue;
373 373
                 }
374 374
                 array_push($imagesarray, $imagearray);
375 375
             }
376
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
376
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
377 377
         }
378 378
     }
379 379
 
380 380
     // Add the metadata to the recordings array.
381 381
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
382
-    return array('recordID' => (string) $recording->recordID,
383
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
384
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
385
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray) + $metadataarray;
382
+    return array('recordID' => (string)$recording->recordID,
383
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
384
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
385
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray) + $metadataarray;
386 386
 }
387 387
 
388 388
 function bigbluebuttonbn_get_recording_array_meta($metadata) {
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
         if (is_object($value)) {
392 392
             $value = '';
393 393
         }
394
-        $metadataarray['meta_'.$key] = $value;
394
+        $metadataarray['meta_' . $key] = $value;
395 395
     }
396 396
     return $metadataarray;
397 397
 }
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
     $ids = explode(',', $recordids);
450 450
     foreach ($ids as $id) {
451 451
         $xml = bigbluebuttonbn_wrap_xml_load_file(
452
-            bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array) $params)
452
+            bigbluebuttonbn_bigbluebutton_action_url('updateRecordings', ['recordID' => $id] + (array)$params)
453 453
           );
454 454
         if ($xml && $xml->returncode != 'SUCCESS') {
455 455
             return false;
@@ -604,8 +604,8 @@  discard block
 block discarded – undo
604 604
 
605 605
         $options = array();
606 606
         $options['CURLOPT_HTTPHEADER'] = array(
607
-                 'Content-Type: '.$contenttype,
608
-                 'Content-Length: '.strlen($data),
607
+                 'Content-Type: ' . $contenttype,
608
+                 'Content-Length: ' . strlen($data),
609 609
                  'Content-Language: en-US',
610 610
                );
611 611
 
@@ -622,9 +622,9 @@  discard block
 block discarded – undo
622 622
     if ($userroles) {
623 623
         $where = '';
624 624
         foreach ($userroles as $value) {
625
-            $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid;
625
+            $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid;
626 626
         }
627
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
627
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
628 628
     }
629 629
 
630 630
     return $userroles;
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 }
638 638
 
639 639
 function bigbluebuttonbn_get_users(context $context = null) {
640
-    $users = (array) get_enrolled_users($context);
640
+    $users = (array)get_enrolled_users($context);
641 641
     foreach ($users as $key => $value) {
642 642
         $users[$key] = fullname($value);
643 643
     }
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 }
646 646
 
647 647
 function bigbluebuttonbn_get_users_select(context $context = null) {
648
-    $users = (array) get_enrolled_users($context);
648
+    $users = (array)get_enrolled_users($context);
649 649
     foreach ($users as $key => $value) {
650 650
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
651 651
     }
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 }
654 654
 
655 655
 function bigbluebuttonbn_get_roles(context $context = null) {
656
-    $roles = (array) role_get_names($context);
656
+    $roles = (array)role_get_names($context);
657 657
     foreach ($roles as $key => $value) {
658 658
         $roles[$key] = $value->localname;
659 659
     }
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 }
662 662
 
663 663
 function bigbluebuttonbn_get_roles_select(context $context = null) {
664
-    $roles = (array) role_get_names($context);
664
+    $roles = (array)role_get_names($context);
665 665
     foreach ($roles as $key => $value) {
666 666
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
667 667
     }
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
  }
670 670
 
671 671
 function bigbluebuttonbn_get_role($id) {
672
-    $roles = (array) role_get_names();
672
+    $roles = (array)role_get_names();
673 673
     if (is_numeric($id)) {
674 674
         return $roles[$id];
675 675
     }
@@ -833,9 +833,9 @@  discard block
 block discarded – undo
833 833
     $isunique = true;
834 834
     if ($voicebridge != 0) {
835 835
         $table = 'bigbluebuttonbn';
836
-        $select = 'voicebridge = '.$voicebridge;
836
+        $select = 'voicebridge = ' . $voicebridge;
837 837
         if ($id) {
838
-            $select .= ' AND id <> '.$id;
838
+            $select .= ' AND id <> ' . $id;
839 839
         }
840 840
         if ($DB->get_records_select($table, $select)) {
841 841
             $isunique = false;
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
     $mt = microtime();
904 904
     $rand = mt_rand();
905 905
 
906
-    return md5($mt.$rand);
906
+    return md5($mt . $rand);
907 907
 }
908 908
 
909 909
 function bigbluebuttonbn_random_password($length = 8) {
@@ -923,41 +923,41 @@  discard block
 block discarded – undo
923 923
 
924 924
 function bigbluebuttonbn_events() {
925 925
     return array(
926
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
927
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
928
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
929
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
930
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
931
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
932
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
933
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
934
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
935
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
936
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
937
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
938
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
939
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
940
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
926
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
927
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
928
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
929
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
930
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
931
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
932
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
933
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
934
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
935
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
936
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
937
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
938
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
939
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
940
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
941 941
     );
942 942
 }
943 943
 
944 944
 function bigbluebuttonbn_events_action() {
945 945
     return array(
946
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
947
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
948
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
949
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
950
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
951
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
952
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
953
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
954
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
955
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
956
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
957
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
958
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
959
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
960
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
946
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
947
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
948
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
949
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
950
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
951
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
952
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
953
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
954
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
955
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
956
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
957
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
958
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
959
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
960
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
961 961
     );
962 962
 }
963 963
 
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
         $eventproperties['other'] = $options['other'];
982 982
     }
983 983
 
984
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
984
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
985 985
       array($eventproperties));
986 986
     $event->trigger();
987 987
 }
@@ -1024,11 +1024,11 @@  discard block
 block discarded – undo
1024 1024
     $now = time();
1025 1025
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1026 1026
         // Use the value in the cache.
1027
-        return (array) json_decode($result['meeting_info']);
1027
+        return (array)json_decode($result['meeting_info']);
1028 1028
     }
1029 1029
 
1030 1030
     // Ping again and refresh the cache.
1031
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1031
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1032 1032
         bigbluebuttonbn_bigbluebutton_action_url('getMeetingInfo', ['meetingID' => $meetingid])
1033 1033
       );
1034 1034
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1082,8 +1082,8 @@  discard block
 block discarded – undo
1082 1082
  * @param string $configxml
1083 1083
  */
1084 1084
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1085
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1086
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.bigbluebuttonbn_get_cfg_shared_secret());
1085
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1086
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . bigbluebuttonbn_get_cfg_shared_secret());
1087 1087
 
1088 1088
     return $configxmlparams;
1089 1089
 }
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
  * @param string $configxml
1094 1094
  */
1095 1095
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1096
-    $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url().'api/setConfigXML?';
1096
+    $urldefaultconfig = bigbluebuttonbn_get_cfg_server_url() . 'api/setConfigXML?';
1097 1097
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1098 1098
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
1099 1099
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
  */
1108 1108
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1109 1109
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1110
-    $configxmlarray = (array) $configxml;
1110
+    $configxmlarray = (array)$configxml;
1111 1111
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1112 1112
         //debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1113 1113
         return '';
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
         $starttime = $starttime - ($starttime % 1000);
1145 1145
 
1146 1146
         // Set formatted date.
1147
-        $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1147
+        $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1148 1148
         $row->date_formatted = userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1149 1149
 
1150 1150
         // Set formatted duration.
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
     }
1220 1220
 
1221 1221
     $recordingpreview = html_writer::start_tag('div',
1222
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1222
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1223 1223
     foreach ($recording['playbacks'] as $playback) {
1224 1224
         if (isset($playback['preview'])) {
1225 1225
             foreach ($playback['preview'] as $image) {
@@ -1252,20 +1252,20 @@  discard block
 block discarded – undo
1252 1252
         $visibility = 'hidden ';
1253 1253
     }
1254 1254
 
1255
-    $id = 'playbacks-'.$recording['recordID'];
1255
+    $id = 'playbacks-' . $recording['recordID'];
1256 1256
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1257 1257
           'data-recordingid' => $recording['recordID'], 'data-meetingid' => $recording['meetingID'],
1258 1258
           'title' => $title, $visibility => $visibility));
1259 1259
     foreach ($recording['playbacks'] as $playback) {
1260 1260
         $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1261
-        $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn='.$bigbluebuttonbnid.
1262
-            '&href='.urlencode($playback['url']).'&rid='.$recording['recordID'];
1261
+        $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=playback&bn=' . $bigbluebuttonbnid .
1262
+            '&href=' . urlencode($playback['url']) . '&rid=' . $recording['recordID'];
1263 1263
         //$href = $playback['url'];
1264
-        $linkattributes = array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'),
1264
+        $linkattributes = array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'),
1265 1265
             'class' => 'btn btn-sm btn-default', 'onclick' => $onclick,
1266 1266
             'data-action' => 'play', 'data-href' => $href);
1267
-        $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_'.$playback['type'],
1268
-            'bigbluebuttonbn'), null, $linkattributes).'&#32;';
1267
+        $recordingtypes .= $OUTPUT->action_link('#', get_string('view_recording_format_' . $playback['type'],
1268
+            'bigbluebuttonbn'), null, $linkattributes) . '&#32;';
1269 1269
     }
1270 1270
     $recordingtypes .= html_writer::end_tag('div');
1271 1271
 
@@ -1346,11 +1346,11 @@  discard block
 block discarded – undo
1346 1346
         $target .= '-' . $data['target'];
1347 1347
     }
1348 1348
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1349
-    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);';
1349
+    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);';
1350 1350
     if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) {
1351 1351
         // With icon for $manageaction.
1352 1352
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1353
-        $icon = new pix_icon('i/'.$data['tag'],
1353
+        $icon = new pix_icon('i/' . $data['tag'],
1354 1354
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1355 1355
             'moodle', $iconattributes);
1356 1356
         $linkattributes = array(
@@ -1441,7 +1441,7 @@  discard block
 block discarded – undo
1441 1441
         // There are recordings for this meeting.
1442 1442
         foreach ($recordings as $recording) {
1443 1443
             $row = new html_table_row();
1444
-            $row->id = 'recording-td-'.$recording['recordID'];
1444
+            $row->id = 'recording-td-' . $recording['recordID'];
1445 1445
             $row->attributes['data-imported'] = 'false';
1446 1446
             $texthead = '';
1447 1447
             $texttail = '';
@@ -1455,9 +1455,9 @@  discard block
 block discarded – undo
1455 1455
             $rowdata = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools);
1456 1456
             if ($rowdata != null) {
1457 1457
                 $rowdata->date_formatted = str_replace(' ', '&nbsp;', $rowdata->date_formatted);
1458
-                $row->cells = array($texthead.$rowdata->recording.$texttail,
1459
-                    $texthead.$rowdata->activity.$texttail, $texthead.$rowdata->description.$texttail,
1460
-                    $rowdata->preview, $texthead.$rowdata->date_formatted.$texttail,
1458
+                $row->cells = array($texthead . $rowdata->recording . $texttail,
1459
+                    $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1460
+                    $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1461 1461
                     $rowdata->duration_formatted);
1462 1462
                 if ($bbbsession['managerecordings']) {
1463 1463
                     $row->cells[] = $rowdata->actionbar;
@@ -1479,9 +1479,9 @@  discard block
 block discarded – undo
1479 1479
     // Build the message_body.
1480 1480
     $msg->activity_type = '';
1481 1481
     $msg->activity_title = $bigbluebuttonbn->name;
1482
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1483
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1484
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1482
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1483
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1484
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1485 1485
 
1486 1486
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1487 1487
 }
@@ -1507,15 +1507,15 @@  discard block
 block discarded – undo
1507 1507
     global $CFG;
1508 1508
 
1509 1509
     if (isset($CFG->bigbluebuttonbn['server_url'])) {
1510
-        return trim(trim($CFG->bigbluebuttonbn['server_url']), '/').'/';
1510
+        return trim(trim($CFG->bigbluebuttonbn['server_url']), '/') . '/';
1511 1511
     }
1512 1512
 
1513 1513
     if (isset($CFG->bigbluebuttonbn_server_url)) {
1514
-        return trim(trim($CFG->bigbluebuttonbn_server_url), '/').'/';
1514
+        return trim(trim($CFG->bigbluebuttonbn_server_url), '/') . '/';
1515 1515
     }
1516 1516
 
1517 1517
     if (isset($CFG->BigBlueButtonBNServerURL)) {
1518
-        return trim(trim($CFG->BigBlueButtonBNServerURL), '/').'/';
1518
+        return trim(trim($CFG->BigBlueButtonBNServerURL), '/') . '/';
1519 1519
     }
1520 1520
 
1521 1521
     return  BIGBLUEBUTTONBN_DEFAULT_SERVER_URL;
@@ -2053,15 +2053,15 @@  discard block
 block discarded – undo
2053 2053
 
2054 2054
     // Gather the bigbluebuttonbnids whose meetingids should be included in the getRecordings request'.
2055 2055
     $select = "id <> '{$bigbluebuttonbnid}' AND course = '{$courseid}'";
2056
-    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
2057
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
2056
+    $selectdeleted = "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
2057
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
2058 2058
     if ($bigbluebuttonbnid === null) {
2059 2059
         $select = "course = '{$courseid}'";
2060
-        $selectdeleted = "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
2060
+        $selectdeleted = "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
2061 2061
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
2062 2062
     } else if ($subset) {
2063 2063
         $select = "id = '{$bigbluebuttonbnid}'";
2064
-        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
2064
+        $selectdeleted = "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
2065 2065
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
2066 2066
     }
2067 2067
     $bigbluebuttonbns = $DB->get_records_select_menu('bigbluebuttonbn', $select, null, 'id', 'id, meetingid');
@@ -2083,7 +2083,7 @@  discard block
 block discarded – undo
2083 2083
     if (!empty($bigbluebuttonbns)) {
2084 2084
         // Prepare select for loading records based on existent bigbluebuttonbns.
2085 2085
         $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
2086
-        $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
2086
+        $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
2087 2087
         // Include only Create events and exclude those with record not true.
2088 2088
         $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
2089 2089
         // Execute select for loading records based on existent bigbluebuttonbns.
@@ -2175,8 +2175,8 @@  discard block
 block discarded – undo
2175 2175
 function bigbluebuttonbn_format_activity_time($time) {
2176 2176
     $activitytime = '';
2177 2177
     if ($time) {
2178
-        $activitytime = calendar_day_representation($time).' '.
2179
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2178
+        $activitytime = calendar_day_representation($time) . ' ' .
2179
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2180 2180
           calendar_time_representation($time);
2181 2181
     }
2182 2182
 
Please login to merge, or discard this patch.
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);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
99 99
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
100
-            header('Location: '.$bbbsession['logoutURL']);
100
+            header('Location: ' . $bbbsession['logoutURL']);
101 101
             break;
102 102
         }
103 103
 
@@ -113,17 +113,17 @@  discard block
 block discarded – undo
113 113
             // The server is unreachable.
114 114
             if ($bbbsession['administrator']) {
115 115
                 print_error('view_error_unable_join', '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 ($bbbsession['moderator']) {
120 120
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
121
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
121
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
122 122
                 break;
123 123
             }
124 124
 
125 125
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
126
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
126
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
127 127
             break;
128 128
         }
129 129
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         // Moodle event logger: Create an event for meeting left.
159 159
         bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
160 160
         // Execute the redirect.
161
-        header('Location: '.urldecode($href));
161
+        header('Location: ' . urldecode($href));
162 162
         break;
163 163
     default:
164 164
         bigbluebutton_bbb_view_close_window();
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     }
202 202
     if ($durationtime > 0) {
203 203
         $data['duration'] = $durationtime;
204
-        $data['welcome'] .= '<br><br>'.str_replace('%duration%', ''.$durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn'));
204
+        $data['welcome'] .= '<br><br>' . str_replace('%duration%', '' . $durationtime, get_string('bbbdurationwarning', 'bigbluebuttonbn'));
205 205
     }
206 206
 
207 207
     $voicebridge = intval($bbbsession['voicebridge']);
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
249 249
         // No more users allowed to join.
250
-        header('Location: '.$bbbsession['logoutURL']);
250
+        header('Location: ' . $bbbsession['logoutURL']);
251 251
         return;
252 252
     }
253 253
 
@@ -266,20 +266,20 @@  discard block
 block discarded – undo
266 266
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
267 267
         ($bbbsession['administrator'] || $bbbsession['moderator']));
268 268
     // Execute the redirect.
269
-    header('Location: '.$joinurl);
269
+    header('Location: ' . $joinurl);
270 270
 }
271 271
 
272 272
 function bigbluebutton_bbb_view_errors($serrors, $id) {
273 273
     global $CFG, $OUTPUT;
274 274
 
275
-    $errors = (array) json_decode(urldecode($serrors));
275
+    $errors = (array)json_decode(urldecode($serrors));
276 276
     $msgerrors = '';
277 277
     foreach ($errors as $error) {
278
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
278
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
279 279
     }
280 280
 
281 281
     echo $OUTPUT->header();
282 282
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
283
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
283
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
284 284
     echo $OUTPUT->footer();
285 285
 }
Please login to merge, or discard this patch.