Completed
Pull Request — master (#155)
by Jesus
02:23 queued 19s
created
import_view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
 use mod_bigbluebuttonbn\output\import_view;
28 28
 use mod_bigbluebuttonbn\output\renderer;
29 29
 
30
-require(__DIR__.'/../../config.php');
31
-require_once(__DIR__.'/locallib.php');
30
+require(__DIR__ . '/../../config.php');
31
+require_once(__DIR__ . '/locallib.php');
32 32
 
33 33
 $bn = required_param('bn', PARAM_INT);
34 34
 $tc = optional_param('tc', 0, PARAM_INT);
Please login to merge, or discard this patch.
settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once(__DIR__.'/locallib.php');
31
+require_once(__DIR__ . '/locallib.php');
32 32
 
33 33
 if ($hassiteconfig) {
34 34
     // Configuration for BigBlueButton.
Please login to merge, or discard this patch.
view.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
 use mod_bigbluebuttonbn\plugin;
29 29
 
30
-require(__DIR__.'/../../config.php');
31
-require_once(__DIR__.'/locallib.php');
32
-require_once(__DIR__.'/viewlib.php');
30
+require(__DIR__ . '/../../config.php');
31
+require_once(__DIR__ . '/locallib.php');
32
+require_once(__DIR__ . '/viewlib.php');
33 33
 
34 34
 $id = required_param('id', PARAM_INT);
35 35
 $bn = optional_param('bn', 0, PARAM_INT);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 bigbluebuttonbn_view_bbbsession_set($PAGE->context, $bbbsession);
59 59
 
60 60
 // Validates if the BigBlueButton server is working.
61
-$serverversion = bigbluebuttonbn_get_server_version();  // In locallib.
61
+$serverversion = bigbluebuttonbn_get_server_version(); // In locallib.
62 62
 if ($serverversion === null) {
63 63
     $errmsg = 'view_error_unable_join_student';
64 64
     $errurl = '/course/view.php';
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     }
73 73
     print_error($errmsg, plugin::COMPONENT, new moodle_url($errurl, $errurlparams));
74 74
 }
75
-$bbbsession['serverversion'] = (string) $serverversion;
75
+$bbbsession['serverversion'] = (string)$serverversion;
76 76
 
77 77
 // Mark viewed by user (if required).
78 78
 $completion = new completion_info($course);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 echo $OUTPUT->footer();
117 117
 
118 118
 // Shows version as a comment.
119
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
119
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
120 120
 
121 121
 // Initialize session variable used across views.
122 122
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
123 123
\ No newline at end of file
Please login to merge, or discard this patch.
classes/output/import_view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
 defined('MOODLE_INTERNAL') || die();
38 38
 
39
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/locallib.php');
39
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
40 40
 
41 41
 /**
42 42
  * Class import_view
Please login to merge, or discard this patch.
classes/output/index.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 defined('MOODLE_INTERNAL') || die();
36 36
 
37
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/locallib.php');
37
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
38 38
 
39 39
 /**
40 40
  * Class index
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 // Add a the data for the bigbluebuttonbn instance.
93 93
                 $groupobj = null;
94 94
                 if (groups_get_activity_groupmode($cm) > 0) {
95
-                    $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants'));
95
+                    $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants'));
96 96
                 }
97 97
                 $table->data[] = self::bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj);
98 98
                 // Add a the data for the groups belonging to the bigbluebuttonbn instance, if any.
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             $attendeecount = 0;
183 183
             foreach ($meetinginfo['attendees']->attendee as $attendee) {
184 184
                 if ($attendee->role == $role) {
185
-                    $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName;
185
+                    $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName;
186 186
                 }
187 187
             }
188 188
         }
@@ -216,17 +216,17 @@  discard block
 block discarded – undo
216 216
     public static function bigbluebuttonbn_index_display_room_actions($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
217 217
         $actions = '';
218 218
         if ($moderator) {
219
-            $actions .= '<form name="form1" method="post" action="">'."\n";
220
-            $actions .= '  <INPUT type="hidden" name="id" value="'.$course->id.'">'."\n";
221
-            $actions .= '  <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'."\n";
219
+            $actions .= '<form name="form1" method="post" action="">' . "\n";
220
+            $actions .= '  <INPUT type="hidden" name="id" value="' . $course->id . '">' . "\n";
221
+            $actions .= '  <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . "\n";
222 222
             if ($groupobj != null) {
223
-                $actions .= '  <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'."\n";
223
+                $actions .= '  <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . "\n";
224 224
             }
225 225
             $actions .= '  <INPUT type="submit" name="submit" value="' .
226 226
                 get_string('view_conference_action_end', 'bigbluebuttonbn') .
227 227
                 '" class="btn btn-primary btn-sm" onclick="return confirm(\'' .
228 228
                 get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . "\n";
229
-            $actions .= '</form>'."\n";
229
+            $actions .= '</form>' . "\n";
230 230
         }
231 231
         return $actions;
232 232
     }
Please login to merge, or discard this patch.
viewlib.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
         $groupname = groups_get_group_name($bbbsession['group']);
55 55
     }
56 56
     // Assign group default values.
57
-    $bbbsession['meetingid'] .= '['.$bbbsession['group'].']';
58
-    $bbbsession['meetingname'] .= ' ('.$groupname.')';
57
+    $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']';
58
+    $bbbsession['meetingname'] .= ' (' . $groupname . ')';
59 59
     if (count($groups) == 0) {
60 60
         // Only the All participants group exists.
61 61
         bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_notenrolled_warning', 'bigbluebuttonbn'), 'info');
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     if (has_capability('moodle/site:accessallgroups', $context)) {
66 66
         bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'));
67 67
     }
68
-    $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id;
68
+    $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
69 69
     groups_print_activity_menu($bbbsession['cm'], $urltoroot);
70 70
     echo '<br><br>';
71 71
 }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $recordingsdisabled = get_string('view_message_recordings_disabled', 'bigbluebuttonbn');
138 138
         $output .= bigbluebuttonbn_render_warning($recordingsdisabled, 'danger');
139 139
     }
140
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
140
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
141 141
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
142 142
 }
143 143
 
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
     // JavaScript variables for room.
207 207
     $openingtime = '';
208 208
     if ($bbbsession['openingtime']) {
209
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
209
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
210 210
             userdate($bbbsession['openingtime']);
211 211
     }
212 212
     $closingtime = '';
213 213
     if ($bbbsession['closingtime']) {
214
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
214
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
215 215
             userdate($bbbsession['closingtime']);
216 216
     }
217 217
     $jsvars += array(
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     $output .= $OUTPUT->box_end();
229 229
     // Action button box.
230 230
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
231
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
231
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
232 232
     $output .= $OUTPUT->box_end();
233 233
     if ($activity == 'ended') {
234 234
         $output .= bigbluebuttonbn_view_ended($bbbsession);
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     // If there are meetings with recordings load the data to the table.
282 282
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
283 283
         // Render a plain html table.
284
-        return bigbluebuttonbn_output_recording_table($bbbsession, $recordings)."\n";
284
+        return bigbluebuttonbn_output_recording_table($bbbsession, $recordings) . "\n";
285 285
     }
286 286
     // JavaScript variables for recordings with YUI.
287 287
     $jsvars += array(
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
         array('type' => 'button',
319 319
             'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
320 320
             'class' => 'btn btn-secondary',
321
-            'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
322
-                $bbbsession['bigbluebuttonbn']->id.'\''));
321
+            'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
322
+                $bbbsession['bigbluebuttonbn']->id . '\''));
323 323
     $output  = html_writer::empty_tag('br');
324 324
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
325 325
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -338,10 +338,10 @@  discard block
 block discarded – undo
338 338
     if (!is_null($bbbsession['presentation']['url'])) {
339 339
         $attributes = array('title' => $bbbsession['presentation']['name']);
340 340
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
341
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
342
-            $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).
341
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
342
+            $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) .
343 343
             $OUTPUT->action_link($bbbsession['presentation']['url'],
344
-                $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
344
+                $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
345 345
     }
346 346
     return '';
347 347
 }
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
 use mod_bigbluebuttonbn\output\renderer;
29 29
 use mod_bigbluebuttonbn\output\index;
30 30
 
31
-require(__DIR__.'/../../config.php');
32
-require_once(__DIR__.'/locallib.php');
31
+require(__DIR__ . '/../../config.php');
32
+require_once(__DIR__ . '/locallib.php');
33 33
 
34 34
 $id = required_param('id', PARAM_INT);
35 35
 $a = optional_param('a', 0, PARAM_INT);
Please login to merge, or discard this patch.
locallib.php 3 patches
Doc Comments   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
  * Helper function to retrieve imported recordings from the Moodle database.
297 297
  * The references are stored as events in bigbluebuttonbn_logs.
298 298
  *
299
- * @param string $courseid
299
+ * @param integer $courseid
300 300
  * @param string $bigbluebuttonbnid
301 301
  * @param bool   $subset
302 302
  *
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 /**
325 325
  * Helper function to retrive the default config.xml file.
326 326
  *
327
- * @return string
327
+ * @return null|SimpleXMLElement
328 328
  */
329 329
 function bigbluebuttonbn_get_default_config_xml() {
330 330
     $xml = bigbluebuttonbn_wrap_xml_load_file(
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
  * @param object $a
407 407
  * @param object $b
408 408
  *
409
- * @return array
409
+ * @return integer
410 410
  */
411 411
 function bigbluebuttonbn_recording_build_sorter($a, $b) {
412 412
     global $CFG;
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
  * @param string $data
521 521
  * @param string $contenttype
522 522
  *
523
- * @return object
523
+ * @return null|SimpleXMLElement
524 524
  */
525 525
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
526 526
     if (extension_loaded('curl')) {
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
  * @param string $data
562 562
  * @param string $contenttype
563 563
  *
564
- * @return object
564
+ * @return string
565 565
  */
566 566
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
567 567
     $c = new curl();
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
  * @param integer $instance
935 935
  * @param integer $voicebridge
936 936
  *
937
- * @return string
937
+ * @return boolean
938 938
  */
939 939
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
940 940
     global $DB;
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
  * @param string $meetingid
1258 1258
  * @param string $configxml
1259 1259
  *
1260
- * @return object
1260
+ * @return null|SimpleXMLElement
1261 1261
  */
1262 1262
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1263 1263
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
  * @param array $recording
1307 1307
  * @param array $tools
1308 1308
  *
1309
- * @return array
1309
+ * @return null|stdClass
1310 1310
  */
1311 1311
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1312 1312
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
  *
1934 1934
  * @param array $bbbsession
1935 1935
  * @param array $recording
1936
- * @param object $rowdata
1936
+ * @param stdClass $rowdata
1937 1937
  *
1938 1938
  * @return object
1939 1939
  */
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
  *
2052 2052
  * @param array $bbbsession
2053 2053
  * @param array $recordings
2054
- * @param array $tools
2054
+ * @param string[] $tools
2055 2055
  *
2056 2056
  * @return array
2057 2057
  */
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2130 2130
  * in the getRecordings request considering only those that belong to deleted activities.
2131 2131
  *
2132
- * @param string $courseid
2132
+ * @param integer $courseid
2133 2133
  * @param string $bigbluebuttonbnid
2134 2134
  * @param bool   $subset
2135 2135
  *
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2154 2154
  * in the getRecordings request considering only those that belong to imported recordings.
2155 2155
  *
2156
- * @param string $courseid
2156
+ * @param integer $courseid
2157 2157
  * @param string $bigbluebuttonbnid
2158 2158
  * @param bool   $subset
2159 2159
  *
@@ -2176,7 +2176,7 @@  discard block
 block discarded – undo
2176 2176
 /**
2177 2177
  * Helper function to get recordings and imported recordings together.
2178 2178
  *
2179
- * @param string $courseid
2179
+ * @param integer $courseid
2180 2180
  * @param string $bigbluebuttonbnid
2181 2181
  * @param bool   $subset
2182 2182
  * @param bool   $includedeleted
@@ -2194,7 +2194,7 @@  discard block
 block discarded – undo
2194 2194
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2195 2195
  * in bigbluebuttonbn_logs.
2196 2196
  *
2197
- * @param string $courseid
2197
+ * @param integer $courseid
2198 2198
  * @param string $bigbluebuttonbnid
2199 2199
  * @param bool   $subset
2200 2200
  * @param bool   $includedeleted
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 global $CFG;
33 33
 
34
-require_once(__DIR__.'/lib.php');
34
+require_once(__DIR__ . '/lib.php');
35 35
 
36 36
 /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */
37 37
 const BIGBLUEBUTTONBN_UPDATE_CACHE = true;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
               'logoutURL' => $logouturl,
110 110
             ];
111 111
     // Choose between Adobe Flash or HTML5 Client.
112
-    if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) {
112
+    if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) {
113 113
         $data['joinViaHtml5'] = 'true';
114 114
     }
115 115
     if (!is_null($configtoken)) {
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
     $data = null;
138 138
     if (!is_null($pname) && !is_null($purl)) {
139 139
         $method = 'POST';
140
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
141
-            $purl."' /></module></modules>";
140
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
141
+            $purl . "' /></module></modules>";
142 142
     }
143 143
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
144 144
     if ($xml) {
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             if (isset($recordingxml->breakoutRooms->breakoutRoom)) {
261 261
                 foreach ($recordingxml->breakoutRooms->breakoutRoom as $breakoutroom) {
262 262
                     $url = \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getRecordings',
263
-                        ['recordID' => implode(',', (array) $breakoutroom)]);
263
+                        ['recordID' => implode(',', (array)$breakoutroom)]);
264 264
                     $xml = bigbluebuttonbn_wrap_xml_load_file($url);
265 265
                     if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
266 266
                         // If there were meetings already created.
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         // Override imported flag with actual ID.
316 316
         $recording['imported'] = $recordimported->id;
317 317
         if (isset($recordimported->protected)) {
318
-            $recording['protected'] = (string) $recordimported->protected;
318
+            $recording['protected'] = (string)$recordimported->protected;
319 319
         }
320 320
         $recordsimportedarray[$recording['recordID']] = $recording;
321 321
     }
@@ -345,21 +345,21 @@  discard block
 block discarded – undo
345 345
     // Add formats.
346 346
     $playbackarray = array();
347 347
     foreach ($recording->playback->format as $format) {
348
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
349
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
348
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
349
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
350 350
         // Add preview per format when existing.
351 351
         if ($format->preview) {
352
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
352
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
353 353
         }
354 354
     }
355 355
     // Add the metadata to the recordings array.
356 356
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
357
-    $recordingarray = array('recordID' => (string) $recording->recordID,
358
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
359
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
360
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
357
+    $recordingarray = array('recordID' => (string)$recording->recordID,
358
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
359
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
360
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
361 361
     if (isset($recording->protected)) {
362
-        $recordingarray['protected'] = (string) $recording->protected;
362
+        $recordingarray['protected'] = (string)$recording->protected;
363 363
     }
364 364
     return $recordingarray + $metadataarray;
365 365
 }
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
 function bigbluebuttonbn_get_recording_preview_images($preview) {
375 375
     $imagesarray = array();
376 376
     foreach ($preview->images->image as $image) {
377
-        $imagearray = array('url' => trim((string) $image));
377
+        $imagearray = array('url' => trim((string)$image));
378 378
         foreach ($image->attributes() as $attkey => $attvalue) {
379
-            $imagearray[$attkey] = (string) $attvalue;
379
+            $imagearray[$attkey] = (string)$attvalue;
380 380
         }
381 381
         array_push($imagesarray, $imagearray);
382 382
     }
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
         if (is_object($value)) {
397 397
             $value = '';
398 398
         }
399
-        $metadataarray['meta_'.$key] = $value;
399
+        $metadataarray['meta_' . $key] = $value;
400 400
     }
401 401
     return $metadataarray;
402 402
 }
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
     $ids = explode(',', $recordids);
472 472
     foreach ($ids as $id) {
473 473
         $xml = bigbluebuttonbn_wrap_xml_load_file(
474
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
474
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
475 475
           );
476 476
         if ($xml && $xml->returncode != 'SUCCESS') {
477 477
             return false;
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
             return $xml;
537 537
         } catch (Exception $e) {
538 538
             libxml_use_internal_errors($previous);
539
-            $error = 'Caught exception: '.$e->getMessage();
539
+            $error = 'Caught exception: ' . $e->getMessage();
540 540
             debugging($error, DEBUG_DEVELOPER);
541 541
             return null;
542 542
         }
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
548 548
         return $response;
549 549
     } catch (Exception $e) {
550
-        $error = 'Caught exception: '.$e->getMessage();
550
+        $error = 'Caught exception: ' . $e->getMessage();
551 551
         debugging($error, DEBUG_DEVELOPER);
552 552
         libxml_use_internal_errors($previous);
553 553
         return null;
@@ -573,8 +573,8 @@  discard block
 block discarded – undo
573 573
         }
574 574
         $options = array();
575 575
         $options['CURLOPT_HTTPHEADER'] = array(
576
-                 'Content-Type: '.$contenttype,
577
-                 'Content-Length: '.strlen($data),
576
+                 'Content-Type: ' . $contenttype,
577
+                 'Content-Length: ' . strlen($data),
578 578
                  'Content-Language: en-US',
579 579
                );
580 580
 
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
  * @return void
596 596
  */
597 597
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
598
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
598
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
599 599
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
600 600
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
601 601
     }
@@ -615,9 +615,9 @@  discard block
 block discarded – undo
615 615
     if ($userroles) {
616 616
         $where = '';
617 617
         foreach ($userroles as $userrole) {
618
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid;
618
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid;
619 619
         }
620
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
620
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
621 621
     }
622 622
     return $userroles;
623 623
 }
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
  * @return array $users
641 641
  */
642 642
 function bigbluebuttonbn_get_users(context $context = null) {
643
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
643
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
644 644
     foreach ($users as $key => $value) {
645 645
         $users[$key] = fullname($value);
646 646
     }
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
  * @return array $users
656 656
  */
657 657
 function bigbluebuttonbn_get_users_select(context $context = null) {
658
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
658
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
659 659
     foreach ($users as $key => $value) {
660 660
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
661 661
     }
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
  * @return array $roles
671 671
  */
672 672
 function bigbluebuttonbn_get_roles(context $context = null) {
673
-    $roles = (array) role_get_names($context);
673
+    $roles = (array)role_get_names($context);
674 674
     foreach ($roles as $key => $value) {
675 675
         $roles[$key] = $value->localname;
676 676
     }
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
  * @return array $users
686 686
  */
687 687
 function bigbluebuttonbn_get_roles_select(context $context = null) {
688
-    $roles = (array) role_get_names($context);
688
+    $roles = (array)role_get_names($context);
689 689
     foreach ($roles as $key => $value) {
690 690
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
691 691
     }
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
  * @return object $role
701 701
  */
702 702
 function bigbluebuttonbn_get_role($id) {
703
-    $roles = (array) role_get_names();
703
+    $roles = (array)role_get_names();
704 704
     if (is_numeric($id) && isset($roles[$id])) {
705 705
         return (object)$roles[$id];
706 706
     }
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
     if (!isguestuser()) {
858 858
         $userroles = bigbluebuttonbn_get_user_roles($context, $userid);
859 859
     }
860
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
860
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
861 861
 }
862 862
 
863 863
 /**
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 function bigbluebuttonbn_generate_nonce() {
1058 1058
     $mt = microtime();
1059 1059
     $rand = mt_rand();
1060
-    return md5($mt.$rand);
1060
+    return md5($mt . $rand);
1061 1061
 }
1062 1062
 
1063 1063
 /**
@@ -1147,10 +1147,10 @@  discard block
 block discarded – undo
1147 1147
     $now = time();
1148 1148
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1149 1149
         // Use the value in the cache.
1150
-        return (array) json_decode($result['meeting_info']);
1150
+        return (array)json_decode($result['meeting_info']);
1151 1151
     }
1152 1152
     // Ping again and refresh the cache.
1153
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1153
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1154 1154
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1155 1155
       );
1156 1156
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
  * @return object
1262 1262
  */
1263 1263
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1264
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1264
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1265 1265
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1266 1266
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST',
1267 1267
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1277,8 +1277,8 @@  discard block
 block discarded – undo
1277 1277
  * @return string
1278 1278
  */
1279 1279
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1280
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1281
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1280
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1281
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1282 1282
     return $configxmlparams;
1283 1283
 }
1284 1284
 
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
  */
1293 1293
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1294 1294
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1295
-    $configxmlarray = (array) $configxml;
1295
+    $configxmlarray = (array)$configxml;
1296 1296
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1297 1297
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1298 1298
         return '';
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
     global $USER;
1387 1387
     $starttime = $starttime - ($starttime % 1000);
1388 1388
     // Set formatted date.
1389
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1389
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1390 1390
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1391 1391
 }
1392 1392
 
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
  * @return string
1503 1503
  */
1504 1504
 function bigbluebuttonbn_get_recording_data_row_preview($recording) {
1505
-    $options = array('id' => 'preview-'.$recording['recordID']);
1505
+    $options = array('id' => 'preview-' . $recording['recordID']);
1506 1506
     if ($recording['published'] === 'false') {
1507 1507
         $options['hidden'] = 'hidden';
1508 1508
     }
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
     if ($recording['published'] === 'false') {
1565 1565
         $visibility = 'hidden ';
1566 1566
     }
1567
-    $id = 'playbacks-'.$recording['recordID'];
1567
+    $id = 'playbacks-' . $recording['recordID'];
1568 1568
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1569 1569
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1570 1570
           'title' => $title, $visibility => $visibility));
@@ -1589,11 +1589,11 @@  discard block
 block discarded – undo
1589 1589
     if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) {
1590 1590
         return '';
1591 1591
     }
1592
-    $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1592
+    $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1593 1593
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1594
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1594
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1595 1595
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1596
-        $href .= '&href='.urlencode(trim($playback['url']));
1596
+        $href .= '&href=' . urlencode(trim($playback['url']));
1597 1597
     }
1598 1598
     $linkattributes = array(
1599 1599
         'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'],
@@ -1777,7 +1777,7 @@  discard block
 block discarded – undo
1777 1777
             $linkattributes['class'] = 'disabled';
1778 1778
             unset($linkattributes['onclick']);
1779 1779
         }
