Completed
Push — master ( 034c94...4546d7 )
by Jesus
02:08
created
classes/locallib/config.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -120,29 +120,29 @@
 block discarded – undo
120 120
      */
121 121
     public static function get_options() {
122 122
         return [
123
-               'version_major' => self::get_moodle_version_major(),
124
-               'voicebridge_editable' => self::get('voicebridge_editable'),
125
-               'waitformoderator_default' => self::get('waitformoderator_default'),
126
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
127
-               'userlimit_default' => self::get('userlimit_default'),
128
-               'userlimit_editable' => self::get('userlimit_editable'),
129
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
130
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
131
-               'recordings_enabled' => self::get('recordings_enabled'),
132
-               'recordings_html_default' => self::get('recordings_html_default'),
133
-               'recordings_html_editable' => self::get('recordings_html_editable'),
134
-               'recordings_deleted_default' => self::get('recordings_deleted_default'),
135
-               'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
136
-               'recordings_imported_default' => self::get('recordings_imported_default'),
137
-               'recordings_imported_editable' => self::get('recordings_imported_editable'),
138
-               'recording_default' => self::get('recording_default'),
139
-               'recording_editable' => self::get('recording_editable'),
140
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
141
-               'general_warning_message' => self::get('general_warning_message'),
142
-               'general_warning_box_type' => self::get('general_warning_box_type'),
143
-               'general_warning_button_text' => self::get('general_warning_button_text'),
144
-               'general_warning_button_href' => self::get('general_warning_button_href'),
145
-               'general_warning_button_class' => self::get('general_warning_button_class'),
146
-          ];
123
+                'version_major' => self::get_moodle_version_major(),
124
+                'voicebridge_editable' => self::get('voicebridge_editable'),
125
+                'waitformoderator_default' => self::get('waitformoderator_default'),
126
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
127
+                'userlimit_default' => self::get('userlimit_default'),
128
+                'userlimit_editable' => self::get('userlimit_editable'),
129
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
130
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
131
+                'recordings_enabled' => self::get('recordings_enabled'),
132
+                'recordings_html_default' => self::get('recordings_html_default'),
133
+                'recordings_html_editable' => self::get('recordings_html_editable'),
134
+                'recordings_deleted_default' => self::get('recordings_deleted_default'),
135
+                'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
136
+                'recordings_imported_default' => self::get('recordings_imported_default'),
137
+                'recordings_imported_editable' => self::get('recordings_imported_editable'),
138
+                'recording_default' => self::get('recording_default'),
139
+                'recording_editable' => self::get('recording_editable'),
140
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
141
+                'general_warning_message' => self::get('general_warning_message'),
142
+                'general_warning_box_type' => self::get('general_warning_box_type'),
143
+                'general_warning_button_text' => self::get('general_warning_button_text'),
144
+                'general_warning_button_href' => self::get('general_warning_button_href'),
145
+                'general_warning_button_class' => self::get('general_warning_button_class'),
146
+            ];
147 147
     }
148 148
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public static function defaultvalues() {
57 57
         return array(
58
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
59
-            'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
58
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
59
+            'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
60 60
             'voicebridge_editable' => 'false',
61 61
             'importrecordings_enabled' => 'false',
62 62
             'importrecordings_from_deleted_enabled' => 'false',
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
         if (isset($CFG->bigbluebuttonbn[$setting])) {
120 120
             return (string)$CFG->bigbluebuttonbn[$setting];
121 121
         }
122
-        if (isset($CFG->{'bigbluebuttonbn_'.$setting})) {
123
-            return (string)$CFG->{'bigbluebuttonbn_'.$setting};
122
+        if (isset($CFG->{'bigbluebuttonbn_' . $setting})) {
123
+            return (string)$CFG->{'bigbluebuttonbn_' . $setting};
124 124
         }
125 125
         return  self::defaultvalue($setting);
126 126
     }
Please login to merge, or discard this patch.
bbb_view.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
  */
199 199
 function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession) {
200 200
     $data = ['meetingID' => $bbbsession['meetingid'],
201
-              'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64),
202
-              'attendeePW' => $bbbsession['viewerPW'],
203
-              'moderatorPW' => $bbbsession['modPW'],
204
-              'logoutURL' => $bbbsession['logoutURL'],
201
+                'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64),
202
+                'attendeePW' => $bbbsession['viewerPW'],
203
+                'moderatorPW' => $bbbsession['modPW'],
204
+                'logoutURL' => $bbbsession['logoutURL'],
205 205
             ];
206 206
     $data['record'] = bigbluebutton_bbb_view_create_meeting_data_record($bbbsession['record']);
207 207
     $data['welcome'] = trim($bbbsession['welcome']);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
             '%duration%',
215 215
             (string) $durationtime,
216 216
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
217
-          );
217
+            );
218 218
     }
219 219
     $voicebridge = intval($bbbsession['voicebridge']);
