Completed
Push — master ( 1a424a...349780 )
by Jesus
02:02
created
bbb_view.php 3 patches
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.
Switch Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -62,106 +62,106 @@
 block discarded – undo
62 62
 }
63 63
 
64 64
 switch (strtolower($action)) {
65
-    case 'logout':
66
-        if (isset($errors) && $errors != '') {
67
-            bigbluebutton_bbb_view_errors($errors, $id);
68
-            break;
69
-        }
65
+        case 'logout':
66
+            if (isset($errors) && $errors != '') {
67
+                bigbluebutton_bbb_view_errors($errors, $id);
68
+                break;
69
+            }
70 70
 
71
-        if (is_null($bbbsession)) {
72
-            bigbluebutton_bbb_view_close_window_manually();
73
-            break;
74
-        }
71
+            if (is_null($bbbsession)) {
72
+                bigbluebutton_bbb_view_close_window_manually();
73
+                break;
74
+            }
75 75
 
76
-        // Moodle event logger: Create an event for meeting left.
77
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
76
+            // Moodle event logger: Create an event for meeting left.
77
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
78 78
 
79
-        // Update the cache.
80
-        $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
79
+            // Update the cache.
80
+            $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED);
81 81
 
82
-        // Close the tab or window where BBB was opened.
83
-        bigbluebutton_bbb_view_close_window();
84
-        break;
85
-    case 'join':
86
-        if (is_null($bbbsession)) {
87
-            print_error('view_error_unable_join', 'bigbluebuttonbn');
82
+            // Close the tab or window where BBB was opened.
83
+            bigbluebutton_bbb_view_close_window();
88 84
             break;
89
-        }
85
+        case 'join':
86
+            if (is_null($bbbsession)) {
87
+                print_error('view_error_unable_join', 'bigbluebuttonbn');
88
+                break;
89
+            }
90 90
 
91
-        // See if the session is in progress.
92
-        if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
93
-            // Since the meeting is already running, we just join the session.
94
-            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
95
-            break;
96
-        }
91
+            // See if the session is in progress.
92
+            if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
93
+                // Since the meeting is already running, we just join the session.
94
+                bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
95
+                break;
96
+            }
97 97
 