1780
-        $icon = new pix_icon('i/'.$data['tag'],
1780
+        $icon = new pix_icon('i/' . $data['tag'],
1781 1781
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1782 1782
             'moodle', $iconattributes);
1783 1783
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
@@ -1940,7 +1940,7 @@  discard block
 block discarded – undo
1940 1940
  */
1941 1941
 function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) {
1942 1942
     $row = new html_table_row();
1943
-    $row->id = 'recording-tr-'.$recording['recordID'];
1943
+    $row->id = 'recording-tr-' . $recording['recordID'];
1944 1944
     $row->attributes['data-imported'] = 'false';
1945 1945
     $texthead = '';
1946 1946
     $texttail = '';
@@ -1953,7 +1953,7 @@  discard block
 block discarded – undo
1953 1953
     $rowdata->date_formatted = str_replace(' ', '&nbsp;', $rowdata->date_formatted);
1954 1954
     $row->cells = array();
1955 1955
     $row->cells[] = $texthead . $rowdata->recording . $texttail;
1956
-    $row->cells[] = $texthead . $rowdata->meeting . $texttail;;
1956
+    $row->cells[] = $texthead . $rowdata->meeting . $texttail; ;
1957 1957
     $row->cells[] = $texthead . $rowdata->activity . $texttail;
1958 1958
     $row->cells[] = $texthead . $rowdata->description . $texttail;
1959 1959
     if (bigbluebuttonbn_get_recording_data_preview_enabled($bbbsession)) {
@@ -2001,9 +2001,9 @@  discard block
 block discarded – undo
2001 2001
 function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) {
2002 2002
     $sender = get_admin();
2003 2003
     // Prepare message.
2004
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
2005
-        ' &quot;' . $bigbluebuttonbn->name . '&quot; '.
2006
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
2004
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') .
2005
+        ' &quot;' . $bigbluebuttonbn->name . '&quot; ' .
2006
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
2007 2007
     \mod_bigbluebuttonbn\locallib\notifier::notification_send($sender, $bigbluebuttonbn, $messagetext);
2008 2008
 }
2009 2009
 
@@ -2287,7 +2287,7 @@  discard block
 block discarded – undo
2287 2287
     }