220 220
     if ($voicebridge > 0 && $voicebridge < 79999) {
@@ -253,22 +253,22 @@  discard block
 block discarded – undo
253 253
 function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) {
254 254
     global $USER;
255 255
     $metadata = ['bbb-origin' => $bbbsession['origin'],
256
-                 'bbb-origin-version' => $bbbsession['originVersion'],
257
-                 'bbb-origin-server-name' => $bbbsession['originServerName'],
258
-                 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
259
-                 'bbb-origin-tag' => $bbbsession['originTag'],
260
-                 'bbb-context' => $bbbsession['course']->fullname,
261
-                 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64),
262
-                 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
263
-                 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
256
+                    'bbb-origin-version' => $bbbsession['originVersion'],
257
+                    'bbb-origin-server-name' => $bbbsession['originServerName'],
258
+                    'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'],
259
+                    'bbb-origin-tag' => $bbbsession['originTag'],
260
+                    'bbb-context' => $bbbsession['course']->fullname,
261
+                    'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64),
262
+                    'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64),
263
+                    'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
264 264
                 ];
265 265
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
266 266
         $metadata["bn-recording-status"] = json_encode(
267 267
             array(
268 268
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
269 269
                 'context' => $bbbsession['bigbluebuttonbnURL']
270
-              )
271
-          );
270
+                )
271
+            );
272 272
     }
273 273
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
274 274
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
Please login to merge, or discard this patch.
Switch Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -62,91 +62,91 @@
 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
-        }
70
-        if (is_null($bbbsession)) {
71
-            bigbluebutton_bbb_view_close_window_manually();
72
-            break;
73
-        }
74
-        // Moodle event logger: Create an event for meeting left.
75
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
76
-        // Update the cache.
77
-        $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE);
78
-        // Close the tab or window where BBB was opened.
79
-        bigbluebutton_bbb_view_close_window();
80
-        break;
81
-    case 'join':
82
-        if (is_null($bbbsession)) {
83
-            print_error('view_error_unable_join', 'bigbluebuttonbn');
84
-            break;
85
-        }
86
-        // See if the session is in progress.
87
-        if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
88
-            // Since the meeting is already running, we just join the session.
89
-            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
90
-            break;
91
-        }
92
-        // If user is not administrator nor moderator (user is steudent) and waiting is required.
93
-        if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
94
-            header('Location: '.$bbbsession['logoutURL']);
65
+        case 'logout':
66
+            if (isset($errors) && $errors != '') {
67
+                bigbluebutton_bbb_view_errors($errors, $id);
68
+                break;
69
+            }
70
+            if (is_null($bbbsession)) {
71
+                bigbluebutton_bbb_view_close_window_manually();
72
+                break;
73
+            }
74
+            // Moodle event logger: Create an event for meeting left.
75
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm);
76
+            // Update the cache.
77
+            $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE);
78
+            // Close the tab or window where BBB was opened.
79
+            bigbluebutton_bbb_view_close_window();
95 80
             break;
