Completed
Pull Request — master (#56)
by Jesus
263:00 queued 186:12
created
settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once(dirname(__FILE__).'/locallib.php');
30
+require_once(dirname(__FILE__) . '/locallib.php');
31 31
 
32 32
 if ($ADMIN->fulltree) {
33 33
     // Configuration for BigBlueButton.
Please login to merge, or discard this patch.
backup/moodle2/backup_bigbluebuttonbn_activity_task.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 defined('MOODLE_INTERNAL') || die;
27 27
 
28
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php');
28
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php');
29 29
 
30 30
 /**
31 31
  * Backup task that provides all the settings and steps to perform one complete backup of the activity.
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
     public static function encode_content_links($content) {
63 63
         global $CFG;
64 64
 
65
-        $base = preg_quote($CFG->wwwroot.'/mod/bigbluebuttonbn', '#');
65
+        $base = preg_quote($CFG->wwwroot . '/mod/bigbluebuttonbn', '#');
66 66
 
67 67
         // Link to the list of bigbluebuttonbns.
68
-        $pattern = '#('.$base."\/index.php\?id\=)([0-9]+)#";
68
+        $pattern = '#(' . $base . "\/index.php\?id\=)([0-9]+)#";
69 69
         $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNINDEX*$2@$', $content);
70 70
 
71 71
         // Link to bigbluebuttonbn view by moduleid.
72
-        $pattern = '#('.$base."\/view.php\?id\=)([0-9]+)#";
72
+        $pattern = '#(' . $base . "\/view.php\?id\=)([0-9]+)#";
73 73
         $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNVIEWBYID*$2@$', $content);
74 74
 
75 75
         return $content;
Please login to merge, or discard this patch.
backup/moodle2/backup_bigbluebuttonbn_stepslib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         $logs = new backup_nested_element('logs');
49 49
 
50 50
         $log = new backup_nested_element('log', array('id'), array(
51
-                'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', ));
51
+                'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',));
52 52
 
53 53
         // Build the tree.
54 54
         $bigbluebuttonbn->add_child($logs);
Please login to merge, or discard this patch.
backup/moodle2/restore_bigbluebuttonbn_stepslib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     protected function process_bigbluebuttonbn($data) {
51 51
         global $DB;
52
-        $data = (object) $data;
52
+        $data = (object)$data;
53 53
         $data->course = $this->get_courseid();
54 54
         $data->timemodified = $this->apply_date_offset($data->timemodified);
55 55
         // Insert the bigbluebuttonbn record.
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     protected function process_bigbluebuttonbn_logs($data) {
67 67
         global $DB;
68
-        $data = (object) $data;
68
+        $data = (object)$data;
69 69
         // Apply modifications.
70 70
         $data->courseid = $this->get_mappingid('course', $data->courseid);
71 71
         $data->bigbluebuttonbnid = $this->get_new_parentid('bigbluebuttonbn');
Please login to merge, or discard this patch.
backup/moodle2/restore_bigbluebuttonbn_activity_task.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
 defined('MOODLE_INTERNAL') || die();
27 27
 
28
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php');
28
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php');
29 29
 
30 30
 /**
31 31
  * Restore task that provides all the settings and steps to perform one complete restore of the activity.
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   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -61,92 +61,92 @@
 block discarded – undo
61 61
 }
62 62
 
63 63
 switch (strtolower($action)) {
64
-    case 'logout':
65
-        if (isset($errors) && $errors != '') {
66
-            bigbluebutton_bbb_view_errors($errors, $id);
67
-            break;
68
-        }
69
-        if (is_null($bbbsession)) {
70
-            bigbluebutton_bbb_view_close_window_manually();
71
-            break;
72
-        }
73
-        // Moodle event logger: Create an event for meeting left.
74
-        bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_left'], $bigbluebuttonbn);
75
-        // Update the cache.
76
-        $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE);
77
-        // Close the tab or window where BBB was opened.
78
-        bigbluebutton_bbb_view_close_window();
79
-        break;
80
-    case 'join':
81
-        if (is_null($bbbsession)) {
82
-            print_error('view_error_unable_join', 'bigbluebuttonbn');
83
-            break;
84
-        }
85
-        // See if the session is in progress.
86
-        if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
87
-            // Since the meeting is already running, we just join the session.
88
-            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
89
-            break;
90
-        }
91
-        // If user is not administrator nor moderator (user is steudent) and waiting is required.
92
-        if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
93
-            header('Location: '.$bbbsession['logoutURL']);
64
+        case 'logout':
65
+            if (isset($errors) && $errors != '') {
66
+                bigbluebutton_bbb_view_errors($errors, $id);
67
+                break;
68
+            }
69
+            if (is_null($bbbsession)) {
70
+                bigbluebutton_bbb_view_close_window_manually();
71
+                break;
72
+            }
73
+            // Moodle event logger: Create an event for meeting left.
74
+            bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_left'], $bigbluebuttonbn);
75
+            // Update the cache.
76
+            $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE);
77
+            // Close the tab or window where BBB was opened.
78
+            bigbluebutton_bbb_view_close_window();
94 79
             break;
95
-        }
96
-        // As the meeting doesn't exist, try to create it.
97
-        $response = bigbluebuttonbn_get_create_meeting_array(
98
-            bigbluebutton_bbb_view_create_meeting_data($bbbsession),
99
-            bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
100
-            $bbbsession['presentation']['name'],
101
-            $bbbsession['presentation']['url']
102
-        );
103
-        if (empty($response)) {
104
-            // The server is unreachable.
105
-            if ($bbbsession['administrator']) {
106
-                print_error('view_error_unable_join', 'bigbluebuttonbn',
107
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
80
+        case 'join':
81
+            if (is_null($bbbsession)) {
82
+                print_error('view_error_unable_join', 'bigbluebuttonbn');
83
+                break;
84
+            }
85
+            // See if the session is in progress.
86
+            if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) {
87
+                // Since the meeting is already running, we just join the session.
88
+                bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
108 89
                 break;
109 90
             }
110
-            if ($bbbsession['moderator']) {
111
-                print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
91
+            // If user is not administrator nor moderator (user is steudent) and waiting is required.
92
+            if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
93
+                header('Location: '.$bbbsession['logoutURL']);
94
+                break;
95
+            }
96
+            // As the meeting doesn't exist, try to create it.
97
+            $response = bigbluebuttonbn_get_create_meeting_array(
98
+                bigbluebutton_bbb_view_create_meeting_data($bbbsession),
99
+                bigbluebutton_bbb_view_create_meeting_metadata($bbbsession),
100
+                $bbbsession['presentation']['name'],
101
+                $bbbsession['presentation']['url']
102
+            );
103
+            if (empty($response)) {
104
+                // The server is unreachable.
105
+                if ($bbbsession['administrator']) {
106
+                    print_error('view_error_unable_join', 'bigbluebuttonbn',
107
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
108
+                    break;
109
+                }
110
+                if ($bbbsession['moderator']) {
111
+                    print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
112
+                        $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
113
+                    break;
114
+                }
115
+                print_error('view_error_unable_join_student', 'bigbluebuttonbn',
112 116
                     $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
113 117
                 break;
114 118
             }
115
-            print_error('view_error_unable_join_student', 'bigbluebuttonbn',
116
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
117
-            break;
118
-        }
119
-        if ($response['returncode'] == 'FAILED') {
120
-            // The meeting was not created.
121
-            if (!$printerrorkey) {
122
-                print_error($response['message'], 'bigbluebuttonbn');
119
+            if ($response['returncode'] == 'FAILED') {
120
+                // The meeting was not created.
121
+                if (!$printerrorkey) {
122
+                    print_error($response['message'], 'bigbluebuttonbn');
123
+                    break;
124
+                }
125
+                $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
126
+                print_error($printerrorkey, 'bigbluebuttonbn');
127
+                break;
128
+            }
129
+            if ($response['hasBeenForciblyEnded'] == 'true') {
130
+                print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
123 131
                 break;
124 132
             }
125
-            $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create');
126
-            print_error($printerrorkey, 'bigbluebuttonbn');
133
+            // Moodle event logger: Create an event for meeting created.
134
+            bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn);
135
+            // Internal logger: Insert a record with the meeting created.
136
+            bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
137
+            // Since the meeting is already running, we just join the session.
138
+            bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
127 139
             break;
128
-        }
129
-        if ($response['hasBeenForciblyEnded'] == 'true') {
130
-            print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn'));
140
+        case 'play':
141
+            $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
142
+            // Moodle event logger: Create an event for meeting left.
143
+            bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn,
144
+                ['other' => $rid]);
145
+            // Execute the redirect.
146
+            header('Location: '.urldecode($href));
131 147
             break;
132
-        }
133
-        // Moodle event logger: Create an event for meeting created.
134
-        bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn);
135
-        // Internal logger: Insert a record with the meeting created.
136
-        bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE);
137
-        // Since the meeting is already running, we just join the session.
138
-        bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn);
139
-        break;
140
-    case 'play':
141
-        $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype);
142
-        // Moodle event logger: Create an event for meeting left.
143
-        bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn,
144
-            ['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);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         }
91 91
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
92 92
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
93
-            header('Location: '.$bbbsession['logoutURL']);
93
+            header('Location: ' . $bbbsession['logoutURL']);
94 94
             break;
95 95
         }
96 96
         // As the meeting doesn't exist, try to create it.
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
             // The server is unreachable.
105 105
             if ($bbbsession['administrator']) {
106 106
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
107
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
107
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
108 108
                 break;
109 109
             }
110 110
             if ($bbbsession['moderator']) {
111 111
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
112
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
112
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
113 113
                 break;
114 114
             }
115 115
             print_error('view_error_unable_join_student', '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 ($response['returncode'] == 'FAILED') {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn,
144 144
             ['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.
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.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -28,29 +28,29 @@  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->dirroot.'/tag/lib.php');
35
-require_once($CFG->libdir.'/accesslib.php');
36
-require_once($CFG->libdir.'/completionlib.php');
37
-require_once($CFG->libdir.'/datalib.php');
38
-require_once($CFG->libdir.'/coursecatlib.php');
39
-require_once($CFG->libdir.'/enrollib.php');
40
-require_once($CFG->libdir.'/filelib.php');
41
-require_once($CFG->libdir.'/formslib.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->dirroot . '/tag/lib.php');
35
+require_once($CFG->libdir . '/accesslib.php');
36
+require_once($CFG->libdir . '/completionlib.php');
37
+require_once($CFG->libdir . '/datalib.php');
38
+require_once($CFG->libdir . '/coursecatlib.php');
39
+require_once($CFG->libdir . '/enrollib.php');
40
+require_once($CFG->libdir . '/filelib.php');
41
+require_once($CFG->libdir . '/formslib.php');
42 42
 
43 43
 
44
-if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) {
45
-    require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php');
44
+if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) {
45
+    require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php');
46 46
 }
47 47
 
48 48
 if (!isset($CFG->bigbluebuttonbn)) {
49 49
     $CFG->bigbluebuttonbn = array();
50 50
 }
51 51
 
52
-if (file_exists(dirname(__FILE__).'/config.php')) {
53
-    require_once(dirname(__FILE__).'/config.php');
52
+if (file_exists(dirname(__FILE__) . '/config.php')) {
53
+    require_once(dirname(__FILE__) . '/config.php');
54 54
 }
55 55
 
56 56
 /*
@@ -97,18 +97,18 @@  discard block
 block discarded – undo
97 97
         return null;
98 98
     }
99 99
     $features = array(
100
-        (string) FEATURE_IDNUMBER => true,
101
-        (string) FEATURE_GROUPS => true,
102
-        (string) FEATURE_GROUPINGS => true,
103
-        (string) FEATURE_GROUPMEMBERSONLY => true,
104
-        (string) FEATURE_MOD_INTRO => true,
105
-        (string) FEATURE_BACKUP_MOODLE2 => true,
106
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
107
-        (string) FEATURE_GRADE_HAS_GRADE => false,
108
-        (string) FEATURE_GRADE_OUTCOMES => false,
109
-        (string) FEATURE_SHOW_DESCRIPTION => true,
100
+        (string)FEATURE_IDNUMBER => true,
101
+        (string)FEATURE_GROUPS => true,
102
+        (string)FEATURE_GROUPINGS => true,
103
+        (string)FEATURE_GROUPMEMBERSONLY => true,
104
+        (string)FEATURE_MOD_INTRO => true,
105
+        (string)FEATURE_BACKUP_MOODLE2 => true,
106
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
107
+        (string)FEATURE_GRADE_HAS_GRADE => false,
108
+        (string)FEATURE_GRADE_OUTCOMES => false,
109
+        (string)FEATURE_SHOW_DESCRIPTION => true,
110 110
     );
111
-    if (isset($features[(string) $feature])) {
111
+    if (isset($features[(string)$feature])) {
112 112
         return $features[$feature];
113 113
     }
114 114
     return null;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     $log->timecreated = time();
209 209
     $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE;
210 210
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
211
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
211
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
212 212
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
213 213
     $log->meta = "{\"has_recordings\":false}";
214 214
     if (!empty($logs)) {
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
238 238
     global $DB;
239 239
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
240
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*');
240
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*');
241 241
     if ($completed > 0) {
242
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
243
-            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
242
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
243
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
244 244
             get_string('view_message_times', 'bigbluebuttonbn');
245 245
     }
246 246
     return '';
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) {
261 261
     global $DB;
262 262
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
263
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ),
263
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',),
264 264
         '*', IGNORE_MULTIPLE);
265 265
     return $completed > 0;
266 266
 }
@@ -335,16 +335,16 @@  discard block
 block discarded – undo
335 335
     if ($bigbluebuttonbn->visible) {
336 336
         $classes = 'class="dimmed" ';
337 337
     }
338
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
339
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
340
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
341
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
342
-    $str .= '  </div>'."\n";
343
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
344
-        '</div>'."\n";
345
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
346
-      .'</div>'."\n";
347
-    $str .= '</div>'."\n";
338
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
339
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
340
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
341
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
342
+    $str .= '  </div>' . "\n";
343
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
344
+        '</div>' . "\n";
345
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
346
+      .'</div>' . "\n";
347
+    $str .= '</div>' . "\n";
348 348
     return $str;
349 349
 }
350 350
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
     if (count($files) == 1) {
545 545
         // Get the first (and only) file.
546 546
         $file = reset($files);
547
-        $filesrc = '/'.$file->get_filename();
547
+        $filesrc = '/' . $file->get_filename();
548 548
     }
549 549
     return $filesrc;
550 550
 }
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
     if (!$filename) {
613 613
         return false;
614 614
     }
615
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
615
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
616 616
     $fs = get_file_storage();
617 617
     $file = $fs->get_file_by_hash(sha1($fullpath));
618 618
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  * Remove this block when restored
62 62
  */
63 63
 
64
- /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */
64
+    /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */
65 65
 const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/';
66 66
 /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */
67 67
 const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6';
@@ -350,12 +350,12 @@  discard block
 block discarded – undo
350 350
     $str  = '<div class="bigbluebuttonbn overview">'."\n";
351 351
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
352 352
     $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
353
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
353
+        '">'.$bigbluebuttonbn->name.'</a>'."\n";
354 354
     $str .= '  </div>'."\n";
355 355
     $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
356 356
         '</div>'."\n";
357 357
     $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
358
-      .'</div>'."\n";
358
+        .'</div>'."\n";
359 359
     $str .= '</div>'."\n";
360 360
     return $str;
361 361
 }
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
             $bigbluebuttonbn->coursemodule,
541 541
             'bigbluebuttonbn',
542 542
             $bigbluebuttonbn->id, $bigbluebuttonbn->completionexpected
543
-          );
543
+            );
544 544
     }