2288 2288
     // Prepare select for loading records based on existent bigbluebuttonbns.
2289 2289
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
2290
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
2290
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
2291 2291
     // Include only Create events and exclude those with record not true.
2292 2292
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
2293 2293
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -2471,8 +2471,8 @@  discard block
 block discarded – undo
2471 2471
 function bigbluebuttonbn_format_activity_time($time) {
2472 2472
     $activitytime = '';
2473 2473
     if ($time) {
2474
-        $activitytime = calendar_day_representation($time).' '.
2475
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2474
+        $activitytime = calendar_day_representation($time) . ' ' .
2475
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2476 2476
           calendar_time_representation($time);
2477 2477
     }
2478 2478
     return $activitytime;
@@ -2931,7 +2931,7 @@  discard block
 block discarded – undo
2931 2931
  *
2932 2932
  * @return string
2933 2933
  */
2934
-function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') {
2934
+function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') {
2935 2935
     global $OUTPUT;
2936 2936
     $output = "\n";
2937 2937
     // Evaluates if config_warning is enabled.
@@ -2970,11 +2970,11 @@  discard block
 block discarded – undo
2970 2970
     if ($class == '') {
2971 2971
         $class = 'btn btn-secondary';
2972 2972
     }
2973
-    $output  = '  <form method="post" action="' . $href . '" class="form-inline">'."\n";
2974
-    $output .= '      <button type="submit" class="' . $class . '"'."\n";
2975
-    $output .= '          title="' . $title . '"'."\n";
2976
-    $output .= '          >' . $text . '</button>'."\n";
2977
-    $output .= '  </form>'."\n";
2973
+    $output  = '  <form method="post" action="' . $href . '" class="form-inline">' . "\n";
2974
+    $output .= '      <button type="submit" class="' . $class . '"' . "\n";
2975
+    $output .= '          title="' . $title . '"' . "\n";
2976
+    $output .= '          >' . $text . '</button>' . "\n";
2977
+    $output .= '  </form>' . "\n";
2978 2978
     return $output;
2979 2979
 }