96
-        }
97
-        // As the meeting doesn't exist, try to create it.
98
-        $response = bigbluebuttonbn_get_create_meeting_array(
99
-            bigbluebutton_bbb_view_create_meeting_data($bbbsession),
100
-            bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
101
-            $bbbsession['presentation']['name'],
102
-            $bbbsession['presentation']['url']
103
-        );
104
-        if (empty($response)) {
105
-            // The server is unreachable.
106
-            if ($bbbsession['administrator']) {
107
-                print_error('view_error_unable_join', 'bigbluebuttonbn',
108
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
81
+        case 'join':
82
+            if (is_null($bbbsession)) {
83
+                print_error('view_error_unable_join', 'bigbluebuttonbn');
84
+                break;
85
+            }
86
+            // See if the session is in progress.
87
+            if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
88
+                // Since the meeting is already running, we just join the session.
89
+                bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
109 90
                 break;
110 91
             }
111
-            if ($bbbsession['moderator']) {
112
-                print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
92
+            // If user is not administrator nor moderator (user is steudent) and waiting is required.
93
+            if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
94
+                header('Location: '.$bbbsession['logoutURL']);
95
+                break;
96
+            }
97
+            // As the meeting doesn't exist, try to create it.
98
+            $response = bigbluebuttonbn_get_create_meeting_array(
99
+                bigbluebutton_bbb_view_create_meeting_data($bbbsession),
100
+                bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
101
+                $bbbsession['presentation']['name'],
102
+                $bbbsession['presentation']['url']
103
+            );
104
+            if (empty($response)) {
105
+                // The server is unreachable.
106
+                if ($bbbsession['administrator']) {
107
+                    print_error('view_error_unable_join', 'bigbluebuttonbn',
108
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
109
+                    break;
110
+                }
111
+                if ($bbbsession['moderator']) {
112
+                    print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
113
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
114
+                    break;
115
+                }
116
+                print_error('view_error_unable_join_student', 'bigbluebuttonbn',
113 117
                     $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
114 118
                 break;
115 119
             }
116
-            print_error('view_error_unable_join_student', 'bigbluebuttonbn',
117
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
118
-            break;
119
-        }
120
-        if ($response['returncode'] == 'FAILED') {
121
-            // The meeting was not created.
122
-            if (!$printerrorkey) {
123
-                print_error($response['message'], 'bigbluebuttonbn');
120
+            if ($response['returncode'] == 'FAILED') {
121
+                // The meeting was not created.
122
+                if (!$printerrorkey) {
123
+                    print_error($response['message'], 'bigbluebuttonbn');
124
+                    break;
125
+                }
126
+                $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
127
+                print_error($printerrorkey, 'bigbluebuttonbn');
128
+                break;
129
+            }
130
+            if ($response['hasBeenForciblyEnded'] == 'true') {
131
+                print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
124 132
                 break;
125 133
             }
126
-            $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
127
-            print_error($printerrorkey, 'bigbluebuttonbn');
134
+            // Moodle event logger: Create an event for meeting created.
135
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
136
+            // Internal logger: Insert a record with the meeting created.
137
+            bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
138
+            // Since the meeting is already running, we just join the session.
139
+            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
128 140
             break;
129
-        }
130
-        if ($response['hasBeenForciblyEnded'] == 'true') {
131
-            print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
141
+        case 'play':
142
+            $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
143
+            // Moodle event logger: Create an event for meeting left.
144
+            bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
145
+            // Execute the redirect.
146
+            header('Location: '.urldecode($href));
132 147
             break;
133
-        }
134
-        // Moodle event logger: Create an event for meeting created.
135
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm);
136
-        // Internal logger: Insert a record with the meeting created.
137
-        bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
138
-        // Since the meeting is already running, we just join the session.
139
-        bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
140
-        break;
141
-    case 'play':
142
-        $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
143
-        // Moodle event logger: Create an event for meeting left.
144
-        bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
145
-        // Execute the redirect.
146
-        header('Location: '.urldecode($href));
147
-        break;
148
-    default:
149
-        bigbluebutton_bbb_view_close_window();
148
+        default:
149
+            bigbluebutton_bbb_view_close_window();
150 150
 }
151 151
 
152 152
 /**
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
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
 $action = required_param('action', PARAM_TEXT);
30 30
 $id = optional_param('id', 0, PARAM_INT);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         }
92 92
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
93 93
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
94
-            header('Location: '.$bbbsession['logoutURL']);
94
+            header('Location: ' . $bbbsession['logoutURL']);
95 95
             break;
96 96
         }
97 97
         // As the meeting doesn't exist, try to create it.
@@ -105,16 +105,16 @@  discard block
 block discarded – undo
105 105
             // The server is unreachable.
106 106
             if ($bbbsession['administrator']) {
107 107
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
108
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
108
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
109 109
                 break;
110 110
             }
111 111
             if ($bbbsession['moderator']) {
112 112
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
113
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
113
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
114 114
                 break;
115 115
             }
116 116
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
117
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
117
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
118 118
             break;
119 119
         }
120 120
         if ($response['returncode'] == 'FAILED') {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         // Moodle event logger: Create an event for meeting left.
144 144
         bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]);
145 145
         // Execute the redirect.
146
-        header('Location: '.urldecode($href));
146
+        header('Location: ' . urldecode($href));
147 147
         break;
148 148
     default:
149 149
         bigbluebutton_bbb_view_close_window();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         $data['welcome'] .= '<br><br>';
229 229
         $data['welcome'] .= str_replace(
230 230
             '%duration%',
231
-            (string) $durationtime,
231
+            (string)$durationtime,
232 232
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
233 233
           );
234 234
     }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE);
317 317
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
318 318
         // No more users allowed to join.
319
-        header('Location: '.$bbbsession['logoutURL']);
319
+        header('Location: ' . $bbbsession['logoutURL']);
320 320
         return;
321 321
     }
322 322
     // Build the URL.
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
335 335
         ($bbbsession['administrator'] || $bbbsession['moderator']));
336 336
     // Execute the redirect.
337
-    header('Location: '.$joinurl);
337
+    header('Location: ' . $joinurl);
338 338
 }
339 339
 
340 340
 /**
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
  */
347 347
 function bigbluebutton_bbb_view_errors($serrors, $id) {
348 348
     global $CFG, $OUTPUT;
349
-    $errors = (array) json_decode(urldecode($serrors));
349
+    $errors = (array)json_decode(urldecode($serrors));
350 350
     $msgerrors = '';
351 351
     foreach ($errors as $error) {
352
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
352
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
353 353
     }
354 354
     echo $OUTPUT->header();
355 355
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
356
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
356
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
357 357
     echo $OUTPUT->footer();
358 358
 }
Please login to merge, or discard this patch.
bbb_broker.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -366,26 +366,26 @@  discard block
 block discarded – undo
366 366
             return array(
367 367
                 'status' => false,
368 368
                 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn')
369
-              );
369
+                );
370 370
         }
371 371
         if ($realrecordings[$params['id']]['published'] !== 'true') {
372 372
             return array(
373 373
                 'status' => false,
374 374
                 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn')
375
-              );
375
+                );
376 376
         }
377 377
         return array(
378 378
             'status' => bigbluebuttonbn_publish_recording_imported(
379 379
                 $recordings[$params['id']]['imported'], true
380 380
             )
381
-          );
381
+            );
382 382
     }