98
-        // If user is not administrator nor moderator (user is steudent) and waiting is required.
99
-        if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
100
-            header('Location: '.$bbbsession['logoutURL']);
101
-            break;
102
-        }
103
-
104
-        // As the meeting doesn't exist, try to create it.
105
-        $response = bigbluebuttonbn_get_create_meeting_array(
106
-            bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
107
-            bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
108
-            $bbbsession['presentation']['name'],
109
-            $bbbsession['presentation']['url']
110
-        );
111
-
112
-        if (!$response) {
113
-            // The server is unreachable.
114
-            if ($bbbsession['administrator']) {
115
-                print_error('view_error_unable_join', 'bigbluebuttonbn',
116
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
98
+            // If user is not administrator nor moderator (user is steudent) and waiting is required.
99
+            if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
100
+                header('Location: '.$bbbsession['logoutURL']);
117 101
                 break;
118 102
             }
119
-            if ($bbbsession['moderator']) {
120
-                print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
103
+
104
+            // As the meeting doesn't exist, try to create it.
105
+            $response = bigbluebuttonbn_get_create_meeting_array(
106
+                bigbluebutton_bbb_view_create_meeting_data($bbbsession, $bigbluebuttonbn),
107
+                bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
108
+                $bbbsession['presentation']['name'],
109
+                $bbbsession['presentation']['url']
110
+            );
111
+
112
+            if (!$response) {
113
+                // The server is unreachable.
114
+                if ($bbbsession['administrator']) {
115
+                    print_error('view_error_unable_join', 'bigbluebuttonbn',
116
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
117
+                    break;
118
+                }
119
+                if ($bbbsession['moderator']) {
120
+                    print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
121
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
122
+                    break;
123
+                }
124
+
125
+                print_error('view_error_unable_join_student', 'bigbluebuttonbn',
121 126
                     $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
122 127
                 break;
123 128
             }
124 129
 
125
-            print_error('view_error_unable_join_student', 'bigbluebuttonbn',
126
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
127
-            break;
128
-        }
130
+            if ($response['returncode'] == 'FAILED') {
131
+                // The meeting was not created.
132
+                if (!$printerrorkey) {
133
+                    print_error($response['message'], 'bigbluebuttonbn');
134
+                    break;
135
+                }
136
+                $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
137
+                print_error($printerrorkey, 'bigbluebuttonbn');
138
+                break;
139
+            }
129 140
 
130
-        if ($response['returncode'] == 'FAILED') {
131
-            // The meeting was not created.
132
-            if (!$printerrorkey) {
133
-                print_error($response['message'], 'bigbluebuttonbn');
141
+            if ($response['hasBeenForciblyEnded'] == 'true') {
142
+                print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
134 143
                 break;
135 144
             }
136
-            $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
137
-            print_error($printerrorkey, 'bigbluebuttonbn');
138
-            break;
139
-        }
140 145
 
141
-        if ($response['hasBeenForciblyEnded'] == 'true') {
142
-            print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
146
+            // Moodle event logger: Create an event for meeting created.
147
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
148
+            // Internal logger: Insert a record with the meeting created.
149
+            bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
150
+            // Since the meeting is already running, we just join the session.
151
+            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
152
+            break;
153
+        case 'playback':
154
+            if ($href == '') {
155
+                bigbluebutton_bbb_view_close_window();
156
+                return;
157
+            }
158
+            // Moodle event logger: Create an event for meeting left.
159
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
160
+            // Execute the redirect.
161
+            header('Location: '.urldecode($href));
143 162
             break;
144
-        }
145
-
146
-        // Moodle event logger: Create an event for meeting created.
147
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
148
-        // Internal logger: Insert a record with the meeting created.
149
-        bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
150
-        // Since the meeting is already running, we just join the session.
151
-        bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
152
-        break;
153
-    case 'playback':
154
-        if ($href == '') {
163
+        default:
155 164
             bigbluebutton_bbb_view_close_window();
156
-            return;
157
-        }
158
-        // Moodle event logger: Create an event for meeting left.
159
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
160
-        // Execute the redirect.
161
-        header('Location: '.urldecode($href));
162
-        break;
163
-    default:
164
-        bigbluebutton_bbb_view_close_window();
165 165
 }
166 166
 
167 167
 function bigbluebutton_bbb_view_close_window() {
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
 
179 179
 function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession, $bigbluebuttonbn) {
180 180
     $data = ['meetingID' => $bbbsession['meetingid'],
181
-              'name' => $bbbsession['meetingname'],
182
-              'attendeePW' => $bbbsession['viewerPW'],
183
-              'moderatorPW' => $bbbsession['modPW'],
184
-              'logoutURL' => $bbbsession['logoutURL'],
181
+                'name' => $bbbsession['meetingname'],
182
+                'attendeePW' => $bbbsession['viewerPW'],
183
+                'moderatorPW' => $bbbsession['modPW'],
184
+                'logoutURL' => $bbbsession['logoutURL'],
185 185
             ];
186 186
 
187 187
     $data['record'] = 'false';
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
     global $USER;
222 222
 
223 223
     $metadata = ['bbb-origin' => $bbbsession['origin'],
224
-                 'bbb-origin-version' => $bbbsession['originVersion'],
225
-                 'bbb-origin-server-name' => $bbbsession['originServerName'],
226
-                 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
227
-                 'bbb-origin-tag' => $bbbsession['originTag'],
228
-                 'bbb-context' => $bbbsession['course']->fullname,
229
-                 'bbb-recording-name' => $bbbsession['meetingname'],
230
-                 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
231
-                 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
224
+                    'bbb-origin-version' => $bbbsession['originVersion'],
225
+                    'bbb-origin-server-name' => $bbbsession['originServerName'],
226
+                    'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
227
+                    'bbb-origin-tag' => $bbbsession['originTag'],
228
+                    'bbb-context' => $bbbsession['course']->fullname,
229
+                    'bbb-recording-name' => $bbbsession['meetingname'],
230
+                    'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
231
+                    'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
232 232
                 ];
233 233
 
234 234
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
             array(
237 237
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
238 238
                 'context' => $bbbsession['bigbluebuttonbnURL']
239
-              )
240
-          );
239
+                )
240
+            );
241 241
     }
242 242
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
243 243
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
Please login to merge, or discard this patch.
mod_form.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 'alt' => get_string('delete'),
112 112
                 'title' => get_string('delete'),
113 113
                 'src' => $jsvars['pix_icon_delete']
114
-              );
114
+                );
115 115
 