545 545
 }
546 546
 /**
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
  * @return \core_calendar\local\event\entities\action_interface|null
749 749
  */
750 750
 function mod_bigbluebuttonbn_core_calendar_provide_event_action(calendar_event $event,
751
-                                                       \core_calendar\action_factory $factory) {
751
+                                                        \core_calendar\action_factory $factory) {
752 752
     $cm = get_fast_modinfo($event->courseid)->instances['bigbluebuttonbn'][$event->instance];
753 753
 
754 754
     $completion = new \completion_info($cm->get_course());
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
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.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
214 214
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6],
215 215
                 ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'),
216
-                 'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
217
-              );
216
+                    'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
217
+                );
218 218
         } else {
219 219
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
220 220
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
      */
253 253
     private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) {
254 254
         $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT,
255
-                  'description_key' => null];
255
+                    'description_key' => null];
256 256
         if ($cfg['recordings_html_editable']) {
257 257
             $field['type'] = 'checkbox';
258 258
             $field['description_key'] = 'mod_form_field_recordings_html';
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
261 261
             $field['description_key'], $cfg['recordings_html_default']);
262 262
         $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT,
263
-                  'description_key' => null];
263
+                    'description_key' => null];
264 264
         if ($cfg['recordings_deleted_editable']) {
265 265
             $field['type'] = 'checkbox';
266 266
             $field['description_key'] = 'mod_form_field_recordings_deleted';
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
269 269
             $field['description_key'], $cfg['recordings_deleted_default']);