383 383
     // As the recordingid was not identified as imported recording link, execute actual publish.
384 384
     return array(
385 385
         'status' => bigbluebuttonbn_publish_recordings(
386 386
             $params['id'], 'true'
387 387
         )
388
-      );
388
+        );
389 389
 }
390 390
 
391 391
 /**
@@ -401,26 +401,26 @@  discard block
 block discarded – undo
401 401
             return array(
402 402
                 'status' => false,
403 403
                 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn')
404
-              );
404
+                );
405 405
         }
406 406
         if ($realrecordings[$params['id']]['protected'] === 'true') {
407 407
             return array(
408 408
                 'status' => false,
409 409
                 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn')
410
-              );
410
+                );
411 411
         }
412 412
         return array(
413 413
             'status' => bigbluebuttonbn_protect_recording_imported(
414 414
                 $recordings[$params['id']]['imported'], false
415 415
             )
416
-          );
416
+            );
417 417
     }
418 418
     // As the recordingid was not identified as imported recording link, execute actual uprotect.
419 419
     return array(
420 420
         'status' => bigbluebuttonbn_update_recordings(
421 421
             $params['id'], array('protect' => 'false')
422 422
         )
423
-      );
423
+        );
424 424
 }
425 425
 
426 426
 /**
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
             'status' => bigbluebuttonbn_publish_recording_imported(
435 435
                 $recordings[$params['id']]['imported'], false
436 436
             )
437
-          );
437
+            );
438 438
     }
439 439
     // As the recordingid was not identified as imported recording link, execute unpublish on a real recording.
440 440
     // First: Unpublish imported links associated to the recording.
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
         'status' => bigbluebuttonbn_publish_recordings(
453 453
             $params['id'], 'false'
454 454
         )
455
-      );
455
+        );
456 456
 }
457 457
 
458 458
 /**
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
             'status' => bigbluebuttonbn_protect_recording_imported(
467 467
                 $recordings[$params['id']]['imported'], true
468 468
             )
469
-          );
469
+            );
470 470
     }
471 471
     // As the recordingid was not identified as imported recording link, execute protect on a real recording.
472 472
     // First: Protect imported links associated to the recording.
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         'status' => bigbluebuttonbn_update_recordings(
485 485
             $params['id'], array('protect' => 'true')
486 486
         )
487
-      );
487
+        );
488 488
 }
489 489
 
490 490
 /**
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             'status' => bigbluebuttonbn_delete_recording_imported(
499 499
                 $recordings[$params['id']]['imported']
500 500
             )
501
-          );
501
+            );
502 502
     }
503 503
     // As the recordingid was not identified as imported recording link, execute delete on a real recording.
504 504
     // First: Delete imported links associated to the recording.
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
         'status' => bigbluebuttonbn_delete_recordings(
515 515
             $params['id']
516 516
         )
517
-      );
517
+        );
518 518
 }
519 519
 
520 520
 /**
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
             'status' => bigbluebuttonbn_update_recording_imported(
528 528
                 $recordings[$params['id']]['imported'], json_decode($params['meta'], true)
529 529
             )
530
-          );
530
+            );
531 531
     }
532 532
 
533 533
     // As the recordingid was not identified as imported recording link, execute update on a real recording.
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
         'status' => bigbluebuttonbn_update_recordings(
538 538
             $params['id'], json_decode($params['meta'])
539 539
         )
540
-      );
540
+        );
541 541
 }
542 542
 
543 543
 /**
@@ -682,10 +682,10 @@  discard block
 block discarded – undo
682 682
     $params['recording_import'] = ['id' => 'The recordingID must be specified.'];
683 683
     $params['recording_ready'] = [
684 684
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
685
-          ];
685
+            ];
686 686
     $params['live_session_events'] = [
687 687
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
688
-          ];
688
+            ];
689 689
     return $params;
690 690
 }
691 691
 
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
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
 use \Firebase\JWT\JWT;
30 30
 
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 $params['meta'] = optional_param('meta', '', PARAM_TEXT);
41 41
 
42 42
 if (empty($params['action'])) {
43
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
43
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
44 44
     return;
45 45
 }
46 46
 
47 47
 $error = bigbluebuttonbn_broker_validate_parameters($params);
48 48
 if (!empty($error)) {
49
-    header('HTTP/1.0 400 Bad Request. '.$error);
49
+    header('HTTP/1.0 400 Bad Request. ' . $error);
50 50
     return;
51 51
 }
52 52
 
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
         bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm);
131 131
         return;
132 132
     }
133
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
133
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
134 134
     return;
135 135
 
136 136
 } catch (Exception $e) {
137
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
137
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
138 138
     return;
139 139
 }
140 140
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
321 321
     $callbackresponse['status'] = true;
322 322
     $callbackresponse['found'] = true;
323
-    $callbackresponse['published'] = (string) $recording['published'];
323
+    $callbackresponse['published'] = (string)$recording['published'];
324 324
     if (!isset($params['meta']) || empty($params['meta'])) {
325 325
         return $callbackresponse;
326 326
     }
@@ -650,8 +650,8 @@  discard block
 block discarded – undo
650 650
         $decodedparameters = JWT::decode($params['signed_parameters'],
651 651
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
652 652
     } catch (Exception $e) {
653
-        $error = 'Caught exception: '.$e->getMessage();
654
-        header('HTTP/1.0 400 Bad Request. '.$error);
653
+        $error = 'Caught exception: ' . $e->getMessage();
654
+        header('HTTP/1.0 400 Bad Request. ' . $error);
655 655
         return;
656 656
     }
657 657
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -667,8 +667,8 @@  discard block
 block discarded – undo
667 667
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
668 668
         header('HTTP/1.0 202 Accepted');
669 669
     } catch (Exception $e) {
670
-        $error = 'Caught exception: '.$e->getMessage();
671
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
670
+        $error = 'Caught exception: ' . $e->getMessage();
671
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
672 672
     }
673 673
 }
674 674
 
@@ -689,13 +689,13 @@  discard block
 block discarded – undo
689 689
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
690 690
     if (!isset($importrecordings[$params['id']])) {
691 691
         $error = "Recording {$params['id']} could not be found. It can not be imported";
692
-        header('HTTP/1.0 404 Not found. '.$error);
692
+        header('HTTP/1.0 404 Not found. ' . $error);
693 693
         return;
694 694
     }
695 695
     $callbackresponse = array('status' => true);
696 696
     $importrecordings[$params['id']]['imported'] = true;
697 697
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
698
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
698
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
699 699
     bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
700 700
     // Moodle event logger: Create an event for recording imported.
701 701
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -721,8 +721,8 @@  discard block
 block discarded – undo
721 721
         $decodedparameters = JWT::decode($params['signed_parameters'],
722 722
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
723 723
     } catch (Exception $e) {
724
-        $error = 'Caught exception: '.$e->getMessage();
725
-        header('HTTP/1.0 400 Bad Request. '.$error);
724
+        $error = 'Caught exception: ' . $e->getMessage();
725
+        header('HTTP/1.0 400 Bad Request. ' . $error);
726 726
         return;
727 727
     }
728 728
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
     }
764 764
     $action = strtolower($params['action']);
765 765
     if (!array_key_exists($action, $requiredparams)) {
766
-        return 'Action '.$params['action'].' can not be performed.';
766
+        return 'Action ' . $params['action'] . ' can not be performed.';
767 767
     }
768 768
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
769 769
 }
Please login to merge, or discard this patch.
lib.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  * @uses FEATURE_GRADE_OUTCOMES
98 98
  * @uses FEATURE_SHOW_DESCRIPTION
99 99
  * @param string $feature
100
- * @return mixed True if yes (some features may use other values)
100
+ * @return null|boolean True if yes (some features may use other values)
101 101
  */
