Completed
Push — master ( 10847d...32c9ae )
by Jesus
03:00
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
-    '&bigbluebuttonbn='.$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
+    '&bigbluebuttonbn=' . $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;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass;
159 159
 
160 160
     // Database info related to the activity.
161
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
161
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
162 162
         $bbbsession['bigbluebuttonbn']->id;
163 163
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
164 164
     $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro;
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
180 180
     }
181 181
     if ($bigbluebuttonbn->record) {
182
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
182
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
183 183
     }
184 184
 
185 185
     $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     $bbbsession['originServerName'] = $parsedurl['host'];
196 196
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
197 197
     $bbbsession['originServerCommonName'] = '';
198
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
198
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
199 199
 }
200 200
 
201 201
 function bigbluebuttonbn_view_get_activity_status(&$bbbsession, $bigbluebuttonbn) {
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
     $bbbsession['group'] = groups_get_activity_group($bbbsession['cm'], true);
248 248
 
249 249
     // Assign group default values.
250
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
251
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
250
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
251
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
252 252
     $groupname = get_string('allparticipants');
253
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
253
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
254 254
 
255 255
 
256 256
     if (sizeof($groups) == 0) {
@@ -262,10 +262,10 @@  discard block
 block discarded – undo
262 262
         $bbbsession['group'] = array_values($groups)[0]->id;
263 263
     }
264 264
 
265
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
266
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
265
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
266
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
267 267
     $groupname = groups_get_group_name($bbbsession['group']);
268
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
268
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
269 269
 
270 270
     if (sizeof($groups) == 1) {
271 271
         // There only one group and the user has access to.
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
     }
274 274
 
275 275
     echo $OUTPUT->box_start('generalbox boxaligncenter');
276
-    echo '<br><div class="alert alert-warning">'.get_string('view_groups_selection_warning', 'bigbluebuttonbn').
276
+    echo '<br><div class="alert alert-warning">' . get_string('view_groups_selection_warning', 'bigbluebuttonbn') .
277 277
       '</div>';
278 278
     echo $OUTPUT->box_end();
279 279
 
280 280
     groups_print_activity_menu(
281
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id, false, $onlyexistentgroups);
281
+      $bbbsession['cm'], $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id, false, $onlyexistentgroups);
282 282
     echo '<br><br>';
283 283
 }
284 284
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             'M.mod_bigbluebuttonbn.recordings.init', array($jsvars));
321 321
     }
322 322
 
323
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
323
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
324 324
 
325 325
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
326 326
 }
@@ -331,12 +331,12 @@  discard block
 block discarded – undo
331 331
     // JavaScript variables for room.
332 332
     $openingtime = '';
333 333
     if ($bbbsession['openingtime']) {
334
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
334
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
335 335
             userdate($bbbsession['openingtime']);
336 336
     }
337 337
     $closingtime = '';
338 338
     if ($bbbsession['closingtime']) {
339
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
339
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
340 340
             userdate($bbbsession['closingtime']);
341 341
     }
342 342
     $jsvars += array(
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     $output .= $OUTPUT->box_end();
354 354
 
355 355
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
356
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
356
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
357 357
     $output .= $OUTPUT->box_end();
358 358
 
359 359
     if ($activity == 'ended') {
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
     // If there are meetings with recordings load the data to the table.
390 390
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
391 391
         // Render a plain html table.
392
-        return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n";
392
+        return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n";
393 393
     }
394 394
 
395 395
     // JavaScript variables for recordings with YUI.
@@ -409,8 +409,8 @@  discard block
 block discarded – undo
409 409
         array('type' => 'button',
410 410
               'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
411 411
               'class' => 'btn btn-secondary',
412
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
413
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
412
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
413
+                  $bbbsession['bigbluebuttonbn']->id . '\''));
414 414
     $output = html_writer::start_tag('br');
415 415
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
416 416
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -425,10 +425,10 @@  discard block
 block discarded – undo
425 425
         $attributes = array('title' => $bbbsession['presentation']['name']);
426 426
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
427 427
 
428
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
429
-                ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
430
-                ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
431
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
428
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
429
+                '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' .
430
+                '' . $OUTPUT->action_link($bbbsession['presentation']['url'],
431
+                      $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
432 432
     }
433 433
 
434 434
     return '';
Please login to merge, or discard this patch.