Completed
Pull Request — master (#38)
by Jesus
03:06 queued 01:07
created
settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once(dirname(__FILE__).'/locallib.php');
30
+require_once(dirname(__FILE__) . '/locallib.php');
31 31
 
32 32
 if ($ADMIN->fulltree) {
33 33
     // Configuration for BigBlueButton.
Please login to merge, or discard this patch.
db/upgrade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@
 block discarded – undo
85 85
         // Migrate settings.
86 86
         unset_config('recordingtagging_default', 'mod_bigbluebuttonbn');
87 87
         unset_config('recordingtagging_editable', 'mod_bigbluebuttonbn');
88
-        $cfgvalue =  get_config('mod_bigbluebuttonbn', 'importrecordings_from_deleted_activities_enabled');
88
+        $cfgvalue = get_config('mod_bigbluebuttonbn', 'importrecordings_from_deleted_activities_enabled');
89 89
         set_config('importrecordings_from_deleted_enabled', $cfgvalue, 'mod_bigbluebuttonbn');
90 90
         unset_config('importrecordings_from_deleted_activities_enabled', 'mod_bigbluebuttonbn');
91
-        $cfgvalue =  get_config('mod_bigbluebuttonbn', 'moderator_default');
91
+        $cfgvalue = get_config('mod_bigbluebuttonbn', 'moderator_default');
92 92
         set_config('participant_moderator_default', $cfgvalue, 'mod_bigbluebuttonbn');
93 93
         unset_config('moderator_default', 'mod_bigbluebuttonbn');
94 94
         // Update db version tag.
Please login to merge, or discard this patch.
view.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'), 'warning');
268 268
 
269 269
     groups_print_activity_menu(
270
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id);
270
+        $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id);
271 271
     echo '<br><br>';
272 272
 }
273 273
 
@@ -435,13 +435,13 @@  discard block
 block discarded – undo
435 435
         $recordings = bigbluebuttonbn_get_recordings(
436 436
             $bbbsession['course']->id, $bigbluebuttonbnid, $showroom,
437 437
             $bbbsession['bigbluebuttonbn']->recordings_deleted
438
-          );
438
+            );
439 439
     }
440 440
 
441 441
     // Get recording links.
442 442
     $recordingsimported = bigbluebuttonbn_get_recordings_imported_array(
443 443
         $bbbsession['course']->id, $bigbluebuttonbnid, $showroom
444
-      );
444
+        );
445 445
 
446 446
     /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent
447 447
      * recordings are not included. */
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
     // JavaScript variables for recordings.
458 458
     $jsvars += array(
459 459
             'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1',
460
-          );
460
+            );
461 461
 
462 462
     // If there are meetings with recordings load the data to the table.
463 463
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
     $jsvars += array(
470 470
             'columns' => bigbluebuttonbn_get_recording_columns($bbbsession),
471 471
             'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings),
472
-          );
472
+            );
473 473
 
474 474
     // Render a YUI table.
475 475
     return html_writer::div('', '', array('id' => 'bigbluebuttonbn_yui_table'));
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
 
481 481
     $button = html_writer::tag('input', '',
482 482
         array('type' => 'button',
483
-              'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
484
-              'class' => 'btn btn-secondary',
485
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
486
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
483
+                'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
484
+                'class' => 'btn btn-secondary',
485
+                'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
486
+                    $bbbsession['bigbluebuttonbn']->id.'\''));
487 487
     $output = html_writer::start_tag('br');
488 488
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
489 489
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
         return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
502 502
                 ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
503 503
                 ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
504
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
504
+                        $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
505 505
     }
506 506
 