102 102
 function bigbluebuttonbn_supports($feature) {
103 103
     if (!$feature) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
  * @param object $mod
240 240
  * @param object $bigbluebuttonbn
241 241
  *
242
- * @return bool
242
+ * @return string
243 243
  */
244 244
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
245 245
     global $DB;
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
  * @param stdClass $context       context object
543 543
  * @param string   $filearea      file area
544 544
  *
545
- * @return false|null false if file not valid
545
+ * @return boolean false if file not valid
546 546
  */
547 547
 function bigbluebuttonbn_pluginfile_valid($context, $filearea) {
548 548
     if ($context->contextlevel != CONTEXT_MODULE) {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
  * Remove this block when restored
69 69
  */
70 70
 
71
- /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */
71
+    /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */
72 72
 const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/';
73 73
 /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */
74 74
 const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6';
@@ -345,12 +345,12 @@  discard block
 block discarded – undo
345 345
     $str  = '<div class="bigbluebuttonbn overview">'."\n";
346 346
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
347 347
     $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
348
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
348
+        '">'.$bigbluebuttonbn->name.'</a>'."\n";
349 349
     $str .= '  </div>'."\n";
350 350
     $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
351 351
         '</div>'."\n";
352 352
     $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
353
-      .'</div>'."\n";
353
+        .'</div>'."\n";
354 354
     $str .= '</div>'."\n";
355 355
     return $str;
356 356
 }
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -28,32 +28,32 @@  discard block
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once($CFG->dirroot.'/calendar/lib.php');
32
-require_once($CFG->dirroot.'/message/lib.php');
33
-require_once($CFG->dirroot.'/mod/lti/OAuth.php');
34
-require_once($CFG->libdir.'/accesslib.php');
35
-require_once($CFG->libdir.'/completionlib.php');
36
-require_once($CFG->libdir.'/datalib.php');
37
-require_once($CFG->libdir.'/coursecatlib.php');
38
-require_once($CFG->libdir.'/enrollib.php');
39
-require_once($CFG->libdir.'/filelib.php');
40
-require_once($CFG->libdir.'/formslib.php');
41
-
42
-if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) {
43
-    require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php');
31
+require_once($CFG->dirroot . '/calendar/lib.php');
32
+require_once($CFG->dirroot . '/message/lib.php');
33
+require_once($CFG->dirroot . '/mod/lti/OAuth.php');
34
+require_once($CFG->libdir . '/accesslib.php');
35
+require_once($CFG->libdir . '/completionlib.php');
36
+require_once($CFG->libdir . '/datalib.php');
37
+require_once($CFG->libdir . '/coursecatlib.php');
38
+require_once($CFG->libdir . '/enrollib.php');
39
+require_once($CFG->libdir . '/filelib.php');
40
+require_once($CFG->libdir . '/formslib.php');
41
+
42
+if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) {
43
+    require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php');
44 44
 }
45 45
 
46 46
 if (!isset($CFG->bigbluebuttonbn)) {
47 47
     $CFG->bigbluebuttonbn = array();
48 48
 }
49 49
 
50
-if (file_exists(dirname(__FILE__).'/config.php')) {
51
-    require_once(dirname(__FILE__).'/config.php');
50
+if (file_exists(dirname(__FILE__) . '/config.php')) {
51
+    require_once(dirname(__FILE__) . '/config.php');
52 52
     // Old BigBlueButtonBN cfg schema. For backward compatibility.
53 53
     global $BIGBLUEBUTTONBN_CFG;
54 54
 
55 55
     if (isset($BIGBLUEBUTTONBN_CFG)) {
56
-        foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) {
56
+        foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) {
57 57
             $cfgkey = str_replace("bigbluebuttonbn_", "", $key);
58 58
             $CFG->bigbluebuttonbn[$cfgkey] = $value;
59 59
         }
@@ -104,18 +104,18 @@  discard block
 block discarded – undo
104 104
         return null;
105 105
     }
106 106
     $features = array(
107
-        (string) FEATURE_IDNUMBER => true,
108
-        (string) FEATURE_GROUPS => true,
109
-        (string) FEATURE_GROUPINGS => true,
110
-        (string) FEATURE_GROUPMEMBERSONLY => true,
111
-        (string) FEATURE_MOD_INTRO => true,
112
-        (string) FEATURE_BACKUP_MOODLE2 => true,
113
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
114
-        (string) FEATURE_GRADE_HAS_GRADE => false,
115
-        (string) FEATURE_GRADE_OUTCOMES => false,
116
-        (string) FEATURE_SHOW_DESCRIPTION => true,
107
+        (string)FEATURE_IDNUMBER => true,
108
+        (string)FEATURE_GROUPS => true,
109
+        (string)FEATURE_GROUPINGS => true,
110
+        (string)FEATURE_GROUPMEMBERSONLY => true,
111
+        (string)FEATURE_MOD_INTRO => true,
112
+        (string)FEATURE_BACKUP_MOODLE2 => true,
113
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
114
+        (string)FEATURE_GRADE_HAS_GRADE => false,
115
+        (string)FEATURE_GRADE_OUTCOMES => false,
116
+        (string)FEATURE_SHOW_DESCRIPTION => true,
117 117
     );
118
-    if (isset($features[(string) $feature])) {
118
+    if (isset($features[(string)$feature])) {
119 119
         return $features[$feature];
120 120
     }
121 121
     return null;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     $log->timecreated = time();
216 216
     $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE;
217 217
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
218
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
218
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
219 219
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
220 220
     $log->meta = "{\"has_recordings\":false}";
221 221
     if (!empty($logs)) {
@@ -244,10 +244,10 @@  discard block
 block discarded – undo
244 244
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
245 245
     global $DB;
246 246
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
247
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*');
247
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*');
248 248
     if ($completed > 0) {
249
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
250
-            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
249
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
250
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
251 251
             get_string('view_message_times', 'bigbluebuttonbn');
252 252
     }
253 253
     return '';
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) {
268 268
     global $DB;
269 269
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
270
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ),
270
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',),
271 271
         '*', IGNORE_MULTIPLE);
272 272
     return $completed > 0;
273 273
 }
@@ -342,16 +342,16 @@  discard block
 block discarded – undo
342 342
     if ($bigbluebuttonbn->visible) {
343 343
         $classes = 'class="dimmed" ';
344 344
     }
345
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
346
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
347
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
348
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
349
-    $str .= '  </div>'."\n";
350
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
351
-        '</div>'."\n";
352
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
353
-      .'</div>'."\n";
354
-    $str .= '</div>'."\n";
345
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
346
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
347
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
348
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
349
+    $str .= '  </div>' . "\n";
350
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
351
+        '</div>' . "\n";
352
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
353
+      .'</div>' . "\n";
354
+    $str .= '</div>' . "\n";
355 355
     return $str;
356 356
 }