116 116
             $jsvars['pix_icon_delete'] = html_writer::tag('img', $options);
117 117
         }
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
212 212
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6],
213 213
                 ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'),
214
-                 'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
215
-              );
214
+                    'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
215
+                );
216 216
         } else {
217 217
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
218 218
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             $field['description_key'], $cfg['recordings_html_default']);
255 255
 
256 256
         $field = ['type' => 'hidden', 'name' => 'recordings_deleted_activities', 'data_type' => PARAM_INT,
257
-                  'description_key' => null];
257
+                    'description_key' => null];
258 258
         if ($cfg['recordings_deleted_activities_editable']) {
259 259
             $field['type'] = 'checkbox';
260 260
             $field['description_key'] = 'mod_form_field_recordings_deleted_activities';
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type',
310 310
                 $participantselection['type_selected'], array(),
311 311
                 array('id' => 'bigbluebuttonbn_participant_selection_type',
312
-                      'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).'&nbsp;&nbsp;'.
312
+                        'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).'&nbsp;&nbsp;'.
313 313
             html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
314 314
                 $participantselection['selected'], array(),
315 315
                 array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).'&nbsp;&nbsp;'.
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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
 class mod_bigbluebuttonbn_mod_form extends moodleform_mod {
33 33
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         $serverversion = bigbluebuttonbn_get_server_version();
39 39
         if (is_null($serverversion)) {
40 40
             print_error('general_error_unable_connect', 'bigbluebuttonbn',
41
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
41
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
42 42
         }
43 43
 
44 44
         $bigbluebuttonbn = null;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                 );
130 130
                 $defaultvalues['presentation'] = $draftitemid;
131 131
             } catch (Exception $e) {
132
-                debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER);
132
+                debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER);
133 133
                 return null;
134 134
             }
135 135
         }
@@ -309,10 +309,10 @@  discard block
 block discarded – undo
309 309
             html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type',
310 310
                 $participantselection['type_selected'], array(),
311 311
                 array('id' => 'bigbluebuttonbn_participant_selection_type',
312
-                      'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).'&nbsp;&nbsp;'.
312
+                      'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')) . '&nbsp;&nbsp;' .
313 313
             html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
314 314
                 $participantselection['selected'], array(),
315
-                array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).'&nbsp;&nbsp;'.
315
+                array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')) . '&nbsp;&nbsp;' .
316 316
             html_writer::tag('input', '', array('id' => 'id_addselectionid', 'type' => 'button', 'class' => 'btn btn-secondary',
317 317
                 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'),
318 318
                 'onclick' => 'M.mod_bigbluebuttonbn.modform.participant_add(); return 0;'
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         // Render elements for participant list.
333 333
         $htmllist = html_writer::tag('div',
334 334
             html_writer::label(get_string('mod_form_field_participant_list', 'bigbluebuttonbn'),
335
-                'bigbluebuttonbn_participant_list').
335
+                'bigbluebuttonbn_participant_list') .
336 336
             html_writer::table($table)
337 337
         );
338 338
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
         }
366 366
 
367 367
         $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options);
368
-        if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) {
368
+        if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) {
369 369
             $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn');
370 370
         }
371 371
         if (!empty($rule)) {
Please login to merge, or discard this patch.
classes/locallib/notifier.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         global $USER;
35 35
 
36 36
         // Prepare message.
37
-        $msg = (object) array();
37
+        $msg = (object)array();
38 38
         // Build the message_body.
39 39
         $msg->action = $action;
40 40
         $msg->activity_type = '';
@@ -54,26 +54,26 @@  discard block
 block discarded – undo
54 54
     }