2980 2980
 
@@ -3139,7 +3139,7 @@  discard block
 block discarded – undo
3139 3139
     $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass;
3140 3140
     $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass;
3141 3141
     // Database info related to the activity.
3142
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
3142
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
3143 3143
         $bbbsession['bigbluebuttonbn']->id;
3144 3144
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
3145 3145
     $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro;
@@ -3171,10 +3171,10 @@  discard block
 block discarded – undo
3171 3171
     if ($bbbsession['bigbluebuttonbn']->record) {
3172 3172
         // Check if is enable record all from start.
3173 3173
         if ($bbbsession['recordallfromstart']) {
3174
-            $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordallfromstartwarning',
3174
+            $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordallfromstartwarning',
3175 3175
                     'bigbluebuttonbn');
3176 3176
         } else {
3177
-            $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
3177
+            $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
3178 3178
         }
3179 3179
     }
3180 3180
     $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime;
@@ -3189,7 +3189,7 @@  discard block
 block discarded – undo
3189 3189
     $bbbsession['originServerName'] = $parsedurl['host'];
3190 3190
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
3191 3191
     $bbbsession['originServerCommonName'] = '';
3192
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
3192
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
3193 3193
     $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server();
3194 3194
     // Setting for clienttype, assign flash if not enabled, or default if not editable.