357 357
 
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
     if (count($files) == 1) {
506 506
         // Get the first (and only) file.
507 507
         $file = reset($files);
508
-        $filesrc = '/'.$file->get_filename();
508
+        $filesrc = '/' . $file->get_filename();
509 509
     }
510 510
     return $filesrc;
511 511
 }
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
     if (!$filename) {
574 574
         return false;
575 575
     }
576
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
576
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
577 577
     $fs = get_file_storage();
578 578
     $file = $fs->get_file_by_hash(sha1($fullpath));
579 579
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
import_view.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,8 @@
 block discarded – undo
77 77
     $body .= html_writer::start_tag('br');
78 78
     $body .= html_writer::tag('input', '',
79 79
         array('type' => 'button', 'class' => 'btn btn-secondary',
80
-              'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'),
81
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\''));
80
+                'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'),
81
+                'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\''));
82 82
     // JavaScript for locales.
83 83
     $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn');
84 84
     // Require JavaScript modules.
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
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
 $bn = required_param('bn', PARAM_INT);
30 30
 $tc = optional_param('tc', 0, PARAM_INT);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     $body .= html_writer::tag('input', '',
79 79
         array('type' => 'button', 'class' => 'btn btn-secondary',
80 80
               'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'),
81
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\''));
81
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $cm->id . '\''));
82 82
     // JavaScript for locales.