55 55
 
56 56
     public static function notification_msg_html($msg) {
57
-        $messagetext = '<p>'.$msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
58
-            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
59
-        $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.
60
-            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
61
-        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
62
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
63
-            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
64
-        $messagetext .= $msg->activity_title.'</td></tr>'."\n";
65
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
66
-            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
67
-        $messagetext .= $msg->activity_description.'</td></tr>'."\n";
68
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
69
-            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
70
-        $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";
71
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
72
-            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
73
-        $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";
74
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.
75
-            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
76
-        $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
57
+        $messagetext = '<p>' . $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
58
+            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
59
+        $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .
60
+            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
61
+        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
62
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
63
+            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
64
+        $messagetext .= $msg->activity_title . '</td></tr>' . "\n";
65
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
66
+            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
67
+        $messagetext .= $msg->activity_description . '</td></tr>' . "\n";
68
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
69
+            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
70
+        $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";
71
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
72
+            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
73
+        $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";
74
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .
75
+            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
76
+        $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
77 77
         return $messagetext;
78 78
     }
79 79
 
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
         $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
84 84
 
85 85
         // Complete message.
86
-        $msg = (object) array();
86
+        $msg = (object)array();
87 87
         $msg->user_name = fullname($sender);
88 88
         $msg->user_email = $sender->email;
89 89
         $msg->course_name = "$course->fullname";
90
-        $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.
91
-            $msg->user_name.'('.$msg->user_email.') ';
92
-        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
90
+        $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' .
91
+            $msg->user_name . '(' . $msg->user_email . ') ';
92
+        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
93 93
 