3195 3195
     $bbbsession['clienttype'] = BIGBLUEBUTTON_CLIENTTYPE_FLASH;
@@ -3251,7 +3251,7 @@  discard block
 block discarded – undo
3251 3251
     );
3252 3252
 
3253 3253
     // Check status and set extra values.
3254
-    $activitystatus = bigbluebuttonbn_view_get_activity_status($bbbsession);  // In locallib.
3254
+    $activitystatus = bigbluebuttonbn_view_get_activity_status($bbbsession); // In locallib.
3255 3255
     if ($activitystatus == 'ended') {
3256 3256
         $bbbsession['presentation'] = bigbluebuttonbn_get_presentation_array(
3257 3257
             $bbbsession['context'], $bbbsession['bigbluebuttonbn']->presentation);
Please login to merge, or discard this patch.
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null,
105 105
         $userid = null, $clienttype = BIGBLUEBUTTON_CLIENTTYPE_FLASH) {
106 106
     $data = ['meetingID' => $meetingid,
107
-              'fullName' => $username,
108
-              'password' => $pw,
109
-              'logoutURL' => $logouturl,
107
+                'fullName' => $username,
108
+                'password' => $pw,
109
+                'logoutURL' => $logouturl,
110 110
             ];
111 111
     // Choose between Adobe Flash or HTML5 Client.
112 112
     if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) {
@@ -162,23 +162,23 @@  discard block
 block discarded – undo
162 162
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
163 163
     $xml = bigbluebuttonbn_wrap_xml_load_file(
164 164
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
165
-      );
165
+        );
166 166
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
167 167
         // Meeting info was returned.