83 83
     $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn');
84 84
     // Require JavaScript modules.
Please login to merge, or discard this patch.
mod_form.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                 'alt' => $contents,
105 105
                 'title' => $contents,
106 106
                 'src' => $jsvars['pix_icon_delete']
107
-              );
107
+                );
108 108
             $jsvars['pix_icon_delete'] = html_writer::tag('img', '', $options);
109 109
         }
110 110
         $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-modform',
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
225 225
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6],
226 226
                 ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'),
227
-                 'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
228
-              );
227
+                    'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
228
+                );
229 229
         } else {
230 230
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
231 231
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]);
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      */
264 264
     private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) {
265 265
         $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT,
266
-                  'description_key' => null];
266
+                    'description_key' => null];
267 267
         if ($cfg['recordings_html_editable']) {
268 268
             $field['type'] = 'checkbox';
269 269
             $field['description_key'] = 'mod_form_field_recordings_html';
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
272 272
             $field['description_key'], $cfg['recordings_html_default']);
273 273
         $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT,
274
-                  'description_key' => null];
274
+                    'description_key' => null];
275 275
         if ($cfg['recordings_deleted_editable']) {
276 276
             $field['type'] = 'checkbox';
277 277
             $field['description_key'] = 'mod_form_field_recordings_deleted';
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
280 280
             $field['description_key'], $cfg['recordings_deleted_default']);
281 281
         $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT,
282
-                  'description_key' => null];
282
+                    'description_key' => null];
283 283
         if ($cfg['recordings_imported_editable']) {
284 284
             $field['type'] = 'checkbox';
285 285
             $field['description_key'] = 'mod_form_field_recordings_imported';
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         $htmlselectiontype = html_writer::select($participantselection['type_options'],
350 350
             'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(),
351 351
             array('id' => 'bigbluebuttonbn_participant_selection_type',
352
-                  'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;'));
352
+                    'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;'));
353 353
         $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
354 354
             $participantselection['selected'], array(),
355 355
             array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled'));
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
             'type' => 'button', 'class' => 'btn btn-secondary',
358 358
             'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'),
359 359
             'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;'
360
-          ));
360
+            ));
361 361
         $htmladdparticipant = html_writer::tag('div',
362 362
             $htmlselectiontype . '&nbsp;&nbsp;' . $htmlselectionoptions . '&nbsp;&nbsp;' . $htmlselectioninput, null);
363 363
         $mform->addElement('html', "\n\n");
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 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.
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                 );
128 128
                 $defaultvalues['presentation'] = $draftitemid;
129 129
             } catch (Exception $e) {
130
-                debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER);
130
+                debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER);
131 131
                 return;
132 132
             }
133 133
         }
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
             return;
424 424
         }
425 425
         $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options);
426
-        if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) {
426
+        if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) {
427 427
             $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn');
428 428
         }
