@@ -26,8 +26,8 @@ discard block |
||
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 |
||
48 | 48 | $serverversion = bigbluebuttonbn_get_server_version(); |
49 | 49 | if (is_null($serverversion)) { |
50 | 50 | print_error('general_error_unable_connect', 'bigbluebuttonbn', |
51 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
51 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | // Context. |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | // If none is allowed, fail and return. |
79 | 79 | if (empty($jsvars['instanceTypeProfiles'])) { |
80 | 80 | print_error('general_error_not_allowed_to_create_instances)', 'bigbluebuttonbn', |
81 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
81 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
82 | 82 | return; |
83 | 83 | } |
84 | 84 | $this->bigbluebuttonbn_mform_add_block_profiles($mform, $jsvars['instanceTypeProfiles']); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | ); |
127 | 127 | $defaultvalues['presentation'] = $draftitemid; |
128 | 128 | } catch (Exception $e) { |
129 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
129 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
130 | 130 | return; |
131 | 131 | } |
132 | 132 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | return; |
460 | 460 | } |
461 | 461 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
462 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
462 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
463 | 463 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
464 | 464 | } |
465 | 465 | if (!empty($rule)) { |
@@ -110,7 +110,7 @@ |
||
110 | 110 | * Displays the general view. |
111 | 111 | * |
112 | 112 | * @param boolean $moderator |
113 | - * @param object $course |
|
113 | + * @param stdClass $course |
|
114 | 114 | * @param object $bigbluebuttonbn |
115 | 115 | * @param object $groupobj |
116 | 116 | * @return array |
@@ -34,7 +34,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -28,7 +28,6 @@ |
||
28 | 28 | defined('MOODLE_INTERNAL') || die(); |
29 | 29 | |
30 | 30 | use context_module; |
31 | -use mod_bigbluebuttonbn_external; |
|
32 | 31 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
33 | 32 | require_once($CFG->dirroot . '/lib/grouplib.php'); |
34 | 33 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | global $OUTPUT, $SESSION, $CFG; |
57 | 57 | |
58 | - $args = (object) $args; |
|
58 | + $args = (object)$args; |
|
59 | 59 | $viewinstance = bigbluebuttonbn_view_validator($args->cmid, null); |
60 | 60 | if (!$viewinstance) { |
61 | 61 | $error = get_string('view_error_url_missing_parameters', 'bigbluebuttonbn'); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $bigbluebuttonbn = $viewinstance['bigbluebuttonbn']; |
68 | 68 | $context = context_module::instance($cm->id); |
69 | 69 | |
70 | - require_login($course->id, false , $cm, true, true); |
|
70 | + require_login($course->id, false, $cm, true, true); |
|
71 | 71 | require_capability('mod/bigbluebuttonbn:join', $context); |
72 | 72 | |
73 | 73 | // Add view event. |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | // Check if the BBB server is working. |
114 | 114 | $serverversion = bigbluebuttonbn_get_server_version(); |
115 | - $bbbsession['serverversion'] = (string) $serverversion; |
|
115 | + $bbbsession['serverversion'] = (string)$serverversion; |
|
116 | 116 | if (is_null($serverversion)) { |
117 | 117 | |
118 | 118 | if ($bbbsession['administrator']) { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | // Operation URLs. |
141 | 141 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
142 | - $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$args->cmid . |
|
142 | + $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $args->cmid . |
|
143 | 143 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
144 | 144 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
145 | 145 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | } |
183 | 183 | if ($response['returncode'] == 'FAILED') { |
184 | 184 | // The meeting could not be created. |
185 | - $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
185 | + $errorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
186 | 186 | $e = get_string($errorkey, 'bigbluebuttonbn'); |
187 | 187 | return(self::mobile_print_error($e)); |
188 | 188 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
196 | 196 | // Insert a record that meeting was created. |
197 | 197 | $overrides = array('meetingid' => $bbbsession['meetingid']); |
198 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
198 | + $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
199 | 199 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
200 | 200 | } |
201 | 201 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | $data = array( |
223 | 223 | 'bigbluebuttonbn' => $bigbluebuttonbn, |
224 | - 'bbbsession' => (object) $bbbsession, |
|
224 | + 'bbbsession' => (object)$bbbsession, |
|
225 | 225 | 'msjgroup' => $msjgroup, |
226 | 226 | 'urltojoin' => $urltojoin, |
227 | 227 | 'cmid' => $cm->id, |
@@ -296,7 +296,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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)) { |
@@ -1932,7 +1932,7 @@ discard block |
||
1932 | 1932 | * |
1933 | 1933 | * @param array $bbbsession |
1934 | 1934 | * @param array $recording |
1935 | - * @param object $rowdata |
|
1935 | + * @param stdClass $rowdata |
|
1936 | 1936 | * |
1937 | 1937 | * @return object |
1938 | 1938 | */ |
@@ -2050,7 +2050,7 @@ discard block |
||
2050 | 2050 | * |
2051 | 2051 | * @param array $bbbsession |
2052 | 2052 | * @param array $recordings |
2053 | - * @param array $tools |
|
2053 | + * @param string[] $tools |
|
2054 | 2054 | * |
2055 | 2055 | * @return array |
2056 | 2056 | */ |
@@ -2128,7 +2128,7 @@ discard block |
||
2128 | 2128 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
2129 | 2129 | * in the getRecordings request considering only those that belong to deleted activities. |
2130 | 2130 | * |
2131 | - * @param string $courseid |
|
2131 | + * @param integer $courseid |
|
2132 | 2132 | * @param string $bigbluebuttonbnid |
2133 | 2133 | * @param bool $subset |
2134 | 2134 | * |
@@ -2152,7 +2152,7 @@ discard block |
||
2152 | 2152 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
2153 | 2153 | * in the getRecordings request considering only those that belong to imported recordings. |
2154 | 2154 | * |
2155 | - * @param string $courseid |
|
2155 | + * @param integer $courseid |
|
2156 | 2156 | * @param string $bigbluebuttonbnid |
2157 | 2157 | * @param bool $subset |
2158 | 2158 | * |
@@ -2175,7 +2175,7 @@ discard block |
||
2175 | 2175 | /** |
2176 | 2176 | * Helper function to get recordings and imported recordings together. |
2177 | 2177 | * |
2178 | - * @param string $courseid |
|
2178 | + * @param integer $courseid |
|
2179 | 2179 | * @param string $bigbluebuttonbnid |
2180 | 2180 | * @param bool $subset |
2181 | 2181 | * @param bool $includedeleted |
@@ -2193,7 +2193,7 @@ discard block |
||
2193 | 2193 | * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events |
2194 | 2194 | * in bigbluebuttonbn_logs. |
2195 | 2195 | * |
2196 | - * @param string $courseid |
|
2196 | + * @param integer $courseid |
|
2197 | 2197 | * @param string $bigbluebuttonbnid |
2198 | 2198 | * @param bool $subset |
2199 | 2199 | * @param bool $includedeleted |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | global $CFG; |
32 | 32 | |
33 | -require_once(__DIR__.'/lib.php'); |
|
33 | +require_once(__DIR__ . '/lib.php'); |
|
34 | 34 | |
35 | 35 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ |
36 | 36 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | 'logoutURL' => $logouturl, |
109 | 109 | ]; |
110 | 110 | // Choose between Adobe Flash or HTML5 Client. |
111 | - if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { |
|
111 | + if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) { |
|
112 | 112 | $data['joinViaHtml5'] = 'true'; |
113 | 113 | } |
114 | 114 | if (!is_null($configtoken)) { |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | $data = null; |
137 | 137 | if (!is_null($pname) && !is_null($purl)) { |
138 | 138 | $method = 'POST'; |
139 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
140 | - $purl."' /></module></modules>"; |
|
139 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
140 | + $purl . "' /></module></modules>"; |
|
141 | 141 | } |
142 | 142 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
143 | 143 | if ($xml) { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | if (isset($recordingxml->breakoutRooms->breakoutRoom)) { |
260 | 260 | foreach ($recordingxml->breakoutRooms->breakoutRoom as $breakoutroom) { |
261 | 261 | $url = \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getRecordings', |
262 | - ['recordID' => implode(',', (array) $breakoutroom)]); |
|
262 | + ['recordID' => implode(',', (array)$breakoutroom)]); |
|
263 | 263 | $xml = bigbluebuttonbn_wrap_xml_load_file($url); |
264 | 264 | if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { |
265 | 265 | // If there were meetings already created. |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | // Override imported flag with actual ID. |
315 | 315 | $recording['imported'] = $recordimported->id; |
316 | 316 | if (isset($recordimported->protected)) { |
317 | - $recording['protected'] = (string) $recordimported->protected; |
|
317 | + $recording['protected'] = (string)$recordimported->protected; |
|
318 | 318 | } |
319 | 319 | $recordsimportedarray[$recording['recordID']] = $recording; |
320 | 320 | } |
@@ -344,21 +344,21 @@ discard block |
||
344 | 344 | // Add formats. |
345 | 345 | $playbackarray = array(); |
346 | 346 | foreach ($recording->playback->format as $format) { |
347 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
348 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
347 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
348 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
349 | 349 | // Add preview per format when existing. |
350 | 350 | if ($format->preview) { |
351 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
351 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | // Add the metadata to the recordings array. |
355 | 355 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
356 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
357 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
358 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
359 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
356 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
357 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
358 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
359 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
360 | 360 | if (isset($recording->protected)) { |
361 | - $recordingarray['protected'] = (string) $recording->protected; |
|
361 | + $recordingarray['protected'] = (string)$recording->protected; |
|
362 | 362 | } |
363 | 363 | return $recordingarray + $metadataarray; |
364 | 364 | } |
@@ -373,9 +373,9 @@ discard block |
||
373 | 373 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
374 | 374 | $imagesarray = array(); |
375 | 375 | foreach ($preview->images->image as $image) { |
376 | - $imagearray = array('url' => trim((string) $image)); |
|
376 | + $imagearray = array('url' => trim((string)$image)); |
|
377 | 377 | foreach ($image->attributes() as $attkey => $attvalue) { |
378 | - $imagearray[$attkey] = (string) $attvalue; |
|
378 | + $imagearray[$attkey] = (string)$attvalue; |
|
379 | 379 | } |
380 | 380 | array_push($imagesarray, $imagearray); |
381 | 381 | } |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | if (is_object($value)) { |
396 | 396 | $value = ''; |
397 | 397 | } |
398 | - $metadataarray['meta_'.$key] = $value; |
|
398 | + $metadataarray['meta_' . $key] = $value; |
|
399 | 399 | } |
400 | 400 | return $metadataarray; |
401 | 401 | } |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $ids = explode(',', $recordids); |
471 | 471 | foreach ($ids as $id) { |
472 | 472 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
473 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
473 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
474 | 474 | ); |
475 | 475 | if ($xml && $xml->returncode != 'SUCCESS') { |
476 | 476 | return false; |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | return $xml; |
536 | 536 | } catch (Exception $e) { |
537 | 537 | libxml_use_internal_errors($previous); |
538 | - $error = 'Caught exception: '.$e->getMessage(); |
|
538 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
539 | 539 | debugging($error, DEBUG_DEVELOPER); |
540 | 540 | return null; |
541 | 541 | } |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
547 | 547 | return $response; |
548 | 548 | } catch (Exception $e) { |
549 | - $error = 'Caught exception: '.$e->getMessage(); |
|
549 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
550 | 550 | debugging($error, DEBUG_DEVELOPER); |
551 | 551 | libxml_use_internal_errors($previous); |
552 | 552 | return null; |
@@ -572,8 +572,8 @@ discard block |
||
572 | 572 | } |
573 | 573 | $options = array(); |
574 | 574 | $options['CURLOPT_HTTPHEADER'] = array( |
575 | - 'Content-Type: '.$contenttype, |
|
576 | - 'Content-Length: '.strlen($data), |
|
575 | + 'Content-Type: ' . $contenttype, |
|
576 | + 'Content-Length: ' . strlen($data), |
|
577 | 577 | 'Content-Language: en-US', |
578 | 578 | ); |
579 | 579 | |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | * @return void |
595 | 595 | */ |
596 | 596 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
597 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
597 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
598 | 598 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
599 | 599 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
600 | 600 | } |
@@ -614,9 +614,9 @@ discard block |
||
614 | 614 | if ($userroles) { |
615 | 615 | $where = ''; |
616 | 616 | foreach ($userroles as $userrole) { |
617 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
617 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
618 | 618 | } |
619 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
619 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
620 | 620 | } |
621 | 621 | return $userroles; |
622 | 622 | } |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | * @return array $users |
640 | 640 | */ |
641 | 641 | function bigbluebuttonbn_get_users(context $context = null) { |
642 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
642 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
643 | 643 | foreach ($users as $key => $value) { |
644 | 644 | $users[$key] = fullname($value); |
645 | 645 | } |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | * @return array $users |
655 | 655 | */ |
656 | 656 | function bigbluebuttonbn_get_users_select(context $context = null) { |
657 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
657 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
658 | 658 | foreach ($users as $key => $value) { |
659 | 659 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
660 | 660 | } |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | * @return array $roles |
670 | 670 | */ |
671 | 671 | function bigbluebuttonbn_get_roles(context $context = null) { |
672 | - $roles = (array) role_get_names($context); |
|
672 | + $roles = (array)role_get_names($context); |
|
673 | 673 | foreach ($roles as $key => $value) { |
674 | 674 | $roles[$key] = $value->localname; |
675 | 675 | } |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | * @return array $users |
685 | 685 | */ |
686 | 686 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
687 | - $roles = (array) role_get_names($context); |
|
687 | + $roles = (array)role_get_names($context); |
|
688 | 688 | foreach ($roles as $key => $value) { |
689 | 689 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
690 | 690 | } |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | * @return object $role |
700 | 700 | */ |
701 | 701 | function bigbluebuttonbn_get_role($id) { |
702 | - $roles = (array) role_get_names(); |
|
702 | + $roles = (array)role_get_names(); |
|
703 | 703 | if (is_numeric($id) && isset($roles[$id])) { |
704 | 704 | return (object)$roles[$id]; |
705 | 705 | } |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | if (!isguestuser()) { |
857 | 857 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid); |
858 | 858 | } |
859 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
859 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
860 | 860 | } |
861 | 861 | |
862 | 862 | /** |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | function bigbluebuttonbn_generate_nonce() { |
1057 | 1057 | $mt = microtime(); |
1058 | 1058 | $rand = mt_rand(); |
1059 | - return md5($mt.$rand); |
|
1059 | + return md5($mt . $rand); |
|
1060 | 1060 | } |
1061 | 1061 | |
1062 | 1062 | /** |
@@ -1146,10 +1146,10 @@ discard block |
||
1146 | 1146 | $now = time(); |
1147 | 1147 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1148 | 1148 | // Use the value in the cache. |
1149 | - return (array) json_decode($result['meeting_info']); |
|
1149 | + return (array)json_decode($result['meeting_info']); |
|
1150 | 1150 | } |
1151 | 1151 | // Ping again and refresh the cache. |
1152 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1152 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1153 | 1153 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1154 | 1154 | ); |
1155 | 1155 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1260,7 +1260,7 @@ discard block |
||
1260 | 1260 | * @return object |
1261 | 1261 | */ |
1262 | 1262 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1263 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1263 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1264 | 1264 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1265 | 1265 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1266 | 1266 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1276,8 +1276,8 @@ discard block |
||
1276 | 1276 | * @return string |
1277 | 1277 | */ |
1278 | 1278 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1279 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1280 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1279 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1280 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1281 | 1281 | return $configxmlparams; |
1282 | 1282 | } |
1283 | 1283 | |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | */ |
1292 | 1292 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1293 | 1293 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1294 | - $configxmlarray = (array) $configxml; |
|
1294 | + $configxmlarray = (array)$configxml; |
|
1295 | 1295 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1296 | 1296 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1297 | 1297 | return ''; |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | global $USER; |
1386 | 1386 | $starttime = $starttime - ($starttime % 1000); |
1387 | 1387 | // Set formatted date. |
1388 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1388 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1389 | 1389 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1390 | 1390 | } |
1391 | 1391 | |
@@ -1501,7 +1501,7 @@ discard block |
||
1501 | 1501 | * @return string |
1502 | 1502 | */ |
1503 | 1503 | function bigbluebuttonbn_get_recording_data_row_preview($recording) { |
1504 | - $options = array('id' => 'preview-'.$recording['recordID']); |
|
1504 | + $options = array('id' => 'preview-' . $recording['recordID']); |
|
1505 | 1505 | if ($recording['published'] === 'false') { |
1506 | 1506 | $options['hidden'] = 'hidden'; |
1507 | 1507 | } |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | if ($recording['published'] === 'false') { |
1564 | 1564 | $visibility = 'hidden '; |
1565 | 1565 | } |
1566 | - $id = 'playbacks-'.$recording['recordID']; |
|
1566 | + $id = 'playbacks-' . $recording['recordID']; |
|
1567 | 1567 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1568 | 1568 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1569 | 1569 | 'title' => $title, $visibility => $visibility)); |
@@ -1588,11 +1588,11 @@ discard block |
||
1588 | 1588 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
1589 | 1589 | return ''; |
1590 | 1590 | } |
1591 | - $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1591 | + $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1592 | 1592 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1593 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1593 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1594 | 1594 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1595 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1595 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1596 | 1596 | } |
1597 | 1597 | $linkattributes = array( |
1598 | 1598 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | $linkattributes['class'] = 'disabled'; |
1777 | 1777 | unset($linkattributes['onclick']); |
1778 | 1778 | } |
1779 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1779 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1780 | 1780 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1781 | 1781 | 'moodle', $iconattributes); |
1782 | 1782 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1938,7 +1938,7 @@ discard block |
||
1938 | 1938 | */ |
1939 | 1939 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
1940 | 1940 | $row = new html_table_row(); |
1941 | - $row->id = 'recording-tr-'.$recording['recordID']; |
|
1941 | + $row->id = 'recording-tr-' . $recording['recordID']; |
|
1942 | 1942 | $row->attributes['data-imported'] = 'false'; |
1943 | 1943 | $texthead = ''; |
1944 | 1944 | $texttail = ''; |
@@ -1951,7 +1951,7 @@ discard block |
||
1951 | 1951 | $rowdata->date_formatted = str_replace(' ', ' ', $rowdata->date_formatted); |
1952 | 1952 | $row->cells = array(); |
1953 | 1953 | $row->cells[] = $texthead . $rowdata->recording . $texttail; |
1954 | - $row->cells[] = $texthead . $rowdata->meeting . $texttail;; |
|
1954 | + $row->cells[] = $texthead . $rowdata->meeting . $texttail; ; |
|
1955 | 1955 | $row->cells[] = $texthead . $rowdata->activity . $texttail; |
1956 | 1956 | $row->cells[] = $texthead . $rowdata->description . $texttail; |
1957 | 1957 | if (bigbluebuttonbn_get_recording_data_preview_enabled($bbbsession)) { |
@@ -1999,9 +1999,9 @@ discard block |
||
1999 | 1999 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
2000 | 2000 | $sender = get_admin(); |
2001 | 2001 | // Prepare message. |
2002 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
2003 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
2004 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
2002 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
2003 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
2004 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
2005 | 2005 | $context = context_course::instance($bigbluebuttonbn->course); |
2006 | 2006 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
2007 | 2007 | } |
@@ -2223,7 +2223,7 @@ discard block |
||
2223 | 2223 | } |
2224 | 2224 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2225 | 2225 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2226 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2226 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2227 | 2227 | // Include only Create events and exclude those with record not true. |
2228 | 2228 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2229 | 2229 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2397,8 +2397,8 @@ discard block |
||
2397 | 2397 | function bigbluebuttonbn_format_activity_time($time) { |
2398 | 2398 | $activitytime = ''; |
2399 | 2399 | if ($time) { |
2400 | - $activitytime = calendar_day_representation($time).' '. |
|
2401 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2400 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2401 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2402 | 2402 | calendar_time_representation($time); |
2403 | 2403 | } |
2404 | 2404 | return $activitytime; |
@@ -2868,7 +2868,7 @@ discard block |
||
2868 | 2868 | * |
2869 | 2869 | * @return string |
2870 | 2870 | */ |
2871 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
2871 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
2872 | 2872 | global $OUTPUT; |
2873 | 2873 | $output = "\n"; |
2874 | 2874 | // Evaluates if config_warning is enabled. |
@@ -2907,11 +2907,11 @@ discard block |
||
2907 | 2907 | if ($class == '') { |
2908 | 2908 | $class = 'btn btn-secondary'; |
2909 | 2909 | } |
2910 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
2911 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
2912 | - $output .= ' title="' . $title . '"'."\n"; |
|
2913 | - $output .= ' >' . $text . '</button>'."\n"; |
|
2914 | - $output .= ' </form>'."\n"; |
|
2910 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
2911 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
2912 | + $output .= ' title="' . $title . '"' . "\n"; |
|
2913 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
2914 | + $output .= ' </form>' . "\n"; |
|
2915 | 2915 | return $output; |
2916 | 2916 | } |
2917 | 2917 | |
@@ -3076,7 +3076,7 @@ discard block |
||
3076 | 3076 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass; |
3077 | 3077 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; |
3078 | 3078 | // Database info related to the activity. |
3079 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
3079 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
3080 | 3080 | $bbbsession['bigbluebuttonbn']->id; |
3081 | 3081 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
3082 | 3082 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; |
@@ -3108,10 +3108,10 @@ discard block |
||
3108 | 3108 | if ($bbbsession['bigbluebuttonbn']->record) { |
3109 | 3109 | // Check if is enable record all from start. |
3110 | 3110 | if ($bbbsession['recordallfromstart']) { |
3111 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordallfromstartwarning', |
|
3111 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordallfromstartwarning', |
|
3112 | 3112 | 'bigbluebuttonbn'); |
3113 | 3113 | } else { |
3114 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
3114 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
3115 | 3115 | } |
3116 | 3116 | } |
3117 | 3117 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; |
@@ -3126,7 +3126,7 @@ discard block |
||
3126 | 3126 | $bbbsession['originServerName'] = $parsedurl['host']; |
3127 | 3127 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
3128 | 3128 | $bbbsession['originServerCommonName'] = ''; |
3129 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
3129 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
3130 | 3130 | $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server(); |
3131 | 3131 | // Setting for clienttype, assign flash if not enabled, or default if not editable. |
3132 | 3132 | $bbbsession['clienttype'] = \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'); |
@@ -3187,7 +3187,7 @@ discard block |
||
3187 | 3187 | ); |
3188 | 3188 | |
3189 | 3189 | // Check status and set extra values. |
3190 | - $activitystatus = bigbluebuttonbn_view_get_activity_status($bbbsession); // In locallib. |
|
3190 | + $activitystatus = bigbluebuttonbn_view_get_activity_status($bbbsession); // In locallib. |
|
3191 | 3191 | if ($activitystatus == 'ended') { |
3192 | 3192 | $bbbsession['presentation'] = bigbluebuttonbn_get_presentation_array( |
3193 | 3193 | $bbbsession['context'], $bbbsession['bigbluebuttonbn']->presentation); |
@@ -27,8 +27,8 @@ |
||
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); |
@@ -28,7 +28,7 @@ |
||
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. |
@@ -27,9 +27,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
209 | 209 | $callbackresponse['status'] = true; |
210 | 210 | $callbackresponse['found'] = true; |
211 | - $callbackresponse['published'] = (string) $recording['published']; |
|
211 | + $callbackresponse['published'] = (string)$recording['published']; |
|
212 | 212 | if (!isset($params['meta']) || empty($params['meta'])) { |
213 | 213 | return $callbackresponse; |
214 | 214 | } |
@@ -535,8 +535,8 @@ discard block |
||
535 | 535 | $decodedparameters = JWT::decode($params['signed_parameters'], |
536 | 536 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
537 | 537 | } catch (Exception $e) { |
538 | - $error = 'Caught exception: '.$e->getMessage(); |
|
539 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
538 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
539 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
540 | 540 | return; |
541 | 541 | } |
542 | 542 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -561,12 +561,12 @@ discard block |
||
561 | 561 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
562 | 562 | } |
563 | 563 | $overrides = array('meetingid' => $decodedparameters->meeting_id); |
564 | - $meta = '{"recordid":'.$decodedparameters->record_id.'}'; |
|
564 | + $meta = '{"recordid":' . $decodedparameters->record_id . '}'; |
|
565 | 565 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta); |
566 | 566 | header('HTTP/1.0 202 Accepted'); |
567 | 567 | } catch (Exception $e) { |
568 | - $error = 'Caught exception: '.$e->getMessage(); |
|
569 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
568 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
569 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
570 | 570 | } |
571 | 571 | } |
572 | 572 | |
@@ -587,13 +587,13 @@ discard block |
||
587 | 587 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
588 | 588 | if (!isset($importrecordings[$params['id']])) { |
589 | 589 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
590 | - header('HTTP/1.0 404 Not found. '.$error); |
|
590 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
591 | 591 | return; |
592 | 592 | } |
593 | 593 | $callbackresponse = array('status' => true); |
594 | 594 | $importrecordings[$params['id']]['imported'] = true; |
595 | 595 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
596 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
596 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
597 | 597 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
598 | 598 | // Moodle event logger: Create an event for recording imported. |
599 | 599 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -618,8 +618,8 @@ discard block |
||
618 | 618 | $decodedparameters = JWT::decode($params['signed_parameters'], |
619 | 619 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
620 | 620 | } catch (Exception $e) { |
621 | - $error = 'Caught exception: '.$e->getMessage(); |
|
622 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
621 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
622 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
623 | 623 | return; |
624 | 624 | } |
625 | 625 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | } |
661 | 661 | $action = strtolower($params['action']); |
662 | 662 | if (!array_key_exists($action, $requiredparams)) { |
663 | - return 'Action '.$params['action'].' can not be performed.'; |
|
663 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
664 | 664 | } |
665 | 665 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
666 | 666 | } |
@@ -36,7 +36,7 @@ |
||
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 |