168 168
         return array('returncode' => $xml->returncode,
169
-                     'meetingID' => $xml->meetingID,
170
-                     'moderatorPW' => $xml->moderatorPW,
171
-                     'attendeePW' => $xml->attendeePW,
172
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
173
-                     'running' => $xml->running,
174
-                     'recording' => $xml->recording,
175
-                     'startTime' => $xml->startTime,
176
-                     'endTime' => $xml->endTime,
177
-                     'participantCount' => $xml->participantCount,
178
-                     'moderatorCount' => $xml->moderatorCount,
179
-                     'attendees' => $xml->attendees,
180
-                     'metadata' => $xml->metadata,
181
-                   );
169
+                        'meetingID' => $xml->meetingID,
170
+                        'moderatorPW' => $xml->moderatorPW,
171
+                        'attendeePW' => $xml->attendeePW,
172
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
173
+                        'running' => $xml->running,
174
+                        'recording' => $xml->recording,
175
+                        'startTime' => $xml->startTime,
176
+                        'endTime' => $xml->endTime,
177
+                        'participantCount' => $xml->participantCount,
178
+                        'moderatorCount' => $xml->moderatorCount,
179
+                        'attendees' => $xml->attendees,
180
+                        'metadata' => $xml->metadata,
181
+                    );
182 182
     }