429 429
         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
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public static function notification_process($context, $bigbluebuttonbn, $action) {
48 48
         global $USER;
49 49
         // Prepare message.
50
-        $msg = (object) array();
50
+        $msg = (object)array();
51 51
         // Build the message_body.
52 52
         $msg->action = $action;
53 53
         $msg->activity_type = '';
@@ -72,26 +72,26 @@  discard block
 block discarded – undo
72 72
      * @return string
73 73
      */
74 74
     public static function notification_msg_html($msg) {
75
-        $messagetext = '<p>'.$msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
76
-            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
77
-        $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.
78
-            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
79
-        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
80
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
81
-            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
82
-        $messagetext .= $msg->activity_title.'</td></tr>'."\n";
83
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
84
-            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
85
-        $messagetext .= $msg->activity_description.'</td></tr>'."\n";
86
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
87
-            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
88
-        $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";
89
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
90
-            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
91
-        $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";
92
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.
93
-            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
94
-        $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
75
+        $messagetext = '<p>' . $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
76
+            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
77
+        $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .
78
+            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
79
+        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
80
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
81
+            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
82
+        $messagetext .= $msg->activity_title . '</td></tr>' . "\n";
83
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
84
+            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
85
+        $messagetext .= $msg->activity_description . '</td></tr>' . "\n";
86
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
87
+            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
88
+        $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";
89
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
90
+            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
91
+        $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";
92
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .
93
+            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
94
+        $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
95 95
         return $messagetext;
96 96
     }
97 97
 
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
         global $DB;
109 109
         $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
110 110
         // Complete message.
111
-        $msg = (object) array();
111
+        $msg = (object)array();
112 112
         $msg->user_name = fullname($sender);
113 113
         $msg->user_email = $sender->email;
114 114
         $msg->course_name = "$course->fullname";
115
-        $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.
116
-            $msg->user_name.'('.$msg->user_email.') ';
117
-        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
118
-        $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
115
+        $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' .
116
+            $msg->user_name . '(' . $msg->user_email . ') ';
117
+        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
118
+        $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
119 119
         foreach ($users as $user) {
120 120
             if ($user->id != $sender->id) {
121 121
                 message_post_message($sender, $user, $message, FORMAT_HTML);
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
  * @author    Fred Dixon  (ffdixon [at] blindsidenetworks [dt] com)
25 25
  */
26 26
 
27
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
28
-require_once(dirname(__FILE__).'/locallib.php');
27
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
28
+require_once(dirname(__FILE__) . '/locallib.php');
29 29
 
30 30
 $id = required_param('id', PARAM_INT);
31 31
 $a = optional_param('a', 0, PARAM_INT);
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
     if ($moderator || $administrator) {
89 89
         bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_ENDED, $bigbluebuttonbn, $cm);
90 90
         echo get_string('index_ending', 'bigbluebuttonbn');
91
-        $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
91
+        $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
92 92
         if ($g != '0') {
93
-            $meetingid .= '['.$g.']';
93
+            $meetingid .= '[' . $g . ']';
94 94
         }
95 95
         bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingid));
96
-        redirect('index.php?id='.$id);
96
+        redirect('index.php?id=' . $id);
97 97
     }
98 98
 }
99 99
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         // Add a the data for the bigbluebuttonbn instance.
108 108
         $groupobj = null;
109 109
         if (groups_get_activity_groupmode($cm) > 0) {
110
-            $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants'));
110
+            $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants'));
111 111
         }
112 112
         $table->data[] = bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj);
113 113
         // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any.
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
  * @return array
134 134
  */
135 135
 function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
136
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
136
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
137 137
     $paramgroup = '';
138 138
     $groupname = '';
139 139
     if ($groupobj) {
140
-        $meetingid .= '['.$groupobj->id.']';
141
-        $paramgroup = '&group='.$groupobj->id;
140
+        $meetingid .= '[' . $groupobj->id . ']';
141
+        $paramgroup = '&group=' . $groupobj->id;
142 142
         $groupname = $groupobj->name;
143 143
     }
144 144
     $meetinginfo = bigbluebuttonbn_get_meeting_info_array($meetingid);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         return;
154 154
     }
155 155
     // Output Users in the meeting.
156
-    $joinurl = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramgroup.'">'.format_string($bigbluebuttonbn->name).'</a>';
156
+    $joinurl = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramgroup . '">' . format_string($bigbluebuttonbn->name) . '</a>';
157 157
     $group = $groupname;
158 158
     $users = '';
159 159
     $viewerlist = '';
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $attendeecount = 0;
199 199
         foreach ($meetinginfo['attendees']->attendee as $attendee) {
200 200
             if ($attendee->role == $role) {
201
-                $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName;
201
+                $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName;
202 202
             }
203 203
         }
204 204
     }
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
 function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
233 233
     $actions = '';
234 234
     if ($moderator) {
235
-        $actions .= '<form name="form1" method="post" action="">'.'/n';
236
-        $actions .= '  <INPUT type="hidden" name="id" value="'.$course->id.'">'.'/n';
237
-        $actions .= '  <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'.'/n';
235
+        $actions .= '<form name="form1" method="post" action="">' . '/n';
236
+        $actions .= '  <INPUT type="hidden" name="id" value="' . $course->id . '">' . '/n';
237
+        $actions .= '  <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . '/n';
238 238
         if ($groupobj != null) {
239
-            $actions .= '  <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'.'/n';
239
+            $actions .= '  <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . '/n';
240 240
         }
241
-        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\''.
242
-            get_string('index_confirm_end', 'bigbluebuttonbn').'\')">'.'/n';
243
-        $actions .= '</form>'.'/n';
241
+        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' .
242
+            get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . '/n';
243
+        $actions .= '</form>' . '/n';
244 244
     }
245 245
     return $actions;
246 246
 }
Please login to merge, or discard this patch.
classes/settings/renderer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 defined('MOODLE_INTERNAL') || die();
29 29
 
30 30
 require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
31
-require_once($CFG->libdir.'/adminlib.php');
31
+require_once($CFG->libdir . '/adminlib.php');
32 32
 
33 33
 /**
34 34
  * Helper class for rendering HTML for settings.php.
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $itemname = get_string('config_' . $name, 'bigbluebuttonbn');
67 67
         }
68 68
         if ($itemdescription === null) {
69
-            $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn');
69
+            $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn');
70 70
         }
71 71
         $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription);
72 72
         $this->settings->add($item);
Please login to merge, or discard this patch.