@@ -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. |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | */ |
199 | 199 | function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession) { |
200 | 200 | $data = ['meetingID' => $bbbsession['meetingid'], |
201 | - 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
202 | - 'attendeePW' => $bbbsession['viewerPW'], |
|
203 | - 'moderatorPW' => $bbbsession['modPW'], |
|
204 | - 'logoutURL' => $bbbsession['logoutURL'], |
|
201 | + 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
202 | + 'attendeePW' => $bbbsession['viewerPW'], |
|
203 | + 'moderatorPW' => $bbbsession['modPW'], |
|
204 | + 'logoutURL' => $bbbsession['logoutURL'], |
|
205 | 205 | ]; |
206 | 206 | $data['record'] = bigbluebutton_bbb_view_create_meeting_data_record($bbbsession['record']); |
207 | 207 | $data['welcome'] = trim($bbbsession['welcome']); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | '%duration%', |
215 | 215 | (string) $durationtime, |
216 | 216 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
217 | - ); |
|
217 | + ); |
|
218 | 218 | } |
219 | 219 | $voicebridge = intval($bbbsession['voicebridge']); |
220 | 220 | if ($voicebridge > 0 && $voicebridge < 79999) { |
@@ -253,22 +253,22 @@ discard block |
||
253 | 253 | function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) { |
254 | 254 | global $USER; |
255 | 255 | $metadata = ['bbb-origin' => $bbbsession['origin'], |
256 | - 'bbb-origin-version' => $bbbsession['originVersion'], |
|
257 | - 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
258 | - 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
259 | - 'bbb-origin-tag' => $bbbsession['originTag'], |
|
260 | - 'bbb-context' => $bbbsession['course']->fullname, |
|
261 | - 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
262 | - 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
263 | - 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
256 | + 'bbb-origin-version' => $bbbsession['originVersion'], |
|
257 | + 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
258 | + 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
259 | + 'bbb-origin-tag' => $bbbsession['originTag'], |
|
260 | + 'bbb-context' => $bbbsession['course']->fullname, |
|
261 | + 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
262 | + 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
263 | + 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
264 | 264 | ]; |
265 | 265 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) { |
266 | 266 | $metadata["bn-recording-status"] = json_encode( |
267 | 267 | array( |
268 | 268 | 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'), |
269 | 269 | 'context' => $bbbsession['bigbluebuttonbnURL'] |
270 | - ) |
|
271 | - ); |
|
270 | + ) |
|
271 | + ); |
|
272 | 272 | } |
273 | 273 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) { |
274 | 274 | $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL']; |
@@ -61,94 +61,94 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | switch (strtolower($action)) { |
64 | - case 'logout': |
|
65 | - if (isset($errors) && $errors != '') { |
|
66 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
67 | - break; |
|
68 | - } |
|
69 | - if (is_null($bbbsession)) { |
|
70 | - bigbluebutton_bbb_view_close_window_manually(); |
|
71 | - break; |
|
72 | - } |
|
73 | - // Moodle event logger: Create an event for meeting left. |
|
74 | - bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_left'], $bigbluebuttonbn); |
|
75 | - // Update the cache. |
|
76 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
77 | - // Close the tab or window where BBB was opened. |
|
78 | - bigbluebutton_bbb_view_close_window(); |
|
79 | - break; |
|
80 | - case 'join': |
|
81 | - if (is_null($bbbsession)) { |
|
82 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
83 | - break; |
|
84 | - } |
|
85 | - // See if the session is in progress. |
|
86 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
87 | - // Since the meeting is already running, we just join the session. |
|
88 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
|
89 | - break; |
|
90 | - } |
|
91 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
92 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
93 | - header('Location: '.$bbbsession['logoutURL']); |
|
64 | + case 'logout': |
|
65 | + if (isset($errors) && $errors != '') { |
|
66 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
67 | + break; |
|
68 | + } |
|
69 | + if (is_null($bbbsession)) { |
|
70 | + bigbluebutton_bbb_view_close_window_manually(); |
|
71 | + break; |
|
72 | + } |
|
73 | + // Moodle event logger: Create an event for meeting left. |
|
74 | + bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_left'], $bigbluebuttonbn); |
|
75 | + // Update the cache. |
|
76 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
77 | + // Close the tab or window where BBB was opened. |
|
78 | + bigbluebutton_bbb_view_close_window(); |
|
94 | 79 | break; |
95 | - } |
|
96 | - // As the meeting doesn't exist, try to create it. |
|
97 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
98 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
99 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
100 | - $bbbsession['presentation']['name'], |
|
101 | - $bbbsession['presentation']['url'] |
|
102 | - ); |
|
103 | - if (empty($response)) { |
|
104 | - // The server is unreachable. |
|
105 | - if ($bbbsession['administrator']) { |
|
106 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
107 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
80 | + case 'join': |
|
81 | + if (is_null($bbbsession)) { |
|
82 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
83 | + break; |
|
84 | + } |
|
85 | + // See if the session is in progress. |
|
86 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
87 | + // Since the meeting is already running, we just join the session. |
|
88 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
|
108 | 89 | break; |
109 | 90 | } |
110 | - if ($bbbsession['moderator']) { |
|
111 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
91 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
92 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
93 | + header('Location: '.$bbbsession['logoutURL']); |
|
94 | + break; |
|
95 | + } |
|
96 | + // As the meeting doesn't exist, try to create it. |
|
97 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
98 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
99 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
100 | + $bbbsession['presentation']['name'], |
|
101 | + $bbbsession['presentation']['url'] |
|
102 | + ); |
|
103 | + if (empty($response)) { |
|
104 | + // The server is unreachable. |
|
105 | + if ($bbbsession['administrator']) { |
|
106 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
107 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
108 | + break; |
|
109 | + } |
|
110 | + if ($bbbsession['moderator']) { |
|
111 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
112 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
113 | + break; |
|
114 | + } |
|
115 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
112 | 116 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
113 | 117 | break; |
114 | 118 | } |
115 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
116 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
117 | - break; |
|
118 | - } |
|
119 | - if ($response['returncode'] == 'FAILED') { |
|
120 | - // The meeting was not created. |
|
121 | - if (!$printerrorkey) { |
|
122 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
119 | + if ($response['returncode'] == 'FAILED') { |
|
120 | + // The meeting was not created. |
|
121 | + if (!$printerrorkey) { |
|
122 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
123 | + break; |
|
124 | + } |
|
125 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
126 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
127 | + break; |
|
128 | + } |
|
129 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
130 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
123 | 131 | break; |
124 | 132 | } |
125 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
126 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
133 | + // Moodle event logger: Create an event for meeting created. |
|
134 | + bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
|
135 | + // Internal logger: Insert a record with the meeting created. |
|
136 | + $overrides = array('meetingid' => $bbbsession['meetingid']); |
|
137 | + $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
138 | + bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
|
139 | + // Since the meeting is already running, we just join the session. |
|
140 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
|
127 | 141 | break; |
128 | - } |
|
129 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
130 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
142 | + case 'play': |
|
143 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
144 | + // Moodle event logger: Create an event for meeting left. |
|
145 | + bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn, |
|
146 | + ['other' => $rid]); |
|
147 | + // Execute the redirect. |
|
148 | + header('Location: '.urldecode($href)); |
|
131 | 149 | break; |
132 | - } |
|
133 | - // Moodle event logger: Create an event for meeting created. |
|
134 | - bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
|
135 | - // Internal logger: Insert a record with the meeting created. |
|
136 | - $overrides = array('meetingid' => $bbbsession['meetingid']); |
|
137 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
138 | - bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
|
139 | - // Since the meeting is already running, we just join the session. |
|
140 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
|
141 | - break; |
|
142 | - case 'play': |
|
143 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
144 | - // Moodle event logger: Create an event for meeting left. |
|
145 | - bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn, |
|
146 | - ['other' => $rid]); |
|
147 | - // Execute the redirect. |
|
148 | - header('Location: '.urldecode($href)); |
|
149 | - break; |
|
150 | - default: |
|
151 | - bigbluebutton_bbb_view_close_window(); |
|
150 | + default: |
|
151 | + bigbluebutton_bbb_view_close_window(); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -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 | global $SESSION; |
30 | 30 | |
@@ -64,24 +64,24 @@ discard block |
||
64 | 64 | if (is_null($serverversion)) { |
65 | 65 | if ($bbbsession['administrator']) { |
66 | 66 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
67 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
67 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
68 | 68 | exit; |
69 | 69 | } |
70 | 70 | if ($bbbsession['moderator']) { |
71 | 71 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
72 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
72 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
73 | 73 | exit; |
74 | 74 | } |
75 | 75 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
76 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
76 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
77 | 77 | exit; |
78 | 78 | } |
79 | 79 | |
80 | - $bbbsession['serverversion'] = (string) $serverversion; |
|
80 | + $bbbsession['serverversion'] = (string)$serverversion; |
|
81 | 81 | |
82 | 82 | // Operation URLs. |
83 | 83 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
84 | - $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id . |
|
84 | + $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . |
|
85 | 85 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
86 | 86 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
87 | 87 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
143 | 143 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
144 | - header('Location: '.$bbbsession['logoutURL']); |
|
144 | + header('Location: ' . $bbbsession['logoutURL']); |
|
145 | 145 | break; |
146 | 146 | } |
147 | 147 | // As the meeting doesn't exist, try to create it. |
@@ -155,16 +155,16 @@ discard block |
||
155 | 155 | // The server is unreachable. |
156 | 156 | if ($bbbsession['administrator']) { |
157 | 157 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
158 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
158 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
159 | 159 | break; |
160 | 160 | } |
161 | 161 | if ($bbbsession['moderator']) { |
162 | 162 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
163 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
163 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
164 | 164 | break; |
165 | 165 | } |
166 | 166 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
167 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
167 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
168 | 168 | break; |
169 | 169 | } |
170 | 170 | if ($response['returncode'] == 'FAILED') { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
186 | 186 | // Internal logger: Insert a record with the meeting created. |
187 | 187 | $overrides = array('meetingid' => $bbbsession['meetingid']); |
188 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
188 | + $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
189 | 189 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
190 | 190 | // Since the meeting is already running, we just join the session. |
191 | 191 | bigbluebutton_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn, |
197 | 197 | ['other' => $rid]); |
198 | 198 | // Execute the redirect. |
199 | - header('Location: '.urldecode($href)); |
|
199 | + header('Location: ' . urldecode($href)); |
|
200 | 200 | break; |
201 | 201 | default: |
202 | 202 | bigbluebutton_bbb_view_close_window(); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $data['welcome'] .= '<br><br>'; |
282 | 282 | $data['welcome'] .= str_replace( |
283 | 283 | '%duration%', |
284 | - (string) $durationtime, |
|
284 | + (string)$durationtime, |
|
285 | 285 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
286 | 286 | ); |
287 | 287 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
369 | 369 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
370 | 370 | // No more users allowed to join. |
371 | - header('Location: '.$bbbsession['logoutURL']); |
|
371 | + header('Location: ' . $bbbsession['logoutURL']); |
|
372 | 372 | return; |
373 | 373 | } |
374 | 374 | // Build the URL. |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
388 | 388 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
389 | 389 | // Execute the redirect. |
390 | - header('Location: '.$joinurl); |
|
390 | + header('Location: ' . $joinurl); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | /** |
@@ -399,13 +399,13 @@ discard block |
||
399 | 399 | */ |
400 | 400 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
401 | 401 | global $CFG, $OUTPUT; |
402 | - $errors = (array) json_decode(urldecode($serrors)); |
|
402 | + $errors = (array)json_decode(urldecode($serrors)); |
|
403 | 403 | $msgerrors = ''; |
404 | 404 | foreach ($errors as $error) { |
405 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
405 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
406 | 406 | } |
407 | 407 | echo $OUTPUT->header(); |
408 | 408 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
409 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
409 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
410 | 410 | echo $OUTPUT->footer(); |
411 | 411 | } |
@@ -77,8 +77,8 @@ |
||
77 | 77 | $body .= html_writer::start_tag('br'); |
78 | 78 | $body .= html_writer::tag('input', '', |
79 | 79 | array('type' => 'button', 'class' => 'btn btn-secondary', |
80 | - 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
|
81 | - 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
80 | + 'value' => get_string('view_recording_button_return', 'bigbluebuttonbn'), |
|
81 | + 'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$cm->id.'\'')); |
|
82 | 82 | // JavaScript for locales. |
83 | 83 | $PAGE->requires->strings_for_js(array_keys(bigbluebuttonbn_get_strings_for_js()), 'bigbluebuttonbn'); |
84 | 84 | // Require JavaScript modules. |
@@ -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)) { |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
210 | 210 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
211 | 211 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
212 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
213 | - ); |
|
212 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
213 | + ); |
|
214 | 214 | } else { |
215 | 215 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
216 | 216 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) { |
250 | 250 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
251 | - 'description_key' => null]; |
|
251 | + 'description_key' => null]; |
|
252 | 252 | if ($cfg['recordings_html_editable']) { |
253 | 253 | $field['type'] = 'checkbox'; |
254 | 254 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
257 | 257 | $field['description_key'], $cfg['recordings_html_default']); |
258 | 258 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
259 | - 'description_key' => null]; |
|
259 | + 'description_key' => null]; |
|
260 | 260 | if ($cfg['recordings_deleted_editable']) { |
261 | 261 | $field['type'] = 'checkbox'; |
262 | 262 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
265 | 265 | $field['description_key'], $cfg['recordings_deleted_default']); |
266 | 266 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
267 | - 'description_key' => null]; |
|
267 | + 'description_key' => null]; |
|
268 | 268 | if ($cfg['importrecordings_enabled'] && $cfg['recordings_imported_editable']) { |
269 | 269 | $field['type'] = 'checkbox'; |
270 | 270 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
273 | 273 | $field['description_key'], $cfg['recordings_imported_default']); |
274 | 274 | $field = ['type' => 'hidden', 'name' => 'recordings_preview', 'data_type' => PARAM_INT, |
275 | - 'description_key' => null]; |
|
275 | + 'description_key' => null]; |
|
276 | 276 | if ($cfg['recordings_preview_editable']) { |
277 | 277 | $field['type'] = 'checkbox'; |
278 | 278 | $field['description_key'] = 'mod_form_field_recordings_preview'; |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $htmlselectiontype = html_writer::select($participantselection['type_options'], |
343 | 343 | 'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(), |
344 | 344 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
345 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
345 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
346 | 346 | $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
347 | 347 | $participantselection['selected'], array(), |
348 | 348 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')); |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | 'type' => 'button', 'class' => 'btn btn-secondary', |
351 | 351 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
352 | 352 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;' |
353 | - )); |
|
353 | + )); |
|
354 | 354 | $htmladdparticipant = html_writer::tag('div', |
355 | 355 | $htmlselectiontype . ' ' . $htmlselectionoptions . ' ' . $htmlselectioninput, null); |
356 | 356 | $mform->addElement('html', "\n\n"); |
@@ -392,9 +392,9 @@ discard block |
||
392 | 392 | $field['type'] = 'select'; |
393 | 393 | $field['data_type'] = PARAM_TEXT; |
394 | 394 | $field['description_key'] = 'mod_form_field_block_clienttype'; |
395 | - $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
|
396 | - BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
397 | - $mform->addElement('header', 'clienttypeselection', get_string('mod_form_block_clienttype', 'bigbluebuttonbn')); |
|
395 | + $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'), |
|
396 | + BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn')); |
|
397 | + $mform->addElement('header', 'clienttypeselection', get_string('mod_form_block_clienttype', 'bigbluebuttonbn')); |
|
398 | 398 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
399 | 399 | $field['description_key'], $cfg['clienttype_default'], $choices); |
400 | 400 | return; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * recordings from a different activity even from a different course. |
99 | 99 | **/ |
100 | 100 | |
101 | - /* |
|
101 | + /* |
|
102 | 102 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
103 | 103 | * activities will have the 'import recordings' capability enabled. |
104 | 104 | * $CFG->bigbluebuttonbn['importrecordings_enabled'] = 0; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * 'Join session' button enabled |
120 | 120 | **/ |
121 | 121 | |
122 | - /* |
|
122 | + /* |
|
123 | 123 | * When the value is set to 1 (checked) the bigbluebuttonbn rooms or |
124 | 124 | * activities will have the 'wait for moderator' capability enabled by |
125 | 125 | * default. |
@@ -298,27 +298,27 @@ discard block |
||
298 | 298 | * $CFG->bigbluebuttonbn['general_warning_message'] = "Would you like to record your BigBlueButton sessions for later viewing? "; |
299 | 299 | */ |
300 | 300 | |
301 | - /* |
|
301 | + /* |
|
302 | 302 | * The warning box is always shown to administrators, but it is also possible to define other roles |
303 | 303 | * to whom the it will be shown. The roles are based on the shortnames defined by Moodle: |
304 | 304 | * 'manager,coursecreator,editingteacher,teacher,student,guest,user,frontpage' |
305 | 305 | * $CFG->bigbluebuttonbn['general_warning_roles'] = 'editingteacher,teacher'; |
306 | 306 | */ |
307 | 307 | |
308 | - /* |
|
308 | + /* |
|
309 | 309 | * As the general_warning_message is shown in a box, its type can be defined with general_warning_type |
310 | 310 | * The default type is 'info' which is normaly rendered in blue when using a bootstrap theme. |
311 | 311 | * All the modifiers for boxed in bootstrap can be used [info|success|warning|danger]. |
312 | 312 | * $CFG->bigbluebuttonbn['general_warning_box_type'] = 'info'; |
313 | 313 | */ |
314 | 314 | |
315 | - /* |
|
315 | + /* |
|
316 | 316 | * Additionally, when general_warning_button_href value is different than "", a button |
317 | 317 | * can also be shown right after the message. |
318 | 318 | * $CFG->bigbluebuttonbn['general_warning_button_href'] = "http://blindsidenetworks.com/"; |
319 | 319 | */ |
320 | 320 | |
321 | - /* |
|
321 | + /* |
|
322 | 322 | * Finally, the text and class for the button can be modified |
323 | 323 | * $CFG->bigbluebuttonbn['general_warning_button_text'] = "Upgrade your site"; |
324 | 324 | * $CFG->bigbluebuttonbn['general_warning_button_class'] = "btn btn-primary"; |