183 183
     if ($xml) {
184 184
         // Either failure or success without meeting info.
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 function bigbluebuttonbn_get_default_config_xml() {
331 331
     $xml = bigbluebuttonbn_wrap_xml_load_file(
332 332
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
333
-      );
333
+        );
334 334
     return $xml;
335 335
 }
336 336
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
     foreach ($ids as $id) {
435 435
         $xml = bigbluebuttonbn_wrap_xml_load_file(
436 436
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
437
-          );
437
+            );
438 438
         if ($xml && $xml->returncode != 'SUCCESS') {
439 439
             return false;
440 440
         }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
     foreach ($ids as $id) {
454 454
         $xml = bigbluebuttonbn_wrap_xml_load_file(
455 455
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
456
-          );
456
+            );
457 457
         if ($xml && $xml->returncode != 'SUCCESS') {
458 458
             return false;
459 459
         }
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
     foreach ($ids as $id) {
473 473
         $xml = bigbluebuttonbn_wrap_xml_load_file(
474 474
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
475
-          );
475
+            );
476 476
         if ($xml && $xml->returncode != 'SUCCESS') {
477 477
             return false;
478 478
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
490 490
     $xml = bigbluebuttonbn_wrap_xml_load_file(
491 491
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
492
-      );
492
+        );
493 493
     if ($xml) {
494 494
         // If the xml packet returned failure it displays the message to the user.
495 495
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 function bigbluebuttonbn_get_server_version() {
507 507
     $xml = bigbluebuttonbn_wrap_xml_load_file(
508 508
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
509
-      );
509
+        );
510 510
     if ($xml && $xml->returncode == 'SUCCESS') {
511 511
         return $xml->version;
512 512
     }
@@ -573,10 +573,10 @@  discard block
 block discarded – undo
573 573
         }
574 574
         $options = array();
575 575
         $options['CURLOPT_HTTPHEADER'] = array(
576
-                 'Content-Type: '.$contenttype,
577
-                 'Content-Length: '.strlen($data),
578
-                 'Content-Language: en-US',
579
-               );
576
+                    'Content-Type: '.$contenttype,
577
+                    'Content-Length: '.strlen($data),
578
+                    'Content-Language: en-US',
579
+                );
580 580
 
581 581
         return $c->post($url, $data, $options);
582 582
     }
@@ -723,16 +723,16 @@  discard block
 block discarded – undo
723 723
         'all' => array(
724 724
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
725 725
             'children' => []
726
-          )
727
-      );
726
+            )
727
+        );
728 728
     $data['role'] = array(
729 729
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
730 730
         'children' => bigbluebuttonbn_get_roles_select($context)
731
-      );
731
+        );
732 732
     $data['user'] = array(
733 733
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
734 734
         'children' => bigbluebuttonbn_get_users_select($context)
735
-      );
735
+        );
736 736
     return $data;
737 737
 }
738 738
 
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
         'selectiontype' => 'all',
776 776
         'selectionid' => 'all',
777 777
         'role' => BIGBLUEBUTTONBN_ROLE_VIEWER
778
-      );
778
+        );
779 779
     $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default'));
780 780
     foreach ($defaultrules as $defaultrule) {
781 781
         if ($defaultrule == '0') {
@@ -788,9 +788,9 @@  discard block
 block discarded – undo
788 788
             continue;
789 789
         }
790 790
         $participantlist[] = array(
791
-              'selectiontype' => 'role',
792
-              'selectionid' => $defaultrule,
793
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
791
+                'selectiontype' => 'role',
792
+                'selectionid' => $defaultrule,
793
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
794 794
     }
795 795
     return $participantlist;
796 796
 }
@@ -829,11 +829,11 @@  discard block
 block discarded – undo
829 829
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
830 830
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
831 831
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
832
-          ],
832
+            ],
833 833
         'type_selected' => 'all',
834 834
         'options' => ['all' => '---------------'],
835 835
         'selected' => 'all',
836
-      ];
836
+        ];
837 837
 }
838 838
 