270 270
         $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT,
271
-                  'description_key' => null];
271
+                    'description_key' => null];
272 272
         if ($cfg['importrecordings_enabled'] && $cfg['recordings_imported_editable']) {
273 273
             $field['type'] = 'checkbox';
274 274
             $field['description_key'] = 'mod_form_field_recordings_imported';
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
277 277
             $field['description_key'], $cfg['recordings_imported_default']);
278 278
         $field = ['type' => 'hidden', 'name' => 'recordings_preview', 'data_type' => PARAM_INT,
279
-                  'description_key' => null];
279
+                    'description_key' => null];
280 280
         if ($cfg['recordings_preview_editable']) {
281 281
             $field['type'] = 'checkbox';
282 282
             $field['description_key'] = 'mod_form_field_recordings_preview';
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
         $htmlselectiontype = html_writer::select($participantselection['type_options'],
348 348
             'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(),
349 349
             array('id' => 'bigbluebuttonbn_participant_selection_type',
350
-                  'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;'));
350
+                    'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;'));
351 351
         $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
352 352
             $participantselection['selected'], array(),
353 353
             array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled'));
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
             'type' => 'button', 'class' => 'btn btn-secondary',
356 356
             'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'),
357 357
             'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;'
358
-          ));
358
+            ));
359 359
         $htmladdparticipant = html_writer::tag('div',
360 360
             $htmlselectiontype . '&nbsp;&nbsp;' . $htmlselectionoptions . '&nbsp;&nbsp;' . $htmlselectioninput, null);
361 361
         $mform->addElement('html', "\n\n");
Please login to merge, or discard this patch.