@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | global $CFG; |
29 | 29 | |
30 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
30 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
31 | 31 | |
32 | 32 | if ($ADMIN->fulltree) { |
33 | 33 | // Configuration for BigBlueButton. |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | defined('MOODLE_INTERNAL') || die; |
27 | 27 | |
28 | -require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php'); |
|
28 | +require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php'); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Backup task that provides all the settings and steps to perform one complete backup of the activity. |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | public static function encode_content_links($content) { |
63 | 63 | global $CFG; |
64 | 64 | |
65 | - $base = preg_quote($CFG->wwwroot.'/mod/bigbluebuttonbn', '#'); |
|
65 | + $base = preg_quote($CFG->wwwroot . '/mod/bigbluebuttonbn', '#'); |
|
66 | 66 | |
67 | 67 | // Link to the list of bigbluebuttonbns. |
68 | - $pattern = '#('.$base."\/index.php\?id\=)([0-9]+)#"; |
|
68 | + $pattern = '#(' . $base . "\/index.php\?id\=)([0-9]+)#"; |
|
69 | 69 | $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNINDEX*$2@$', $content); |
70 | 70 | |
71 | 71 | // Link to bigbluebuttonbn view by moduleid. |
72 | - $pattern = '#('.$base."\/view.php\?id\=)([0-9]+)#"; |
|
72 | + $pattern = '#(' . $base . "\/view.php\?id\=)([0-9]+)#"; |
|
73 | 73 | $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNVIEWBYID*$2@$', $content); |
74 | 74 | |
75 | 75 | return $content; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $logs = new backup_nested_element('logs'); |
49 | 49 | |
50 | 50 | $log = new backup_nested_element('log', array('id'), array( |
51 | - 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', )); |
|
51 | + 'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',)); |
|
52 | 52 | |
53 | 53 | // Build the tree. |
54 | 54 | $bigbluebuttonbn->add_child($logs); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | protected function process_bigbluebuttonbn($data) { |
51 | 51 | global $DB; |
52 | - $data = (object) $data; |
|
52 | + $data = (object)$data; |
|
53 | 53 | $data->course = $this->get_courseid(); |
54 | 54 | $data->timemodified = $this->apply_date_offset($data->timemodified); |
55 | 55 | // Insert the bigbluebuttonbn record. |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function process_bigbluebuttonbn_logs($data) { |
67 | 67 | global $DB; |
68 | - $data = (object) $data; |
|
68 | + $data = (object)$data; |
|
69 | 69 | // Apply modifications. |
70 | 70 | $data->courseid = $this->get_mappingid('course', $data->courseid); |
71 | 71 | $data->bigbluebuttonbnid = $this->get_new_parentid('bigbluebuttonbn'); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | defined('MOODLE_INTERNAL') || die(); |
27 | 27 | |
28 | -require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php'); |
|
28 | +require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php'); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Restore task that provides all the settings and steps to perform one complete restore of the activity. |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
24 | 24 | */ |
25 | 25 | |
26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
28 | 28 | |
29 | 29 | $bn = required_param('bn', PARAM_INT); |
30 | 30 | $tc = optional_param('tc', 0, PARAM_INT); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $body .= html_writer::tag('input', '', |
79 | 79 | array('type' => 'button', 'class' => 'btn btn-secondary', |
80 | 80 | 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
81 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
81 | + 'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $cm->id . '\'')); |
|
82 | 82 | // JavaScript for locales. |
83 | 83 | $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn'); |
84 | 84 | // Require JavaScript modules. |
@@ -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. |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | ); |
128 | 128 | $defaultvalues['presentation'] = $draftitemid; |
129 | 129 | } catch (Exception $e) { |
130 | - debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER); |
|
130 | + debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER); |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | } |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | return; |
424 | 424 | } |
425 | 425 | $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options); |
426 | - if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) { |
|
426 | + if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) { |
|
427 | 427 | $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn'); |
428 | 428 | } |
429 | 429 | if (!empty($rule)) { |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
24 | 24 | */ |
25 | 25 | |
26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
28 | 28 | |
29 | 29 | $action = required_param('action', PARAM_TEXT); |
30 | 30 | $id = optional_param('id', 0, PARAM_INT); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
93 | 93 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
94 | - header('Location: '.$bbbsession['logoutURL']); |
|
94 | + header('Location: ' . $bbbsession['logoutURL']); |
|
95 | 95 | break; |
96 | 96 | } |
97 | 97 | // As the meeting doesn't exist, try to create it. |
@@ -105,16 +105,16 @@ discard block |
||
105 | 105 | // The server is unreachable. |
106 | 106 | if ($bbbsession['administrator']) { |
107 | 107 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
108 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
108 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
109 | 109 | break; |
110 | 110 | } |
111 | 111 | if ($bbbsession['moderator']) { |
112 | 112 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
113 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
113 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
114 | 114 | break; |
115 | 115 | } |
116 | 116 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
117 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
117 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
118 | 118 | break; |
119 | 119 | } |
120 | 120 | if ($response['returncode'] == 'FAILED') { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | // Moodle event logger: Create an event for meeting left. |
144 | 144 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
145 | 145 | // Execute the redirect. |
146 | - header('Location: '.urldecode($href)); |
|
146 | + header('Location: ' . urldecode($href)); |
|
147 | 147 | break; |
148 | 148 | default: |
149 | 149 | bigbluebutton_bbb_view_close_window(); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $data['welcome'] .= '<br><br>'; |
229 | 229 | $data['welcome'] .= str_replace( |
230 | 230 | '%duration%', |
231 | - (string) $durationtime, |
|
231 | + (string)$durationtime, |
|
232 | 232 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
233 | 233 | ); |
234 | 234 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
317 | 317 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
318 | 318 | // No more users allowed to join. |
319 | - header('Location: '.$bbbsession['logoutURL']); |
|
319 | + header('Location: ' . $bbbsession['logoutURL']); |
|
320 | 320 | return; |
321 | 321 | } |
322 | 322 | // Build the URL. |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
335 | 335 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
336 | 336 | // Execute the redirect. |
337 | - header('Location: '.$joinurl); |
|
337 | + header('Location: ' . $joinurl); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | /** |
@@ -346,13 +346,13 @@ discard block |
||
346 | 346 | */ |
347 | 347 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
348 | 348 | global $CFG, $OUTPUT; |
349 | - $errors = (array) json_decode(urldecode($serrors)); |
|
349 | + $errors = (array)json_decode(urldecode($serrors)); |
|
350 | 350 | $msgerrors = ''; |
351 | 351 | foreach ($errors as $error) { |
352 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
352 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
353 | 353 | } |
354 | 354 | echo $OUTPUT->header(); |
355 | 355 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
356 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
356 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
357 | 357 | echo $OUTPUT->footer(); |
358 | 358 | } |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
24 | 24 | */ |
25 | 25 | |
26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
28 | 28 | |
29 | 29 | use \Firebase\JWT\JWT; |
30 | 30 | |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
41 | 41 | |
42 | 42 | if (empty($params['action'])) { |
43 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
43 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
44 | 44 | return; |
45 | 45 | } |
46 | 46 | |
47 | 47 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
48 | 48 | if (!empty($error)) { |
49 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
49 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm); |
131 | 131 | return; |
132 | 132 | } |
133 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
133 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
134 | 134 | return; |
135 | 135 | |
136 | 136 | } catch (Exception $e) { |
137 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
137 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
321 | 321 | $callbackresponse['status'] = true; |
322 | 322 | $callbackresponse['found'] = true; |
323 | - $callbackresponse['published'] = (string) $recording['published']; |
|
323 | + $callbackresponse['published'] = (string)$recording['published']; |
|
324 | 324 | if (!isset($params['meta']) || empty($params['meta'])) { |
325 | 325 | return $callbackresponse; |
326 | 326 | } |
@@ -650,8 +650,8 @@ discard block |
||
650 | 650 | $decodedparameters = JWT::decode($params['signed_parameters'], |
651 | 651 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
652 | 652 | } catch (Exception $e) { |
653 | - $error = 'Caught exception: '.$e->getMessage(); |
|
654 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
653 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
654 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
655 | 655 | return; |
656 | 656 | } |
657 | 657 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -667,8 +667,8 @@ discard block |
||
667 | 667 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
668 | 668 | header('HTTP/1.0 202 Accepted'); |
669 | 669 | } catch (Exception $e) { |
670 | - $error = 'Caught exception: '.$e->getMessage(); |
|
671 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
670 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
671 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
672 | 672 | } |
673 | 673 | } |
674 | 674 | |
@@ -689,13 +689,13 @@ discard block |
||
689 | 689 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
690 | 690 | if (!isset($importrecordings[$params['id']])) { |
691 | 691 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
692 | - header('HTTP/1.0 404 Not found. '.$error); |
|
692 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
693 | 693 | return; |
694 | 694 | } |
695 | 695 | $callbackresponse = array('status' => true); |
696 | 696 | $importrecordings[$params['id']]['imported'] = true; |
697 | 697 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
698 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
698 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
699 | 699 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
700 | 700 | // Moodle event logger: Create an event for recording imported. |
701 | 701 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -721,8 +721,8 @@ discard block |
||
721 | 721 | $decodedparameters = JWT::decode($params['signed_parameters'], |
722 | 722 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
723 | 723 | } catch (Exception $e) { |
724 | - $error = 'Caught exception: '.$e->getMessage(); |
|
725 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
724 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
725 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
726 | 726 | return; |
727 | 727 | } |
728 | 728 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | } |
764 | 764 | $action = strtolower($params['action']); |
765 | 765 | if (!array_key_exists($action, $requiredparams)) { |
766 | - return 'Action '.$params['action'].' can not be performed.'; |
|
766 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
767 | 767 | } |
768 | 768 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
769 | 769 | } |