839 839
 /**
@@ -1152,7 +1152,7 @@  discard block
 block discarded – undo
1152 1152
     // Ping again and refresh the cache.
1153 1153
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1154 1154
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1155
-      );
1155
+        );
1156 1156
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1157 1157
     return $meetinginfo;
1158 1158
 }
@@ -1566,8 +1566,8 @@  discard block
 block discarded – undo
1566 1566
     }
1567 1567
     $id = 'playbacks-'.$recording['recordID'];
1568 1568
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1569
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1570
-          'title' => $title, $visibility => $visibility));
1569
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1570
+            'title' => $title, $visibility => $visibility));
1571 1571
     foreach ($recording['playbacks'] as $playback) {
1572 1572
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback);
1573 1573
     }
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
     }
1592 1592
     $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1593 1593
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1594
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1594
+        '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1595 1595
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1596 1596
         $href .= '&href='.urlencode(trim($playback['url']));
1597 1597
     }
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
         'data-action' => 'play',
1603 1603
         'data-target' => $playback['type'],
1604 1604
         'data-href' => $href,
1605
-      );
1605
+        );
1606 1606
     if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) {
1607 1607
         $linkattributes['class'] = 'btn btn-sm btn-warning';
1608 1608
         $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn');
@@ -1767,10 +1767,10 @@  discard block
 block discarded – undo
1767 1767
             'id' => $id,
1768 1768
             'onclick' => $onclick,
1769 1769
             'data-action' => $data['action']
1770
-          );
1770
+            );
1771 1771
         if (!isset($recording['imported'])) {
1772 1772
             $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(
1773
-              $recording['recordID']);
1773
+                $recording['recordID']);
1774 1774
         }
1775 1775
         if (isset($data['disabled'])) {
1776 1776
             $iconattributes['class'] .= ' fa-' . $data['disabled'];
@@ -2377,17 +2377,17 @@  discard block
 block discarded – undo
2377 2377
 function bigbluebuttonbn_get_instance_type_profiles() {
2378 2378
     $instanceprofiles = array(
2379 2379
         BIGBLUEBUTTONBN_TYPE_ALL => array('id' => BIGBLUEBUTTONBN_TYPE_ALL,
2380
-                  'name' => get_string('instance_type_default', 'bigbluebuttonbn'),
2381
-                  'features' => array('all')),
2380
+                    'name' => get_string('instance_type_default', 'bigbluebuttonbn'),
2381
+                    'features' => array('all')),
2382 2382
         BIGBLUEBUTTONBN_TYPE_ROOM_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_ROOM_ONLY,
2383
-                  'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'),
2384
-                  'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit',
2385
-                      'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups',
2386
-                      'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection',
2387
-                      'clienttype', 'completionattendance')),
2383
+                    'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'),
2384
+                    'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit',
2385
+                        'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups',
2386
+                        'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection',
2387
+                        'clienttype', 'completionattendance')),
2388 2388
         BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY,
2389
-                  'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'),
2390
-                  'features' => array('showrecordings', 'importrecordings'))
2389
+                    'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'),
2390
+                    'features' => array('showrecordings', 'importrecordings'))
2391 2391
     );
2392 2392
     return $instanceprofiles;
2393 2393
 }
@@ -2474,8 +2474,8 @@  discard block
 block discarded – undo
2474 2474
     $activitytime = '';
2475 2475
     if ($time) {
2476 2476
         $activitytime = calendar_day_representation($time).' '.
2477
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2478
-          calendar_time_representation($time);
2477
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2478
+            calendar_time_representation($time);
2479 2479
     }
2480 2480
     return $activitytime;
2481 2481
 }
@@ -2794,7 +2794,7 @@  discard block
 block discarded – undo
2794 2794
         $renderer->render_group_element('participant_moderator_default',
2795 2795
             $renderer->render_group_element_configmultiselect('participant_moderator_default',
2796 2796
                 array_keys($owner), array_merge($owner, $roles))
2797
-          );
2797
+            );
2798 2798
     }
2799 2799
 }
2800 2800
 
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
         // Web Client default.
2831 2831
         $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
2832 2832
         $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
2833
-                         BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2833
+                            BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2834 2834
         $renderer->render_group_element('clienttype_default',
2835 2835
             $renderer->render_group_element_configselect('clienttype_default',
2836 2836
                 $default, $choices));
@@ -2941,7 +2941,7 @@  discard block
 block discarded – undo
2941 2941
         return $output;
2942 2942
     }
2943 2943
     $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in',
2944
-      'bigbluebuttonbn_view_general_warning') . "\n";
2944
+        'bigbluebuttonbn_view_general_warning') . "\n";
2945 2945
     $output .= '    ' . $message . "\n";
2946 2946
     $output .= '  <div class="singlebutton pull-right">' . "\n";
2947 2947
     if (!empty($href)) {
@@ -3294,8 +3294,8 @@  discard block
 block discarded – undo
3294 3294
             array(
3295 3295
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
3296 3296
                 'context' => $bbbsession['bigbluebuttonbnURL']
3297
-              )
3298
-          );
3297
+                )
3298
+            );
3299 3299
     }
3300 3300
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3301 3301
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
Please login to merge, or discard this patch.
bbb_ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
24 24
  */
25 25
 
26
-require(__DIR__.'/../../config.php');
27
-require_once(__DIR__.'/locallib.php');
28
-require_once(__DIR__.'/brokerlib.php');
26
+require(__DIR__ . '/../../config.php');
27
+require_once(__DIR__ . '/locallib.php');
28
+require_once(__DIR__ . '/brokerlib.php');
29 29
 
30 30
 global $PAGE, $USER, $CFG, $SESSION, $DB;
31 31
 
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 require_login(null, true);
42 42
 
43 43
 if (empty($params['action'])) {
44
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
44
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
45 45
     return;
46 46
 }
47 47
 
48 48
 $error = bigbluebuttonbn_broker_validate_parameters($params);
49 49
 if (!empty($error)) {
50
-    header('HTTP/1.0 400 Bad Request. '.$error);
50
+    header('HTTP/1.0 400 Bad Request. ' . $error);
51 51
     return;
52 52
 }
53 53
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         echo bigbluebuttonbn_broker_recording_import($bbbsession, $params);
122 122
         return;
123 123
     }
124
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
124
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
125 125
 } catch (Exception $e) {
126
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
126
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
127 127
 }
Please login to merge, or discard this patch.