507 507
     return '';
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 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
 $bn = optional_param('n', 0, PARAM_INT);
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
 if (is_null($serverversion)) {
57 57
     if ($bbbsession['administrator']) {
58 58
         print_error('view_error_unable_join', 'bigbluebuttonbn',
59
-            $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
59
+            $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
60 60
         exit;
61 61
     }
62 62
 
63 63
     if ($bbbsession['moderator']) {
64 64
         print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
65
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
65
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
66 66
         exit;
67 67
     }
68 68
 
69 69
     print_error('view_error_unable_join_student', 'bigbluebuttonbn',
70
-        $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
70
+        $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
71 71
     exit;
72 72
 }
73
-$bbbsession['serverversion'] = (string) $serverversion;
73
+$bbbsession['serverversion'] = (string)$serverversion;
74 74
 
75 75
 // Mark viewed by user (if required).
76 76
 $completion = new completion_info($course);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 // Print the page header.
80 80
 $PAGE->set_context($context);
81
-$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
81
+$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
82 82
 $PAGE->set_title(format_string($bigbluebuttonbn->name));
83 83
 $PAGE->set_cacheable(false);
84 84
 $PAGE->set_heading($course->fullname);
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) {
89 89
     echo $OUTPUT->header();
90 90
     if (isguestuser()) {
91
-        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
92
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
91
+        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
92
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
93 93
     } else {
94
-        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
95
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
94
+        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
95
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
96 96
     }
97 97
     echo $OUTPUT->footer();
98 98
     exit;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 // Operation URLs.
102 102
 $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
103
-$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .
103
+$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
104 104
     '&bn=' . $bbbsession['bigbluebuttonbn']->id;
105 105
 $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
106 106
     'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 echo $OUTPUT->footer();
121 121
 
122 122
 // Shows version as a comment.
123
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
123
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
124 124
 
125 125
 // Initialize session variable used across views.
126 126
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass;
151 151
 
152 152
     // Database info related to the activity.
153
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
153
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
154 154
         $bbbsession['bigbluebuttonbn']->id;
155 155
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
156 156
     $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
172 172
     }
173 173
     if ($bigbluebuttonbn->record) {
174
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
174
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
175 175
     }
176 176
 
177 177
     $bbbsession['openingtime'] = $bigbluebuttonbn->openingtime;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     $bbbsession['originServerName'] = $parsedurl['host'];
188 188
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
189 189
     $bbbsession['originServerCommonName'] = '';
190
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
190
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
191 191
 }
192 192
 
193 193
 function bigbluebuttonbn_view_bbbsession_roles($context, $userid) {
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
     }
250 250
 
251 251
     // Assign group default values.
252
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
253
-        $bbbsession['bigbluebuttonbn']->id.'['.$bbbsession['group'].']';
254
-    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name.' ('.$groupname.')';
252
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
253
+        $bbbsession['bigbluebuttonbn']->id . '[' . $bbbsession['group'] . ']';
254
+    $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name . ' (' . $groupname . ')';
255 255
 
256 256
     if (count($groups) == 0) {
257 257
         // Only the All participants group exists.
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
     bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'), 'warning');
268 268
 
269 269
     groups_print_activity_menu(
270
-      $bbbsession['cm'], $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id);
270
+      $bbbsession['cm'], $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id);
271 271
     echo '<br><br>';
272 272
 }
273 273
 
