@@ -304,10 +304,10 @@ discard block |
||
304 | 304 | */ |
305 | 305 | function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession) { |
306 | 306 | $data = ['meetingID' => $bbbsession['meetingid'], |
307 | - 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
308 | - 'attendeePW' => $bbbsession['viewerPW'], |
|
309 | - 'moderatorPW' => $bbbsession['modPW'], |
|
310 | - 'logoutURL' => $bbbsession['logoutURL'], |
|
307 | + 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
308 | + 'attendeePW' => $bbbsession['viewerPW'], |
|
309 | + 'moderatorPW' => $bbbsession['modPW'], |
|
310 | + 'logoutURL' => $bbbsession['logoutURL'], |
|
311 | 311 | ]; |
312 | 312 | $data['record'] = bigbluebutton_bbb_view_create_meeting_data_record($bbbsession['record']); |
313 | 313 | // Check if auto_start_record is enable. |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | '%duration%', |
330 | 330 | (string) $durationtime, |
331 | 331 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
332 | - ); |
|
332 | + ); |
|
333 | 333 | } |
334 | 334 | $voicebridge = intval($bbbsession['voicebridge']); |
335 | 335 | if ($voicebridge > 0 && $voicebridge < 79999) { |
@@ -380,22 +380,22 @@ discard block |
||
380 | 380 | function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) { |
381 | 381 | global $USER; |
382 | 382 | $metadata = ['bbb-origin' => $bbbsession['origin'], |
383 | - 'bbb-origin-version' => $bbbsession['originVersion'], |
|
384 | - 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
385 | - 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
386 | - 'bbb-origin-tag' => $bbbsession['originTag'], |
|
387 | - 'bbb-context' => $bbbsession['course']->fullname, |
|
388 | - 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
389 | - 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
390 | - 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
383 | + 'bbb-origin-version' => $bbbsession['originVersion'], |
|
384 | + 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
385 | + 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
386 | + 'bbb-origin-tag' => $bbbsession['originTag'], |
|
387 | + 'bbb-context' => $bbbsession['course']->fullname, |
|
388 | + 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
389 | + 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
390 | + 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
391 | 391 | ]; |
392 | 392 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) { |
393 | 393 | $metadata["bn-recording-status"] = json_encode( |
394 | 394 | array( |
395 | 395 | 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'), |
396 | 396 | 'context' => $bbbsession['bigbluebuttonbnURL'] |
397 | - ) |
|
398 | - ); |
|
397 | + ) |
|
398 | + ); |
|
399 | 399 | } |
400 | 400 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) { |
401 | 401 | $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL']; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | defined('MOODLE_INTERNAL') || die(); |
29 | 29 | |
30 | 30 | require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php'); |
31 | -require_once($CFG->libdir.'/adminlib.php'); |
|
31 | +require_once($CFG->libdir . '/adminlib.php'); |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Helper class for validating settings used HTML for settings.php. |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | !isset($CFG->bigbluebuttonbn['recording_all_from_start_default']) || |
63 | 63 | !isset($CFG->bigbluebuttonbn['recording_all_from_start_editable']) || |
64 | 64 | !isset($CFG->bigbluebuttonbn['recording_hide_button_default']) || |
65 | - !isset($CFG->bigbluebuttonbn['recording_hide_button_editable']) ); |
|
65 | + !isset($CFG->bigbluebuttonbn['recording_hide_button_editable'])); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $session['importrecordings'] = ($session['managerecordings']); |
59 | 59 | $session['modPW'] = $session['bigbluebuttonbn']->moderatorpass; |
60 | 60 | $session['viewerPW'] = $session['bigbluebuttonbn']->viewerpass; |
61 | - $session['meetingid'] = $session['bigbluebuttonbn']->meetingid.'-'.$session['course']->id.'-'. |
|
61 | + $session['meetingid'] = $session['bigbluebuttonbn']->meetingid . '-' . $session['course']->id . '-' . |
|
62 | 62 | $session['bigbluebuttonbn']->id; |
63 | 63 | $session['meetingname'] = $session['bigbluebuttonbn']->name; |
64 | 64 | $session['meetingdescription'] = $session['bigbluebuttonbn']->intro; |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | if ($session['bigbluebuttonbn']->record) { |
91 | 91 | // Check if is enable record all from start. |
92 | 92 | if ($session['recordallfromstart']) { |
93 | - $session['welcome'] .= '<br><br>'.get_string('bbbrecordallfromstartwarning', |
|
93 | + $session['welcome'] .= '<br><br>' . get_string('bbbrecordallfromstartwarning', |
|
94 | 94 | 'bigbluebuttonbn'); |
95 | 95 | } else { |
96 | - $session['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
96 | + $session['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | $session['openingtime'] = $session['bigbluebuttonbn']->openingtime; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $session['originServerName'] = $parsedurl['host']; |
107 | 107 | $session['originServerUrl'] = $CFG->wwwroot; |
108 | 108 | $session['originServerCommonName'] = ''; |
109 | - $session['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
109 | + $session['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
110 | 110 | $session['bnserver'] = bigbluebuttonbn_is_bn_server(); |
111 | 111 | $session['clienttype'] = \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'); |
112 | 112 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $data['welcome'] .= '<br><br>'; |
229 | 229 | $data['welcome'] .= str_replace( |
230 | 230 | '%duration%', |
231 | - (string) $durationtime, |
|
231 | + (string)$durationtime, |
|
232 | 232 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
233 | 233 | ); |
234 | 234 | } |
@@ -171,42 +171,42 @@ |
||
171 | 171 | */ |
172 | 172 | public static function get_options() { |
173 | 173 | return array( |
174 | - 'version_major' => self::get_moodle_version_major(), |
|
175 | - 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
176 | - 'importrecordings_enabled' => self::get('importrecordings_enabled'), |
|
177 | - 'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'), |
|
178 | - 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
179 | - 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
180 | - 'userlimit_default' => self::get('userlimit_default'), |
|
181 | - 'userlimit_editable' => self::get('userlimit_editable'), |
|
182 | - 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
183 | - 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
184 | - 'recordings_enabled' => self::get('recordings_enabled'), |
|
185 | - 'recordings_html_default' => self::get('recordings_html_default'), |
|
186 | - 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
187 | - 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
188 | - 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
189 | - 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
190 | - 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
191 | - 'recordings_preview_default' => self::get('recordings_preview_default'), |
|
192 | - 'recordings_preview_editable' => self::get('recordings_preview_editable'), |
|
193 | - 'recording_default' => self::get('recording_default'), |
|
194 | - 'recording_editable' => self::get('recording_editable'), |
|
195 | - 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
196 | - 'recording_all_from_start_default' => self::get('recording_all_from_start_default'), |
|
197 | - 'recording_all_from_start_editable' => self::get('recording_all_from_start_editable'), |
|
198 | - 'recording_hide_button_default' => self::get('recording_hide_button_default'), |
|
199 | - 'recording_hide_button_editable' => self::get('recording_hide_button_editable'), |
|
200 | - 'general_warning_message' => self::get('general_warning_message'), |
|
201 | - 'general_warning_box_type' => self::get('general_warning_box_type'), |
|
202 | - 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
203 | - 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
204 | - 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
205 | - 'clienttype_enabled' => self::get('clienttype_enabled'), |
|
206 | - 'clienttype_editable' => self::get('clienttype_editable'), |
|
207 | - 'clienttype_default' => self::get('clienttype_default'), |
|
208 | - 'muteonstart_editable' => self::get('muteonstart_editable'), |
|
209 | - 'muteonstart_default' => self::get('muteonstart_default'), |
|
210 | - ); |
|
174 | + 'version_major' => self::get_moodle_version_major(), |
|
175 | + 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
176 | + 'importrecordings_enabled' => self::get('importrecordings_enabled'), |
|
177 | + 'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'), |
|
178 | + 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
179 | + 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
180 | + 'userlimit_default' => self::get('userlimit_default'), |
|
181 | + 'userlimit_editable' => self::get('userlimit_editable'), |
|
182 | + 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
183 | + 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
184 | + 'recordings_enabled' => self::get('recordings_enabled'), |
|
185 | + 'recordings_html_default' => self::get('recordings_html_default'), |
|
186 | + 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
187 | + 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
188 | + 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
189 | + 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
190 | + 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
191 | + 'recordings_preview_default' => self::get('recordings_preview_default'), |
|
192 | + 'recordings_preview_editable' => self::get('recordings_preview_editable'), |
|
193 | + 'recording_default' => self::get('recording_default'), |
|
194 | + 'recording_editable' => self::get('recording_editable'), |
|
195 | + 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
196 | + 'recording_all_from_start_default' => self::get('recording_all_from_start_default'), |
|
197 | + 'recording_all_from_start_editable' => self::get('recording_all_from_start_editable'), |
|
198 | + 'recording_hide_button_default' => self::get('recording_hide_button_default'), |
|
199 | + 'recording_hide_button_editable' => self::get('recording_hide_button_editable'), |
|
200 | + 'general_warning_message' => self::get('general_warning_message'), |
|
201 | + 'general_warning_box_type' => self::get('general_warning_box_type'), |
|
202 | + 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
203 | + 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
204 | + 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
205 | + 'clienttype_enabled' => self::get('clienttype_enabled'), |
|
206 | + 'clienttype_editable' => self::get('clienttype_editable'), |
|
207 | + 'clienttype_default' => self::get('clienttype_default'), |
|
208 | + 'muteonstart_editable' => self::get('muteonstart_editable'), |
|
209 | + 'muteonstart_default' => self::get('muteonstart_default'), |
|
210 | + ); |
|
211 | 211 | } |
212 | 212 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | global $CFG; |
30 | 30 | |
31 | -require_once(dirname(__FILE__).'/lib.php'); |
|
31 | +require_once(dirname(__FILE__) . '/lib.php'); |
|
32 | 32 | |
33 | 33 | /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */ |
34 | 34 | const BIGBLUEBUTTONBN_UPDATE_CACHE = true; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'logoutURL' => $logouturl, |
107 | 107 | ]; |
108 | 108 | // Choose between Adobe Flash or HTML5 Client. |
109 | - if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) { |
|
109 | + if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) { |
|
110 | 110 | $data['joinViaHtml5'] = 'true'; |
111 | 111 | } |
112 | 112 | if (!is_null($configtoken)) { |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | $data = null; |
135 | 135 | if (!is_null($pname) && !is_null($purl)) { |
136 | 136 | $method = 'POST'; |
137 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
138 | - $purl."' /></module></modules>"; |
|
137 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
138 | + $purl . "' /></module></modules>"; |
|
139 | 139 | } |
140 | 140 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
141 | 141 | if ($xml) { |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | // Override imported flag with actual ID. |
297 | 297 | $recording['imported'] = $recordimported->id; |
298 | 298 | if (isset($recordimported->protected)) { |
299 | - $recording['protected'] = (string) $recordimported->protected; |
|
299 | + $recording['protected'] = (string)$recordimported->protected; |
|
300 | 300 | } |
301 | 301 | $recordsimportedarray[$recording['recordID']] = $recording; |
302 | 302 | } |
@@ -326,21 +326,21 @@ discard block |
||
326 | 326 | // Add formats. |
327 | 327 | $playbackarray = array(); |
328 | 328 | foreach ($recording->playback->format as $format) { |
329 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
330 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
329 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
330 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
331 | 331 | // Add preview per format when existing. |
332 | 332 | if ($format->preview) { |
333 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
333 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | // Add the metadata to the recordings array. |
337 | 337 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
338 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
339 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
340 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
341 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
338 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
339 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
340 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
341 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
342 | 342 | if (isset($recording->protected)) { |
343 | - $recordingarray['protected'] = (string) $recording->protected; |
|
343 | + $recordingarray['protected'] = (string)$recording->protected; |
|
344 | 344 | } |
345 | 345 | return $recordingarray + $metadataarray; |
346 | 346 | } |
@@ -355,9 +355,9 @@ discard block |
||
355 | 355 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
356 | 356 | $imagesarray = array(); |
357 | 357 | foreach ($preview->images->image as $image) { |
358 | - $imagearray = array('url' => trim((string) $image)); |
|
358 | + $imagearray = array('url' => trim((string)$image)); |
|
359 | 359 | foreach ($image->attributes() as $attkey => $attvalue) { |
360 | - $imagearray[$attkey] = (string) $attvalue; |
|
360 | + $imagearray[$attkey] = (string)$attvalue; |
|
361 | 361 | } |
362 | 362 | array_push($imagesarray, $imagearray); |
363 | 363 | } |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | if (is_object($value)) { |
378 | 378 | $value = ''; |
379 | 379 | } |
380 | - $metadataarray['meta_'.$key] = $value; |
|
380 | + $metadataarray['meta_' . $key] = $value; |
|
381 | 381 | } |
382 | 382 | return $metadataarray; |
383 | 383 | } |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $ids = explode(',', $recordids); |
450 | 450 | foreach ($ids as $id) { |
451 | 451 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
452 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
452 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
453 | 453 | ); |
454 | 454 | if ($xml && $xml->returncode != 'SUCCESS') { |
455 | 455 | return false; |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | return $xml; |
515 | 515 | } catch (Exception $e) { |
516 | 516 | libxml_use_internal_errors($previous); |
517 | - $error = 'Caught exception: '.$e->getMessage(); |
|
517 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
518 | 518 | debugging($error, DEBUG_DEVELOPER); |
519 | 519 | return null; |
520 | 520 | } |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
526 | 526 | return $response; |
527 | 527 | } catch (Exception $e) { |
528 | - $error = 'Caught exception: '.$e->getMessage(); |
|
528 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
529 | 529 | debugging($error, DEBUG_DEVELOPER); |
530 | 530 | libxml_use_internal_errors($previous); |
531 | 531 | return null; |
@@ -551,8 +551,8 @@ discard block |
||
551 | 551 | } |
552 | 552 | $options = array(); |
553 | 553 | $options['CURLOPT_HTTPHEADER'] = array( |
554 | - 'Content-Type: '.$contenttype, |
|
555 | - 'Content-Length: '.strlen($data), |
|
554 | + 'Content-Type: ' . $contenttype, |
|
555 | + 'Content-Length: ' . strlen($data), |
|
556 | 556 | 'Content-Language: en-US', |
557 | 557 | ); |
558 | 558 | |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | * @return void |
574 | 574 | */ |
575 | 575 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
576 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
576 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
577 | 577 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
578 | 578 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
579 | 579 | } |
@@ -593,9 +593,9 @@ discard block |
||
593 | 593 | if ($userroles) { |
594 | 594 | $where = ''; |
595 | 595 | foreach ($userroles as $userrole) { |
596 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
596 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
597 | 597 | } |
598 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
598 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
599 | 599 | } |
600 | 600 | return $userroles; |
601 | 601 | } |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | * @return array $users |
619 | 619 | */ |
620 | 620 | function bigbluebuttonbn_get_users(context $context = null) { |
621 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
621 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
622 | 622 | foreach ($users as $key => $value) { |
623 | 623 | $users[$key] = fullname($value); |
624 | 624 | } |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * @return array $users |
634 | 634 | */ |
635 | 635 | function bigbluebuttonbn_get_users_select(context $context = null) { |
636 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
636 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
637 | 637 | foreach ($users as $key => $value) { |
638 | 638 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
639 | 639 | } |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | * @return array $roles |
649 | 649 | */ |
650 | 650 | function bigbluebuttonbn_get_roles(context $context = null) { |
651 | - $roles = (array) role_get_names($context); |
|
651 | + $roles = (array)role_get_names($context); |
|
652 | 652 | foreach ($roles as $key => $value) { |
653 | 653 | $roles[$key] = $value->localname; |
654 | 654 | } |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | * @return array $users |
664 | 664 | */ |
665 | 665 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
666 | - $roles = (array) role_get_names($context); |
|
666 | + $roles = (array)role_get_names($context); |
|
667 | 667 | foreach ($roles as $key => $value) { |
668 | 668 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
669 | 669 | } |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | * @return object $role |
679 | 679 | */ |
680 | 680 | function bigbluebuttonbn_get_role($id) { |
681 | - $roles = (array) role_get_names(); |
|
681 | + $roles = (array)role_get_names(); |
|
682 | 682 | if (is_numeric($id) && isset($roles[$id])) { |
683 | 683 | return (object)$roles[$id]; |
684 | 684 | } |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | if (!isguestuser()) { |
836 | 836 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid); |
837 | 837 | } |
838 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
838 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
839 | 839 | } |
840 | 840 | |
841 | 841 | /** |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | function bigbluebuttonbn_generate_nonce() { |
1033 | 1033 | $mt = microtime(); |
1034 | 1034 | $rand = mt_rand(); |
1035 | - return md5($mt.$rand); |
|
1035 | + return md5($mt . $rand); |
|
1036 | 1036 | } |
1037 | 1037 | |
1038 | 1038 | /** |
@@ -1122,10 +1122,10 @@ discard block |
||
1122 | 1122 | $now = time(); |
1123 | 1123 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1124 | 1124 | // Use the value in the cache. |
1125 | - return (array) json_decode($result['meeting_info']); |
|
1125 | + return (array)json_decode($result['meeting_info']); |
|
1126 | 1126 | } |
1127 | 1127 | // Ping again and refresh the cache. |
1128 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1128 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1129 | 1129 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1130 | 1130 | ); |
1131 | 1131 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | * @return object |
1237 | 1237 | */ |
1238 | 1238 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1239 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1239 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1240 | 1240 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1241 | 1241 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1242 | 1242 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1252,8 +1252,8 @@ discard block |
||
1252 | 1252 | * @return string |
1253 | 1253 | */ |
1254 | 1254 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1255 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1256 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1255 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1256 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1257 | 1257 | return $configxmlparams; |
1258 | 1258 | } |
1259 | 1259 | |
@@ -1267,7 +1267,7 @@ discard block |
||
1267 | 1267 | */ |
1268 | 1268 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1269 | 1269 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1270 | - $configxmlarray = (array) $configxml; |
|
1270 | + $configxmlarray = (array)$configxml; |
|
1271 | 1271 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1272 | 1272 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1273 | 1273 | return ''; |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | global $USER; |
1360 | 1360 | $starttime = $starttime - ($starttime % 1000); |
1361 | 1361 | // Set formatted date. |
1362 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1362 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1363 | 1363 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1364 | 1364 | } |
1365 | 1365 | |
@@ -1475,7 +1475,7 @@ discard block |
||
1475 | 1475 | * @return string |
1476 | 1476 | */ |
1477 | 1477 | function bigbluebuttonbn_get_recording_data_row_preview($recording) { |
1478 | - $options = array('id' => 'preview-'.$recording['recordID']); |
|
1478 | + $options = array('id' => 'preview-' . $recording['recordID']); |
|
1479 | 1479 | if ($recording['published'] === 'false') { |
1480 | 1480 | $options['hidden'] = 'hidden'; |
1481 | 1481 | } |
@@ -1537,7 +1537,7 @@ discard block |
||
1537 | 1537 | if ($recording['published'] === 'false') { |
1538 | 1538 | $visibility = 'hidden '; |
1539 | 1539 | } |
1540 | - $id = 'playbacks-'.$recording['recordID']; |
|
1540 | + $id = 'playbacks-' . $recording['recordID']; |
|
1541 | 1541 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1542 | 1542 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1543 | 1543 | 'title' => $title, $visibility => $visibility)); |
@@ -1562,11 +1562,11 @@ discard block |
||
1562 | 1562 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
1563 | 1563 | return ''; |
1564 | 1564 | } |
1565 | - $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1565 | + $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1566 | 1566 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1567 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1567 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1568 | 1568 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1569 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1569 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1570 | 1570 | } |
1571 | 1571 | $linkattributes = array( |
1572 | 1572 | 'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'], |
@@ -1735,7 +1735,7 @@ discard block |
||
1735 | 1735 | $linkattributes['class'] = 'disabled'; |
1736 | 1736 | unset($linkattributes['onclick']); |
1737 | 1737 | } |
1738 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1738 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1739 | 1739 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1740 | 1740 | 'moodle', $iconattributes); |
1741 | 1741 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1852,7 +1852,7 @@ discard block |
||
1852 | 1852 | */ |
1853 | 1853 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
1854 | 1854 | $row = new html_table_row(); |
1855 | - $row->id = 'recording-tr-'.$recording['recordID']; |
|
1855 | + $row->id = 'recording-tr-' . $recording['recordID']; |
|
1856 | 1856 | $row->attributes['data-imported'] = 'false'; |
1857 | 1857 | $texthead = ''; |
1858 | 1858 | $texttail = ''; |
@@ -1912,9 +1912,9 @@ discard block |
||
1912 | 1912 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
1913 | 1913 | $sender = get_admin(); |
1914 | 1914 | // Prepare message. |
1915 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
1916 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
1917 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1915 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
1916 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
1917 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1918 | 1918 | $context = context_course::instance($bigbluebuttonbn->course); |
1919 | 1919 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
1920 | 1920 | } |
@@ -2136,7 +2136,7 @@ discard block |
||
2136 | 2136 | } |
2137 | 2137 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2138 | 2138 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2139 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2139 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2140 | 2140 | // Include only Create events and exclude those with record not true. |
2141 | 2141 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2142 | 2142 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2310,8 +2310,8 @@ discard block |
||
2310 | 2310 | function bigbluebuttonbn_format_activity_time($time) { |
2311 | 2311 | $activitytime = ''; |
2312 | 2312 | if ($time) { |
2313 | - $activitytime = calendar_day_representation($time).' '. |
|
2314 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2313 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2314 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2315 | 2315 | calendar_time_representation($time); |
2316 | 2316 | } |
2317 | 2317 | return $activitytime; |
@@ -2779,7 +2779,7 @@ discard block |
||
2779 | 2779 | * |
2780 | 2780 | * @return string |
2781 | 2781 | */ |
2782 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
2782 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
2783 | 2783 | global $OUTPUT; |
2784 | 2784 | $output = "\n"; |
2785 | 2785 | // Evaluates if config_warning is enabled. |
@@ -2818,11 +2818,11 @@ discard block |
||
2818 | 2818 | if ($class == '') { |
2819 | 2819 | $class = 'btn btn-secondary'; |
2820 | 2820 | } |
2821 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
2822 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
2823 | - $output .= ' title="' . $title . '"'."\n"; |
|
2824 | - $output .= ' >' . $text . '</button>'."\n"; |
|
2825 | - $output .= ' </form>'."\n"; |
|
2821 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
2822 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
2823 | + $output .= ' title="' . $title . '"' . "\n"; |
|
2824 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
2825 | + $output .= ' </form>' . "\n"; |
|
2826 | 2826 | return $output; |
2827 | 2827 | } |
2828 | 2828 | |
@@ -2987,7 +2987,7 @@ discard block |
||
2987 | 2987 | $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass; |
2988 | 2988 | $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass; |
2989 | 2989 | // Database info related to the activity. |
2990 | - $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'. |
|
2990 | + $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' . |
|
2991 | 2991 | $bbbsession['bigbluebuttonbn']->id; |
2992 | 2992 | $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name; |
2993 | 2993 | $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro; |
@@ -3021,10 +3021,10 @@ discard block |
||
3021 | 3021 | if ($bbbsession['bigbluebuttonbn']->record) { |
3022 | 3022 | // Check if is enable record all from start. |
3023 | 3023 | if ($bbbsession['recordallfromstart']) { |
3024 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordallfromstartwarning', |
|
3024 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordallfromstartwarning', |
|
3025 | 3025 | 'bigbluebuttonbn'); |
3026 | 3026 | } else { |
3027 | - $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
3027 | + $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn'); |
|
3028 | 3028 | } |
3029 | 3029 | } |
3030 | 3030 | $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime; |
@@ -3039,7 +3039,7 @@ discard block |
||
3039 | 3039 | $bbbsession['originServerName'] = $parsedurl['host']; |
3040 | 3040 | $bbbsession['originServerUrl'] = $CFG->wwwroot; |
3041 | 3041 | $bbbsession['originServerCommonName'] = ''; |
3042 | - $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')'; |
|
3042 | + $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')'; |
|
3043 | 3043 | $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server(); |
3044 | 3044 | // Setting for clienttype, assign flash if not enabled, or default if not editable. |
3045 | 3045 | $bbbsession['clienttype'] = \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'); |