94
-        $users = (array) get_enrolled_users($context,'',0,'u.*',null,0,0,true);
94
+        $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
95 95
         foreach ($users as $user) {
96 96
             if ($user->id != $sender->id) {
97 97
                 message_post_message($sender, $user, $message, FORMAT_HTML);
Please login to merge, or discard this patch.
classes/locallib/bigbluebutton.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,17 +37,17 @@
 block discarded – undo
37 37
      * @return string
38 38
      */
39 39
     public static function action_url($action = '', $data = array(), $metadata = array()) {
40
-        $baseurl = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/'.$action.'?';
40
+        $baseurl = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/' . $action . '?';
41 41
         $params = '';
42 42
 
43 43
         foreach ($data as $key => $value) {
44
-            $params .= '&'.$key.'='.urlencode($value);
44
+            $params .= '&' . $key . '=' . urlencode($value);
45 45
         }
46 46
 
47 47
         foreach ($metadata as $key => $value) {
48
-            $params .= '&'.'meta_'.$key.'='.urlencode($value);
48
+            $params .= '&' . 'meta_' . $key . '=' . urlencode($value);
49 49
         }
50 50
 
51
-        return $baseurl.$params.'&checksum='.sha1($action.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
51
+        return $baseurl . $params . '&checksum=' . sha1($action . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
classes/locallib/config.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public static function defaultvalues() {
49 49
         return array(
50
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
51
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
50
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
51
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
52 52
             'importrecordings_enabled' => 'false',
53 53
             'voicebridge_editable' => 'false',
54 54
             'recording_default' => 'true',
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
         global $CFG;
99 99
 
100 100
         if (isset($CFG->bigbluebuttonbn[$setting])) {
101
-            return (string) $CFG->bigbluebuttonbn[$setting];
101
+            return (string)$CFG->bigbluebuttonbn[$setting];
102 102
         }
103 103
 
104
-        if (isset($CFG->{'bigbluebuttonbn_'.$setting})) {
105
-            return (string)$CFG->{'bigbluebuttonbn_'.$setting};
104
+        if (isset($CFG->{'bigbluebuttonbn_' . $setting})) {
105
+            return (string)$CFG->{'bigbluebuttonbn_' . $setting};
106 106
         }
107 107
 
108 108
         return  self::defaultvalue($setting);
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -122,23 +122,23 @@
 block discarded – undo
122 122
      */
123 123
     public static function get_options() {
124 124
         return [
125
-               'version_major' => self::get_moodle_version_major(),
126
-               'voicebridge_editable' => self::get('voicebridge_editable'),
127
-               'recording_default' => self::get('recording_default'),
128
-               'recording_editable' => self::get('recording_editable'),
129
-               'waitformoderator_default' => self::get('waitformoderator_default'),
130
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
131
-               'userlimit_default' => self::get('userlimit_default'),
132
-               'userlimit_editable' => self::get('userlimit_editable'),
133
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
134
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
135
-               'recordings_html_default' => self::get('recordings_html_default'),
136
-               'recordings_html_editable' => self::get('recordings_html_editable'),
137
-               'recordings_deleted_activities_default' => self::get('recordings_deleted_activities_default'),
138
-               'recordings_deleted_activities_editable' => self::get('recordings_deleted_activities_editable'),
139
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
140
-               'instance_type_enabled' => self::recordings_enabled(),
141
-               'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
142
-          ];
125
+                'version_major' => self::get_moodle_version_major(),
126
+                'voicebridge_editable' => self::get('voicebridge_editable'),
127
+                'recording_default' => self::get('recording_default'),
128
+                'recording_editable' => self::get('recording_editable'),
129
+                'waitformoderator_default' => self::get('waitformoderator_default'),
130
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
131
+                'userlimit_default' => self::get('userlimit_default'),
132
+                'userlimit_editable' => self::get('userlimit_editable'),
133
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
134
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
135
+                'recordings_html_default' => self::get('recordings_html_default'),
136
+                'recordings_html_editable' => self::get('recordings_html_editable'),
137
+                'recordings_deleted_activities_default' => self::get('recordings_deleted_activities_default'),
138
+                'recordings_deleted_activities_editable' => self::get('recordings_deleted_activities_editable'),
139
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
140
+                'instance_type_enabled' => self::recordings_enabled(),
141
+                'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
142
+            ];
143 143
     }
144 144
 }
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_live_session_event.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
      */
35 35
     protected function init() {
36 36
         parent::init();
37
-        $this->description = "The user with id '$this->userid' triggered action $this->other in a ".
38
-        "bigbluebutton meeting for the bigbluebuttonbn activity with id ".
37
+        $this->description = "The user with id '$this->userid' triggered action $this->other in a " .
38
+        "bigbluebutton meeting for the bigbluebuttonbn activity with id " .
39 39
         "'$this->objectid' for the course id '$this->contextinstanceid'.";
40 40
     }
41 41
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_recording_unprotected.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     protected function init() {
36 36
         parent::init();
37
-        $this->description = "The user with id '$this->userid' has unprotected a recording with id ".
37
+        $this->description = "The user with id '$this->userid' has unprotected a recording with id " .
38 38
             "'$this->other' in the course id '$this->contextinstanceid'.";
39 39
     }
40 40
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_meeting_created.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     protected function init() {
36 36
         parent::init();
37
-        $this->description = "The user with id '$this->userid' created a bigbluebutton meeting for".
37
+        $this->description = "The user with id '$this->userid' created a bigbluebutton meeting for" .
38 38
             "the bigbluebuttonbn activity with id '$this->objectid' for the course id '$this->contextinstanceid'.";
39 39
     }
40 40
 
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_meeting_ended.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
      */
35 35
     protected function init() {
36 36
         parent::init();
37
-        $this->description = "A bigbluebutton meeting for the bigbluebuttonbn activity with id ".
38
-            "'$this->objectid' for the course id '$this->contextinstanceid' has been forcibly ".
37
+        $this->description = "A bigbluebutton meeting for the bigbluebuttonbn activity with id " .
38
+            "'$this->objectid' for the course id '$this->contextinstanceid' has been forcibly " .
39 39
             "ended by the user with id '$this->userid'.";
40 40
     }
41 41
 
Please login to merge, or discard this patch.