Completed
Pull Request — master (#125)
by
unknown
01:56
created
mod_form.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
 defined('MOODLE_INTERNAL') || die();
28 28
 
29
-require_once(dirname(__FILE__).'/locallib.php');
30
-require_once($CFG->dirroot.'/course/moodleform_mod.php');
29
+require_once(dirname(__FILE__) . '/locallib.php');
30
+require_once($CFG->dirroot . '/course/moodleform_mod.php');
31 31
 
32 32
 /**
33 33
  * Moodle class for mod_form.
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $serverversion = bigbluebuttonbn_get_server_version();
49 49
         if (is_null($serverversion)) {
50 50
             print_error('general_error_unable_connect', 'bigbluebuttonbn',
51
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
51
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
52 52
             return;
53 53
         }
54 54
         // Context.
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         // If none is allowed, fail and return.
79 79
         if (empty($jsvars['instanceTypeProfiles'])) {
80 80
             print_error('general_error_not_allowed_to_create_instances)', 'bigbluebuttonbn',
81
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
81
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
82 82
             return;
83 83
         }
84 84
         $this->bigbluebuttonbn_mform_add_block_profiles($mform, $jsvars['instanceTypeProfiles']);
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                 );
127 127
                 $defaultvalues['presentation'] = $draftitemid;
128 128
             } catch (Exception $e) {
129
-                debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER);
129
+                debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER);
130 130
                 return;
131 131
             }
132 132
         }
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
             return;
460 460
         }
461 461
         $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options);
462
-        if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) {
462
+        if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) {
463 463
             $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn');
464 464
         }
465 465
         if (!empty($rule)) {
Please login to merge, or discard this patch.
import_view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
 use mod_bigbluebuttonbn\output\import_view;
28 28
 use mod_bigbluebuttonbn\output\renderer;
29 29
 
30
-require(__DIR__.'/../../config.php');
31
-require_once(__DIR__.'/locallib.php');
30
+require(__DIR__ . '/../../config.php');
31
+require_once(__DIR__ . '/locallib.php');
32 32
 
33 33
 $bn = required_param('bn', PARAM_INT);
34 34
 $tc = optional_param('tc', 0, PARAM_INT);
Please login to merge, or discard this patch.
settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once(__DIR__.'/locallib.php');
31
+require_once(__DIR__ . '/locallib.php');
32 32
 
33 33
 if ($hassiteconfig) {
34 34
     // Configuration for BigBlueButton.
Please login to merge, or discard this patch.
view.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
 use mod_bigbluebuttonbn\plugin;
29 29
 
30
-require(__DIR__.'/../../config.php');
31
-require_once(__DIR__.'/locallib.php');
32
-require_once(__DIR__.'/viewlib.php');
30
+require(__DIR__ . '/../../config.php');
31
+require_once(__DIR__ . '/locallib.php');
32
+require_once(__DIR__ . '/viewlib.php');
33 33
 
34 34
 $id = required_param('id', PARAM_INT);
35 35
 $bn = optional_param('bn', 0, PARAM_INT);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 bigbluebuttonbn_view_bbbsession_set($PAGE->context, $bbbsession);
59 59
 
60 60
 // Validates if the BigBlueButton server is working.
61
-$serverversion = bigbluebuttonbn_get_server_version();  // In locallib.
61
+$serverversion = bigbluebuttonbn_get_server_version(); // In locallib.
62 62
 if ($serverversion === null) {
63 63
     $errmsg = 'view_error_unable_join_student';
64 64
     $errurl = '/course/view.php';
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     }
73 73
     print_error($errmsg, plugin::COMPONENT, new moodle_url($errurl, $errurlparams));
74 74
 }
75
-$bbbsession['serverversion'] = (string) $serverversion;
75
+$bbbsession['serverversion'] = (string)$serverversion;
76 76
 
77 77
 // Mark viewed by user (if required).
78 78
 $completion = new completion_info($course);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 echo $OUTPUT->footer();
117 117
 
118 118
 // Shows version as a comment.
119
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
119
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
120 120
 
121 121
 // Initialize session variable used across views.
122 122
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
123 123
\ No newline at end of file
Please login to merge, or discard this patch.
brokerlib.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
209 209
     $callbackresponse['status'] = true;
210 210
     $callbackresponse['found'] = true;
211
-    $callbackresponse['published'] = (string) $recording['published'];
211
+    $callbackresponse['published'] = (string)$recording['published'];
212 212
     if (!isset($params['meta']) || empty($params['meta'])) {
213 213
         return $callbackresponse;
214 214
     }
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
         $decodedparameters = JWT::decode($params['signed_parameters'],
536 536
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
537 537
     } catch (Exception $e) {
538
-        $error = 'Caught exception: '.$e->getMessage();
539
-        header('HTTP/1.0 400 Bad Request. '.$error);
538
+        $error = 'Caught exception: ' . $e->getMessage();
539
+        header('HTTP/1.0 400 Bad Request. ' . $error);
540 540
         return;
541 541
     }
542 542
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -561,12 +561,12 @@  discard block
 block discarded – undo
561 561
             bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
562 562
         }
563 563
         $overrides = array('meetingid' => $decodedparameters->meeting_id);
564
-        $meta = '{"recordid":'.$decodedparameters->record_id.'}';
564
+        $meta = '{"recordid":' . $decodedparameters->record_id . '}';
565 565
         bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
566 566
         header('HTTP/1.0 202 Accepted');
567 567
     } catch (Exception $e) {
568
-        $error = 'Caught exception: '.$e->getMessage();
569
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
568
+        $error = 'Caught exception: ' . $e->getMessage();
569
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
570 570
     }
571 571
 }
572 572
 
@@ -587,13 +587,13 @@  discard block
 block discarded – undo
587 587
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
588 588
     if (!isset($importrecordings[$params['id']])) {
589 589
         $error = "Recording {$params['id']} could not be found. It can not be imported";
590
-        header('HTTP/1.0 404 Not found. '.$error);
590
+        header('HTTP/1.0 404 Not found. ' . $error);
591 591
         return;
592 592
     }
593 593
     $callbackresponse = array('status' => true);
594 594
     $importrecordings[$params['id']]['imported'] = true;
595 595
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
596
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
596
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
597 597
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
598 598
     // Moodle event logger: Create an event for recording imported.
599 599
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -618,8 +618,8 @@  discard block
 block discarded – undo
618 618
         $decodedparameters = JWT::decode($params['signed_parameters'],
619 619
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
620 620
     } catch (Exception $e) {
621
-        $error = 'Caught exception: '.$e->getMessage();
622
-        header('HTTP/1.0 400 Bad Request. '.$error);
621
+        $error = 'Caught exception: ' . $e->getMessage();
622
+        header('HTTP/1.0 400 Bad Request. ' . $error);
623 623
         return;
624 624
     }
625 625
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
     }
661 661
     $action = strtolower($params['action']);
662 662
     if (!array_key_exists($action, $requiredparams)) {
663
-        return 'Action '.$params['action'].' can not be performed.';
663
+        return 'Action ' . $params['action'] . ' can not be performed.';
664 664
     }
665 665
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
666 666
 }
Please login to merge, or discard this patch.
classes/output/mobile.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         global $OUTPUT, $SESSION, $CFG;
57 57
 
58
-        $args = (object) $args;
58
+        $args = (object)$args;
59 59
         $viewinstance = bigbluebuttonbn_view_validator($args->cmid, null);
60 60
         if (!$viewinstance) {
61 61
             $error = get_string('view_error_url_missing_parameters', 'bigbluebuttonbn');
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $bigbluebuttonbn = $viewinstance['bigbluebuttonbn'];
68 68
         $context = context_module::instance($cm->id);
69 69
 
70
-        require_login($course->id, false , $cm, true, true);
70
+        require_login($course->id, false, $cm, true, true);
71 71
         require_capability('mod/bigbluebuttonbn:join', $context);
72 72
 
73 73
         // Add view event.
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
         // Check if the BBB server is working.
114 114
         $serverversion = bigbluebuttonbn_get_server_version();
115
-        $bbbsession['serverversion'] = (string) $serverversion;
115
+        $bbbsession['serverversion'] = (string)$serverversion;
116 116
         if (is_null($serverversion)) {
117 117
 
118 118
             if ($bbbsession['administrator']) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
         // Operation URLs.
141 141
         $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
142
-        $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$args->cmid .
142
+        $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $args->cmid .
143 143
             '&bn=' . $bbbsession['bigbluebuttonbn']->id;
144 144
         $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
145 145
             'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             }
183 183
             if ($response['returncode'] == 'FAILED') {
184 184
                 // The meeting could not be created.
185
-                $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'],  'view_error_create');
185
+                $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
186 186
                 $e = get_string($errorkey, 'bigbluebuttonbn');
187 187
                 return(self::mobile_print_error($e));
188 188
             }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn);
196 196
             // Insert a record that meeting was created.
197 197
             $overrides = array('meetingid' => $bbbsession['meetingid']);
198
-            $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
198
+            $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
199 199
             bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta);
200 200
         }
201 201
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
         $data = array(
223 223
             'bigbluebuttonbn' => $bigbluebuttonbn,
224
-            'bbbsession' => (object) $bbbsession,
224
+            'bbbsession' => (object)$bbbsession,
225 225
             'msjgroup' => $msjgroup,
226 226
             'urltojoin' => $urltojoin,
227 227
             'cmid' => $cm->id,
Please login to merge, or discard this patch.
classes/output/import_view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
 defined('MOODLE_INTERNAL') || die();
38 38
 
39
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/locallib.php');
39
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
40 40
 
41 41
 /**
42 42
  * Class import_view
Please login to merge, or discard this patch.
classes/output/index.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 defined('MOODLE_INTERNAL') || die();
36 36
 
37
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/locallib.php');
37
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
38 38
 
39 39
 /**
40 40
  * Class index
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 // Add a the data for the bigbluebuttonbn instance.
93 93
                 $groupobj = null;
94 94
                 if (groups_get_activity_groupmode($cm) > 0) {
95
-                    $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants'));
95
+                    $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants'));
96 96
                 }
97 97
                 $table->data[] = self::bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj);
98 98
                 // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any.
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             $attendeecount = 0;
183 183
             foreach ($meetinginfo['attendees']->attendee as $attendee) {
184 184
                 if ($attendee->role == $role) {
185
-                    $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName;
185
+                    $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName;
186 186
                 }
187 187
             }
188 188
         }
@@ -216,17 +216,17 @@  discard block
 block discarded – undo
216 216
     public static function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
217 217
         $actions = '';
218 218
         if ($moderator) {
219
-            $actions .= '<form name="form1" method="post" action="">'."\n";
220
-            $actions .= '  <INPUT type="hidden" name="id" value="'.$course->id.'">'."\n";
221
-            $actions .= '  <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'."\n";
219
+            $actions .= '<form name="form1" method="post" action="">' . "\n";
220
+            $actions .= '  <INPUT type="hidden" name="id" value="' . $course->id . '">' . "\n";
221
+            $actions .= '  <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . "\n";
222 222
             if ($groupobj != null) {
223
-                $actions .= '  <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'."\n";
223
+                $actions .= '  <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . "\n";
224 224
             }
225 225
             $actions .= '  <INPUT type="submit" name="submit" value="' .
226 226
                 get_string('view_conference_action_end', 'bigbluebuttonbn') .
227 227
                 '" class="btn btn-primary btn-sm" onclick="return confirm(\'' .
228 228
                 get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . "\n";
229
-            $actions .= '</form>'."\n";
229
+            $actions .= '</form>' . "\n";
230 230
         }
231 231
         return $actions;
232 232
     }
Please login to merge, or discard this patch.
bbb_broker.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
  * @author    Darko Miletic  (darko.miletic [at] gmail [dt] com)
25 25
  */
26 26
 
27
-require(__DIR__.'/../../config.php');
28
-require_once(__DIR__.'/locallib.php');
29
-require_once(__DIR__.'/brokerlib.php');
27
+require(__DIR__ . '/../../config.php');
28
+require_once(__DIR__ . '/locallib.php');
29
+require_once(__DIR__ . '/brokerlib.php');
30 30
 
31 31
 use \Firebase\JWT\JWT;
32 32
 
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 require_login(null, false);
45 45
 
46 46
 if (empty($params['action'])) {
47
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
47
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
48 48
     return;
49 49
 }
50 50
 
51 51
 $error = bigbluebuttonbn_broker_validate_parameters($params);
52 52
 if (!empty($error)) {
53
-    header('HTTP/1.0 400 Bad Request. '.$error);
53
+    header('HTTP/1.0 400 Bad Request. ' . $error);
54 54
     return;
55 55
 }
56 56
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn);
135 135
         return;
136 136
     }
137
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
137
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
138 138
 } catch (Exception $e) {
139
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
139
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
140 140
 }
141 141
\ No newline at end of file
Please login to merge, or discard this patch.