274
-function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type='warning', $onlymoderator=false) {
274
+function bigbluebuttonbn_view_message_box(&$bbbsession, $message, $type = 'warning', $onlymoderator = false) {
275 275
     global $OUTPUT;
276 276
     if ($onlymoderator && !$bbbsession['moderator'] && !$bbbsession['administrator']) {
277 277
         return;
@@ -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
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
325 325
 }
326 326
 
@@ -344,21 +344,21 @@  discard block
 block discarded – undo
344 344
     return $output;
345 345
 }
346 346
 
347
-function bigbluebuttonbn_view_render_warning($message, $type='info', $href='', $text='', $class='') {
347
+function bigbluebuttonbn_view_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') {
348 348
     global $OUTPUT;
349 349
     $output = "\n";
350 350
     // Evaluates if config_warning is enabled.
351 351
     if (empty($message)) {
352 352
         return $output;
353 353
     }
354
-    $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', 'bigbluebuttonbn_view_general_warning')."\n";
355
-    $output .= '  <button type="button" class="close" data-dismiss="alert">&times;</button>'.$message."\n";
356
-    $output .= '  <div class="singlebutton">'."\n";
354
+    $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', 'bigbluebuttonbn_view_general_warning') . "\n";
355
+    $output .= '  <button type="button" class="close" data-dismiss="alert">&times;</button>' . $message . "\n";
356
+    $output .= '  <div class="singlebutton">' . "\n";
357 357
     if (!empty($href)) {
358 358
         $output .= bigbluebutton_view_render_general_warning_button($href, $text, $class);
359 359
     }
360
-    $output .= '  </div>'."\n";
361
-    $output .= $OUTPUT->box_end()."\n";
360
+    $output .= '  </div>' . "\n";
361
+    $output .= $OUTPUT->box_end() . "\n";
362 362
     return $output;
363 363
 }
364 364
 
@@ -369,11 +369,11 @@  discard block
 block discarded – undo
369 369
     if ($class == '') {
370 370
         $class = 'btn btn-secondary';
371 371
     }
372
-    $output  = '  <form method="post" action="' . $href . '" class="form-inline">'."\n";
373
-    $output .= '      <button type="submit" class="' . $class . '"'."\n";
374
-    $output .= '          title=""'."\n";
375
-    $output .= '          >' . $text . '</button>'."\n";
376
-    $output .= '  </form>'."\n";
372
+    $output  = '  <form method="post" action="' . $href . '" class="form-inline">' . "\n";
373
+    $output .= '      <button type="submit" class="' . $class . '"' . "\n";
374
+    $output .= '          title=""' . "\n";
375
+    $output .= '          >' . $text . '</button>' . "\n";
376
+    $output .= '  </form>' . "\n";
377 377
     return $output;
378 378
 }
379 379
 
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
     // JavaScript variables for room.
384 384
     $openingtime = '';
385 385
     if ($bbbsession['openingtime']) {
386
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
386
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
387 387
             userdate($bbbsession['openingtime']);
388 388
     }
389 389
     $closingtime = '';
390 390
     if ($bbbsession['closingtime']) {
391
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
391
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
392 392
             userdate($bbbsession['closingtime']);
393 393
     }
394 394
     $jsvars += array(
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
     $output .= $OUTPUT->box_end();
406 406
 
407 407
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
408
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
408
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
409 409
     $output .= $OUTPUT->box_end();
410 410
 
411 411
     if ($activity == 'ended') {
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
     // Get recordings.
433 433
     $recordings = array();
434
-    if ( bigbluebuttonbn_view_include_recordings($bbbsession) ) {
434
+    if (bigbluebuttonbn_view_include_recordings($bbbsession)) {
435 435
         $recordings = bigbluebuttonbn_get_recordings(
436 436
             $bbbsession['course']->id, $bigbluebuttonbnid, $showroom,
437 437
             $bbbsession['bigbluebuttonbn']->recordings_deleted
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
     // If there are meetings with recordings load the data to the table.
463 463
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
464 464
         // Render a plain html table.
465
-        return bigbluebutton_output_recording_table($bbbsession, $recordings)."\n";
465
+        return bigbluebutton_output_recording_table($bbbsession, $recordings) . "\n";
466 466
     }
467 467
 
468 468
     // JavaScript variables for recordings with YUI.
@@ -482,8 +482,8 @@  discard block
 block discarded – undo
482 482
         array('type' => 'button',
483 483
               'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
484 484
               'class' => 'btn btn-secondary',
485
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
486
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
485
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
486
+                  $bbbsession['bigbluebuttonbn']->id . '\''));
487 487
     $output = html_writer::start_tag('br');
488 488
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
489 489
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -498,10 +498,10 @@  discard block
 block discarded – undo
498 498
         $attributes = array('title' => $bbbsession['presentation']['name']);
499 499
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
500 500
 
501
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
502
-                ''.$OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).''.
503
-                ''.$OUTPUT->action_link($bbbsession['presentation']['url'],
504
-                      $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
501
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
502
+                '' . $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) . '' .
503
+                '' . $OUTPUT->action_link($bbbsession['presentation']['url'],
504
+                      $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
505 505
     }
506 506
 
507 507
     return '';
Please login to merge, or discard this patch.