@@ -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']; |
@@ -62,91 +62,91 @@ |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | switch (strtolower($action)) { |
65 | - case 'logout': |
|
66 | - if (isset($errors) && $errors != '') { |
|
67 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
68 | - break; |
|
69 | - } |
|
70 | - if (is_null($bbbsession)) { |
|
71 | - bigbluebutton_bbb_view_close_window_manually(); |
|
72 | - break; |
|
73 | - } |
|
74 | - // Moodle event logger: Create an event for meeting left. |
|
75 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
76 | - // Update the cache. |
|
77 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
78 | - // Close the tab or window where BBB was opened. |
|
79 | - bigbluebutton_bbb_view_close_window(); |
|
80 | - break; |
|
81 | - case 'join': |
|
82 | - if (is_null($bbbsession)) { |
|
83 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
84 | - break; |
|
85 | - } |
|
86 | - // See if the session is in progress. |
|
87 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
88 | - // Since the meeting is already running, we just join the session. |
|
89 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
90 | - break; |
|
91 | - } |
|
92 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
93 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
94 | - header('Location: '.$bbbsession['logoutURL']); |
|
65 | + case 'logout': |
|
66 | + if (isset($errors) && $errors != '') { |
|
67 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
68 | + break; |
|
69 | + } |
|
70 | + if (is_null($bbbsession)) { |
|
71 | + bigbluebutton_bbb_view_close_window_manually(); |
|
72 | + break; |
|
73 | + } |
|
74 | + // Moodle event logger: Create an event for meeting left. |
|
75 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
76 | + // Update the cache. |
|
77 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
|
78 | + // Close the tab or window where BBB was opened. |
|
79 | + bigbluebutton_bbb_view_close_window(); |
|
95 | 80 | break; |
96 | - } |
|
97 | - // As the meeting doesn't exist, try to create it. |
|
98 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
99 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
100 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
101 | - $bbbsession['presentation']['name'], |
|
102 | - $bbbsession['presentation']['url'] |
|
103 | - ); |
|
104 | - if (empty($response)) { |
|
105 | - // The server is unreachable. |
|
106 | - if ($bbbsession['administrator']) { |
|
107 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
108 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
81 | + case 'join': |
|
82 | + if (is_null($bbbsession)) { |
|
83 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
84 | + break; |
|
85 | + } |
|
86 | + // See if the session is in progress. |
|
87 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
88 | + // Since the meeting is already running, we just join the session. |
|
89 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
109 | 90 | break; |
110 | 91 | } |
111 | - if ($bbbsession['moderator']) { |
|
112 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
92 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
93 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
94 | + header('Location: '.$bbbsession['logoutURL']); |
|
95 | + break; |
|
96 | + } |
|
97 | + // As the meeting doesn't exist, try to create it. |
|
98 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
99 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
100 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
101 | + $bbbsession['presentation']['name'], |
|
102 | + $bbbsession['presentation']['url'] |
|
103 | + ); |
|
104 | + if (empty($response)) { |
|
105 | + // The server is unreachable. |
|
106 | + if ($bbbsession['administrator']) { |
|
107 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
108 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
109 | + break; |
|
110 | + } |
|
111 | + if ($bbbsession['moderator']) { |
|
112 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
113 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
114 | + break; |
|
115 | + } |
|
116 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
113 | 117 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
114 | 118 | break; |
115 | 119 | } |
116 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
117 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
118 | - break; |
|
119 | - } |
|
120 | - if ($response['returncode'] == 'FAILED') { |
|
121 | - // The meeting was not created. |
|
122 | - if (!$printerrorkey) { |
|
123 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
120 | + if ($response['returncode'] == 'FAILED') { |
|
121 | + // The meeting was not created. |
|
122 | + if (!$printerrorkey) { |
|
123 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
124 | + break; |
|
125 | + } |
|
126 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
127 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
128 | + break; |
|
129 | + } |
|
130 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
131 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
124 | 132 | break; |
125 | 133 | } |
126 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
127 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
134 | + // Moodle event logger: Create an event for meeting created. |
|
135 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
136 | + // Internal logger: Insert a record with the meeting created. |
|
137 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
138 | + // Since the meeting is already running, we just join the session. |
|
139 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
128 | 140 | break; |
129 | - } |
|
130 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
131 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
141 | + case 'play': |
|
142 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
143 | + // Moodle event logger: Create an event for meeting left. |
|
144 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
145 | + // Execute the redirect. |
|
146 | + header('Location: '.urldecode($href)); |
|
132 | 147 | break; |
133 | - } |
|
134 | - // Moodle event logger: Create an event for meeting created. |
|
135 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
136 | - // Internal logger: Insert a record with the meeting created. |
|
137 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
138 | - // Since the meeting is already running, we just join the session. |
|
139 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
140 | - break; |
|
141 | - case 'play': |
|
142 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
143 | - // Moodle event logger: Create an event for meeting left. |
|
144 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
145 | - // Execute the redirect. |
|
146 | - header('Location: '.urldecode($href)); |
|
147 | - break; |
|
148 | - default: |
|
149 | - bigbluebutton_bbb_view_close_window(); |
|
148 | + default: |
|
149 | + bigbluebutton_bbb_view_close_window(); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -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 | } |
@@ -366,26 +366,26 @@ discard block |
||
366 | 366 | return array( |
367 | 367 | 'status' => false, |
368 | 368 | 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn') |
369 | - ); |
|
369 | + ); |
|
370 | 370 | } |
371 | 371 | if ($realrecordings[$params['id']]['published'] !== 'true') { |
372 | 372 | return array( |
373 | 373 | 'status' => false, |
374 | 374 | 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn') |
375 | - ); |
|
375 | + ); |
|
376 | 376 | } |
377 | 377 | return array( |
378 | 378 | 'status' => bigbluebuttonbn_publish_recording_imported( |
379 | 379 | $recordings[$params['id']]['imported'], true |
380 | 380 | ) |
381 | - ); |
|
381 | + ); |
|
382 | 382 | } |
383 | 383 | // As the recordingid was not identified as imported recording link, execute actual publish. |
384 | 384 | return array( |
385 | 385 | 'status' => bigbluebuttonbn_publish_recordings( |
386 | 386 | $params['id'], 'true' |
387 | 387 | ) |
388 | - ); |
|
388 | + ); |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | /** |
@@ -401,26 +401,26 @@ discard block |
||
401 | 401 | return array( |
402 | 402 | 'status' => false, |
403 | 403 | 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn') |
404 | - ); |
|
404 | + ); |
|
405 | 405 | } |
406 | 406 | if ($realrecordings[$params['id']]['protected'] === 'true') { |
407 | 407 | return array( |
408 | 408 | 'status' => false, |
409 | 409 | 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn') |
410 | - ); |
|
410 | + ); |
|
411 | 411 | } |
412 | 412 | return array( |
413 | 413 | 'status' => bigbluebuttonbn_protect_recording_imported( |
414 | 414 | $recordings[$params['id']]['imported'], false |
415 | 415 | ) |
416 | - ); |
|
416 | + ); |
|
417 | 417 | } |
418 | 418 | // As the recordingid was not identified as imported recording link, execute actual uprotect. |
419 | 419 | return array( |
420 | 420 | 'status' => bigbluebuttonbn_update_recordings( |
421 | 421 | $params['id'], array('protect' => 'false') |
422 | 422 | ) |
423 | - ); |
|
423 | + ); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | /** |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | 'status' => bigbluebuttonbn_publish_recording_imported( |
435 | 435 | $recordings[$params['id']]['imported'], false |
436 | 436 | ) |
437 | - ); |
|
437 | + ); |
|
438 | 438 | } |
439 | 439 | // As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
440 | 440 | // First: Unpublish imported links associated to the recording. |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | 'status' => bigbluebuttonbn_publish_recordings( |
453 | 453 | $params['id'], 'false' |
454 | 454 | ) |
455 | - ); |
|
455 | + ); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | /** |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | 'status' => bigbluebuttonbn_protect_recording_imported( |
467 | 467 | $recordings[$params['id']]['imported'], true |
468 | 468 | ) |
469 | - ); |
|
469 | + ); |
|
470 | 470 | } |
471 | 471 | // As the recordingid was not identified as imported recording link, execute protect on a real recording. |
472 | 472 | // First: Protect imported links associated to the recording. |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | 'status' => bigbluebuttonbn_update_recordings( |
485 | 485 | $params['id'], array('protect' => 'true') |
486 | 486 | ) |
487 | - ); |
|
487 | + ); |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | /** |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | 'status' => bigbluebuttonbn_delete_recording_imported( |
499 | 499 | $recordings[$params['id']]['imported'] |
500 | 500 | ) |
501 | - ); |
|
501 | + ); |
|
502 | 502 | } |
503 | 503 | // As the recordingid was not identified as imported recording link, execute delete on a real recording. |
504 | 504 | // First: Delete imported links associated to the recording. |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | 'status' => bigbluebuttonbn_delete_recordings( |
515 | 515 | $params['id'] |
516 | 516 | ) |
517 | - ); |
|
517 | + ); |
|
518 | 518 | } |
519 | 519 | |
520 | 520 | /** |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | 'status' => bigbluebuttonbn_update_recording_imported( |
528 | 528 | $recordings[$params['id']]['imported'], json_decode($params['meta'], true) |
529 | 529 | ) |
530 | - ); |
|
530 | + ); |
|
531 | 531 | } |
532 | 532 | |
533 | 533 | // As the recordingid was not identified as imported recording link, execute update on a real recording. |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | 'status' => bigbluebuttonbn_update_recordings( |
538 | 538 | $params['id'], json_decode($params['meta']) |
539 | 539 | ) |
540 | - ); |
|
540 | + ); |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | /** |
@@ -682,10 +682,10 @@ discard block |
||
682 | 682 | $params['recording_import'] = ['id' => 'The recordingID must be specified.']; |
683 | 683 | $params['recording_ready'] = [ |
684 | 684 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
685 | - ]; |
|
685 | + ]; |
|
686 | 686 | $params['live_session_events'] = [ |
687 | 687 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
688 | - ]; |
|
688 | + ]; |
|
689 | 689 | return $params; |
690 | 690 | } |
691 | 691 |
@@ -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 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @uses FEATURE_GRADE_OUTCOMES |
98 | 98 | * @uses FEATURE_SHOW_DESCRIPTION |
99 | 99 | * @param string $feature |
100 | - * @return mixed True if yes (some features may use other values) |
|
100 | + * @return null|boolean True if yes (some features may use other values) |
|
101 | 101 | */ |
102 | 102 | function bigbluebuttonbn_supports($feature) { |
103 | 103 | if (!$feature) { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | * @param object $mod |
240 | 240 | * @param object $bigbluebuttonbn |
241 | 241 | * |
242 | - * @return bool |
|
242 | + * @return string |
|
243 | 243 | */ |
244 | 244 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
245 | 245 | global $DB; |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | * @param stdClass $context context object |
543 | 543 | * @param string $filearea file area |
544 | 544 | * |
545 | - * @return false|null false if file not valid |
|
545 | + * @return boolean false if file not valid |
|
546 | 546 | */ |
547 | 547 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
548 | 548 | if ($context->contextlevel != CONTEXT_MODULE) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * Remove this block when restored |
69 | 69 | */ |
70 | 70 | |
71 | - /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
71 | + /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
72 | 72 | const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/'; |
73 | 73 | /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */ |
74 | 74 | const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6'; |
@@ -345,12 +345,12 @@ discard block |
||
345 | 345 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
346 | 346 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
347 | 347 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
348 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
348 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
349 | 349 | $str .= ' </div>'."\n"; |
350 | 350 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
351 | 351 | '</div>'."\n"; |
352 | 352 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
353 | - .'</div>'."\n"; |
|
353 | + .'</div>'."\n"; |
|
354 | 354 | $str .= '</div>'."\n"; |
355 | 355 | return $str; |
356 | 356 | } |
@@ -28,33 +28,33 @@ discard block |
||
28 | 28 | |
29 | 29 | global $CFG; |
30 | 30 | |
31 | -require_once($CFG->dirroot.'/calendar/lib.php'); |
|
32 | -require_once($CFG->dirroot.'/message/lib.php'); |
|
33 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php'); |
|
34 | -require_once($CFG->dirroot.'/tag/lib.php'); |
|
35 | -require_once($CFG->libdir.'/accesslib.php'); |
|
36 | -require_once($CFG->libdir.'/completionlib.php'); |
|
37 | -require_once($CFG->libdir.'/datalib.php'); |
|
38 | -require_once($CFG->libdir.'/coursecatlib.php'); |
|
39 | -require_once($CFG->libdir.'/enrollib.php'); |
|
40 | -require_once($CFG->libdir.'/filelib.php'); |
|
41 | -require_once($CFG->libdir.'/formslib.php'); |
|
42 | - |
|
43 | - |
|
44 | -if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
45 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'); |
|
31 | +require_once($CFG->dirroot . '/calendar/lib.php'); |
|
32 | +require_once($CFG->dirroot . '/message/lib.php'); |
|
33 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php'); |
|
34 | +require_once($CFG->dirroot . '/tag/lib.php'); |
|
35 | +require_once($CFG->libdir . '/accesslib.php'); |
|
36 | +require_once($CFG->libdir . '/completionlib.php'); |
|
37 | +require_once($CFG->libdir . '/datalib.php'); |
|
38 | +require_once($CFG->libdir . '/coursecatlib.php'); |
|
39 | +require_once($CFG->libdir . '/enrollib.php'); |
|
40 | +require_once($CFG->libdir . '/filelib.php'); |
|
41 | +require_once($CFG->libdir . '/formslib.php'); |
|
42 | + |
|
43 | + |
|
44 | +if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { |
|
45 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | if (!isset($CFG->bigbluebuttonbn)) { |
49 | 49 | $CFG->bigbluebuttonbn = array(); |
50 | 50 | } |
51 | 51 | |
52 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
53 | - require_once(dirname(__FILE__).'/config.php'); |
|
52 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
53 | + require_once(dirname(__FILE__) . '/config.php'); |
|
54 | 54 | // Old BigBlueButtonBN cfg schema. For backward compatibility. |
55 | 55 | global $BIGBLUEBUTTONBN_CFG; |
56 | 56 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
57 | - foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
57 | + foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
58 | 58 | $cfgkey = str_replace("bigbluebuttonbn_", "", $key); |
59 | 59 | $CFG->bigbluebuttonbn[$cfgkey] = $value; |
60 | 60 | } |
@@ -105,18 +105,18 @@ discard block |
||
105 | 105 | return null; |
106 | 106 | } |
107 | 107 | $features = array( |
108 | - (string) FEATURE_IDNUMBER => true, |
|
109 | - (string) FEATURE_GROUPS => true, |
|
110 | - (string) FEATURE_GROUPINGS => true, |
|
111 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
112 | - (string) FEATURE_MOD_INTRO => true, |
|
113 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
114 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
115 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
116 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
117 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
108 | + (string)FEATURE_IDNUMBER => true, |
|
109 | + (string)FEATURE_GROUPS => true, |
|
110 | + (string)FEATURE_GROUPINGS => true, |
|
111 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
112 | + (string)FEATURE_MOD_INTRO => true, |
|
113 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
114 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
115 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
116 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
117 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
118 | 118 | ); |
119 | - if (isset($features[(string) $feature])) { |
|
119 | + if (isset($features[(string)$feature])) { |
|
120 | 120 | return $features[$feature]; |
121 | 121 | } |
122 | 122 | return null; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $log->timecreated = time(); |
217 | 217 | $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE; |
218 | 218 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
219 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
219 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
220 | 220 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
221 | 221 | $log->meta = "{\"has_recordings\":false}"; |
222 | 222 | if (!empty($logs)) { |
@@ -245,10 +245,10 @@ discard block |
||
245 | 245 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
246 | 246 | global $DB; |
247 | 247 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
248 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
248 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
249 | 249 | if ($completed > 0) { |
250 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
251 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
250 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
251 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
252 | 252 | get_string('view_message_times', 'bigbluebuttonbn'); |
253 | 253 | } |
254 | 254 | return ''; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
269 | 269 | global $DB; |
270 | 270 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
271 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
271 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
272 | 272 | '*', IGNORE_MULTIPLE); |
273 | 273 | return $completed > 0; |
274 | 274 | } |
@@ -343,16 +343,16 @@ discard block |
||
343 | 343 | if ($bigbluebuttonbn->visible) { |
344 | 344 | $classes = 'class="dimmed" '; |
345 | 345 | } |
346 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
347 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
348 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
349 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
350 | - $str .= ' </div>'."\n"; |
|
351 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
352 | - '</div>'."\n"; |
|
353 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
354 | - .'</div>'."\n"; |
|
355 | - $str .= '</div>'."\n"; |
|
346 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
347 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
348 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
349 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
350 | + $str .= ' </div>' . "\n"; |
|
351 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
352 | + '</div>' . "\n"; |
|
353 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
354 | + .'</div>' . "\n"; |
|
355 | + $str .= '</div>' . "\n"; |
|
356 | 356 | return $str; |
357 | 357 | } |
358 | 358 | |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | if (count($files) == 1) { |
548 | 548 | // Get the first (and only) file. |
549 | 549 | $file = reset($files); |
550 | - $filesrc = '/'.$file->get_filename(); |
|
550 | + $filesrc = '/' . $file->get_filename(); |
|
551 | 551 | } |
552 | 552 | return $filesrc; |
553 | 553 | } |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | if (!$filename) { |
616 | 616 | return false; |
617 | 617 | } |
618 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
618 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
619 | 619 | $fs = get_file_storage(); |
620 | 620 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
621 | 621 | if (!$file || $file->is_directory()) { |
@@ -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)) { |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
214 | 214 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6], |
215 | 215 | ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'), |
216 | - 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
217 | - ); |
|
216 | + 'type' => 'numeric', 'rule' => '####', 'validator' => 'server'] |
|
217 | + ); |
|
218 | 218 | } else { |
219 | 219 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
220 | 220 | $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) { |
254 | 254 | $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT, |
255 | - 'description_key' => null]; |
|
255 | + 'description_key' => null]; |
|
256 | 256 | if ($cfg['recordings_html_editable']) { |
257 | 257 | $field['type'] = 'checkbox'; |
258 | 258 | $field['description_key'] = 'mod_form_field_recordings_html'; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
261 | 261 | $field['description_key'], $cfg['recordings_html_default']); |
262 | 262 | $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT, |
263 | - 'description_key' => null]; |
|
263 | + 'description_key' => null]; |
|
264 | 264 | if ($cfg['recordings_deleted_editable']) { |
265 | 265 | $field['type'] = 'checkbox'; |
266 | 266 | $field['description_key'] = 'mod_form_field_recordings_deleted'; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
269 | 269 | $field['description_key'], $cfg['recordings_deleted_default']); |
270 | 270 | $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT, |
271 | - 'description_key' => null]; |
|
271 | + 'description_key' => null]; |
|
272 | 272 | if ($cfg['recordings_imported_editable']) { |
273 | 273 | $field['type'] = 'checkbox'; |
274 | 274 | $field['description_key'] = 'mod_form_field_recordings_imported'; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'], |
277 | 277 | $field['description_key'], $cfg['recordings_imported_default']); |
278 | 278 | $field = ['type' => 'hidden', 'name' => 'recordings_preview', 'data_type' => PARAM_INT, |
279 | - 'description_key' => null]; |
|
279 | + 'description_key' => null]; |
|
280 | 280 | if ($cfg['recordings_preview_editable']) { |
281 | 281 | $field['type'] = 'checkbox'; |
282 | 282 | $field['description_key'] = 'mod_form_field_recordings_preview'; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $htmlselectiontype = html_writer::select($participantselection['type_options'], |
348 | 348 | 'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(), |
349 | 349 | array('id' => 'bigbluebuttonbn_participant_selection_type', |
350 | - 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
350 | + 'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;')); |
|
351 | 351 | $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection', |
352 | 352 | $participantselection['selected'], array(), |
353 | 353 | array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | 'type' => 'button', 'class' => 'btn btn-secondary', |
356 | 356 | 'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'), |
357 | 357 | 'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;' |
358 | - )); |
|
358 | + )); |
|
359 | 359 | $htmladdparticipant = html_writer::tag('div', |
360 | 360 | $htmlselectiontype . ' ' . $htmlselectionoptions . ' ' . $htmlselectioninput, null); |
361 | 361 | $mform->addElement('html', "\n\n"); |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public static function defaultvalues() { |
57 | 57 | return array( |
58 | - 'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
59 | - 'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
58 | + 'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL, |
|
59 | + 'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET, |
|
60 | 60 | 'voicebridge_editable' => 'false', |
61 | 61 | 'importrecordings_enabled' => 'false', |
62 | 62 | 'importrecordings_from_deleted_enabled' => 'false', |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | if (isset($CFG->bigbluebuttonbn[$setting])) { |
120 | 120 | return (string)$CFG->bigbluebuttonbn[$setting]; |
121 | 121 | } |
122 | - if (isset($CFG->{'bigbluebuttonbn_'.$setting})) { |
|
123 | - return (string)$CFG->{'bigbluebuttonbn_'.$setting}; |
|
122 | + if (isset($CFG->{'bigbluebuttonbn_' . $setting})) { |
|
123 | + return (string)$CFG->{'bigbluebuttonbn_' . $setting}; |
|
124 | 124 | } |
125 | 125 | return self::defaultvalue($setting); |
126 | 126 | } |
@@ -152,31 +152,31 @@ |
||
152 | 152 | */ |
153 | 153 | public static function get_options() { |
154 | 154 | return array( |
155 | - 'version_major' => self::get_moodle_version_major(), |
|
156 | - 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
157 | - 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
158 | - 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
159 | - 'userlimit_default' => self::get('userlimit_default'), |
|
160 | - 'userlimit_editable' => self::get('userlimit_editable'), |
|
161 | - 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
162 | - 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
163 | - 'recordings_enabled' => self::get('recordings_enabled'), |
|
164 | - 'recordings_html_default' => self::get('recordings_html_default'), |
|
165 | - 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
166 | - 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
167 | - 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
168 | - 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
169 | - 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
170 | - 'recordings_preview_default' => self::get('recordings_preview_default'), |
|
171 | - 'recordings_preview_editable' => self::get('recordings_preview_editable'), |
|
172 | - 'recording_default' => self::get('recording_default'), |
|
173 | - 'recording_editable' => self::get('recording_editable'), |
|
174 | - 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
175 | - 'general_warning_message' => self::get('general_warning_message'), |
|
176 | - 'general_warning_box_type' => self::get('general_warning_box_type'), |
|
177 | - 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
178 | - 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
179 | - 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
180 | - ); |
|
155 | + 'version_major' => self::get_moodle_version_major(), |
|
156 | + 'voicebridge_editable' => self::get('voicebridge_editable'), |
|
157 | + 'waitformoderator_default' => self::get('waitformoderator_default'), |
|
158 | + 'waitformoderator_editable' => self::get('waitformoderator_editable'), |
|
159 | + 'userlimit_default' => self::get('userlimit_default'), |
|
160 | + 'userlimit_editable' => self::get('userlimit_editable'), |
|
161 | + 'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'), |
|
162 | + 'sendnotifications_enabled' => self::get('sendnotifications_enabled'), |
|
163 | + 'recordings_enabled' => self::get('recordings_enabled'), |
|
164 | + 'recordings_html_default' => self::get('recordings_html_default'), |
|
165 | + 'recordings_html_editable' => self::get('recordings_html_editable'), |
|
166 | + 'recordings_deleted_default' => self::get('recordings_deleted_default'), |
|
167 | + 'recordings_deleted_editable' => self::get('recordings_deleted_editable'), |
|
168 | + 'recordings_imported_default' => self::get('recordings_imported_default'), |
|
169 | + 'recordings_imported_editable' => self::get('recordings_imported_editable'), |
|
170 | + 'recordings_preview_default' => self::get('recordings_preview_default'), |
|
171 | + 'recordings_preview_editable' => self::get('recordings_preview_editable'), |
|
172 | + 'recording_default' => self::get('recording_default'), |
|
173 | + 'recording_editable' => self::get('recording_editable'), |
|
174 | + 'recording_icons_enabled' => self::get('recording_icons_enabled'), |
|
175 | + 'general_warning_message' => self::get('general_warning_message'), |
|
176 | + 'general_warning_box_type' => self::get('general_warning_box_type'), |
|
177 | + 'general_warning_button_text' => self::get('general_warning_button_text'), |
|
178 | + 'general_warning_button_href' => self::get('general_warning_button_href'), |
|
179 | + 'general_warning_button_class' => self::get('general_warning_button_class'), |
|
180 | + ); |
|
181 | 181 | } |
182 | 182 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * Helper function to retrieve imported recordings from the Moodle database. |
294 | 294 | * The references are stored as events in bigbluebuttonbn_logs. |
295 | 295 | * |
296 | - * @param string $courseid |
|
296 | + * @param integer $courseid |
|
297 | 297 | * @param string $bigbluebuttonbnid |
298 | 298 | * @param bool $subset |
299 | 299 | * |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | /** |
322 | 322 | * Helper function to retrive the default config.xml file. |
323 | 323 | * |
324 | - * @return string |
|
324 | + * @return null|SimpleXMLElement |
|
325 | 325 | */ |
326 | 326 | function bigbluebuttonbn_get_default_config_xml() { |
327 | 327 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | * @param object $a |
404 | 404 | * @param object $b |
405 | 405 | * |
406 | - * @return array |
|
406 | + * @return integer |
|
407 | 407 | */ |
408 | 408 | function bigbluebuttonbn_recording_build_sorter($a, $b) { |
409 | 409 | if ($a['startTime'] < $b['startTime']) { |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | * @param string $data |
530 | 530 | * @param string $contenttype |
531 | 531 | * |
532 | - * @return object |
|
532 | + * @return null|SimpleXMLElement |
|
533 | 533 | */ |
534 | 534 | function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
535 | 535 | if (extension_loaded('curl')) { |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | * @param string $data |
571 | 571 | * @param string $contenttype |
572 | 572 | * |
573 | - * @return object |
|
573 | + * @return string |
|
574 | 574 | */ |
575 | 575 | function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') { |
576 | 576 | $c = new curl(); |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | * |
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; |
@@ -1037,7 +1037,7 @@ discard block |
||
1037 | 1037 | /** |
1038 | 1038 | * Helper returns an array with all possible bigbluebuttonbn events. |
1039 | 1039 | * |
1040 | - * @return array |
|
1040 | + * @return string[] |
|
1041 | 1041 | */ |
1042 | 1042 | function bigbluebuttonbn_events() { |
1043 | 1043 | return array( |
@@ -1246,7 +1246,7 @@ discard block |
||
1246 | 1246 | * @param string $meetingid |
1247 | 1247 | * @param string $configxml |
1248 | 1248 | * |
1249 | - * @return object |
|
1249 | + * @return null|SimpleXMLElement |
|
1250 | 1250 | */ |
1251 | 1251 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1252 | 1252 | $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
@@ -1295,7 +1295,7 @@ discard block |
||
1295 | 1295 | * @param array $recording |
1296 | 1296 | * @param array $tools |
1297 | 1297 | * |
1298 | - * @return array |
|
1298 | + * @return null|stdClass |
|
1299 | 1299 | */ |
1300 | 1300 | function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) { |
1301 | 1301 | if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) { |
@@ -1799,7 +1799,7 @@ discard block |
||
1799 | 1799 | * |
1800 | 1800 | * @param array $bbbsession |
1801 | 1801 | * @param array $recording |
1802 | - * @param object $rowdata |
|
1802 | + * @param stdClass $rowdata |
|
1803 | 1803 | * |
1804 | 1804 | * @return object |
1805 | 1805 | */ |
@@ -1998,7 +1998,7 @@ discard block |
||
1998 | 1998 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
1999 | 1999 | * in the getRecordings request considering only those that belong to deleted activities. |
2000 | 2000 | * |
2001 | - * @param string $courseid |
|
2001 | + * @param integer $courseid |
|
2002 | 2002 | * @param string $bigbluebuttonbnid |
2003 | 2003 | * @param bool $subset |
2004 | 2004 | * |
@@ -2022,7 +2022,7 @@ discard block |
||
2022 | 2022 | * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included |
2023 | 2023 | * in the getRecordings request considering only those that belong to imported recordings. |
2024 | 2024 | * |
2025 | - * @param string $courseid |
|
2025 | + * @param integer $courseid |
|
2026 | 2026 | * @param string $bigbluebuttonbnid |
2027 | 2027 | * @param bool $subset |
2028 | 2028 | * |
@@ -2045,7 +2045,7 @@ discard block |
||
2045 | 2045 | /** |
2046 | 2046 | * Helper function to get recordings and imported recordings together. |
2047 | 2047 | * |
2048 | - * @param string $courseid |
|
2048 | + * @param integer $courseid |
|
2049 | 2049 | * @param string $bigbluebuttonbnid |
2050 | 2050 | * @param bool $subset |
2051 | 2051 | * @param bool $includedeleted |
@@ -2063,7 +2063,7 @@ discard block |
||
2063 | 2063 | * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events |
2064 | 2064 | * in bigbluebuttonbn_logs. |
2065 | 2065 | * |
2066 | - * @param string $courseid |
|
2066 | + * @param integer $courseid |
|
2067 | 2067 | * @param string $bigbluebuttonbnid |
2068 | 2068 | * @param bool $subset |
2069 | 2069 | * @param bool $includedeleted |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) { |
121 | 121 | $data = ['meetingID' => $meetingid, |
122 | - 'fullName' => $username, |
|
123 | - 'password' => $pw, |
|
124 | - 'logoutURL' => $logouturl, |
|
122 | + 'fullName' => $username, |
|
123 | + 'password' => $pw, |
|
124 | + 'logoutURL' => $logouturl, |
|
125 | 125 | ]; |
126 | 126 | if (!is_null($configtoken)) { |
127 | 127 | $data['configToken'] = $configtoken; |
@@ -173,23 +173,23 @@ discard block |
||
173 | 173 | function bigbluebuttonbn_get_meeting_info_array($meetingid) { |
174 | 174 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
175 | 175 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
176 | - ); |
|
176 | + ); |
|
177 | 177 | if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) { |
178 | 178 | // Meeting info was returned. |
179 | 179 | return array('returncode' => $xml->returncode, |
180 | - 'meetingID' => $xml->meetingID, |
|
181 | - 'moderatorPW' => $xml->moderatorPW, |
|
182 | - 'attendeePW' => $xml->attendeePW, |
|
183 | - 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
184 | - 'running' => $xml->running, |
|
185 | - 'recording' => $xml->recording, |
|
186 | - 'startTime' => $xml->startTime, |
|
187 | - 'endTime' => $xml->endTime, |
|
188 | - 'participantCount' => $xml->participantCount, |
|
189 | - 'moderatorCount' => $xml->moderatorCount, |
|
190 | - 'attendees' => $xml->attendees, |
|
191 | - 'metadata' => $xml->metadata, |
|
192 | - ); |
|
180 | + 'meetingID' => $xml->meetingID, |
|
181 | + 'moderatorPW' => $xml->moderatorPW, |
|
182 | + 'attendeePW' => $xml->attendeePW, |
|
183 | + 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, |
|
184 | + 'running' => $xml->running, |
|
185 | + 'recording' => $xml->recording, |
|
186 | + 'startTime' => $xml->startTime, |
|
187 | + 'endTime' => $xml->endTime, |
|
188 | + 'participantCount' => $xml->participantCount, |
|
189 | + 'moderatorCount' => $xml->moderatorCount, |
|
190 | + 'attendees' => $xml->attendees, |
|
191 | + 'metadata' => $xml->metadata, |
|
192 | + ); |
|
193 | 193 | } |
194 | 194 | if ($xml) { |
195 | 195 | // Either failure or success without meeting info. |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | function bigbluebuttonbn_get_default_config_xml() { |
326 | 326 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
327 | 327 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML') |
328 | - ); |
|
328 | + ); |
|
329 | 329 | return $xml; |
330 | 330 | } |
331 | 331 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | foreach ($ids as $id) { |
427 | 427 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
428 | 428 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id]) |
429 | - ); |
|
429 | + ); |
|
430 | 430 | if ($xml && $xml->returncode != 'SUCCESS') { |
431 | 431 | return false; |
432 | 432 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | foreach ($ids as $id) { |
446 | 446 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
447 | 447 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish]) |
448 | - ); |
|
448 | + ); |
|
449 | 449 | if ($xml && $xml->returncode != 'SUCCESS') { |
450 | 450 | return false; |
451 | 451 | } |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | foreach ($ids as $id) { |
465 | 465 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
466 | 466 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
467 | - ); |
|
467 | + ); |
|
468 | 468 | if ($xml && $xml->returncode != 'SUCCESS') { |
469 | 469 | return false; |
470 | 470 | } |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | function bigbluebuttonbn_end_meeting($meetingid, $modpw) { |
482 | 482 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
483 | 483 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw]) |
484 | - ); |
|
484 | + ); |
|
485 | 485 | if ($xml) { |
486 | 486 | // If the xml packet returned failure it displays the message to the user. |
487 | 487 | return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | */ |
502 | 502 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
503 | 503 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
504 | - ); |
|
504 | + ); |
|
505 | 505 | return ($xml && $xml->returncode == 'SUCCESS'); |
506 | 506 | } |
507 | 507 | |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | function bigbluebuttonbn_get_server_version() { |
514 | 514 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
515 | 515 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url() |
516 | - ); |
|
516 | + ); |
|
517 | 517 | if ($xml && $xml->returncode == 'SUCCESS') { |
518 | 518 | return $xml->version; |
519 | 519 | } |
@@ -581,10 +581,10 @@ discard block |
||
581 | 581 | |
582 | 582 | $options = array(); |
583 | 583 | $options['CURLOPT_HTTPHEADER'] = array( |
584 | - 'Content-Type: '.$contenttype, |
|
585 | - 'Content-Length: '.strlen($data), |
|
586 | - 'Content-Language: en-US', |
|
587 | - ); |
|
584 | + 'Content-Type: '.$contenttype, |
|
585 | + 'Content-Length: '.strlen($data), |
|
586 | + 'Content-Language: en-US', |
|
587 | + ); |
|
588 | 588 | |
589 | 589 | return $c->post($url, $data, $options); |
590 | 590 | } |
@@ -727,16 +727,16 @@ discard block |
||
727 | 727 | 'all' => array( |
728 | 728 | 'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
729 | 729 | 'children' => [] |
730 | - ) |
|
731 | - ); |
|
730 | + ) |
|
731 | + ); |
|
732 | 732 | $data['role'] = array( |
733 | 733 | 'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
734 | 734 | 'children' => bigbluebuttonbn_get_roles_select($context) |
735 | - ); |
|
735 | + ); |
|
736 | 736 | $data['user'] = array( |
737 | 737 | 'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
738 | 738 | 'children' => bigbluebuttonbn_get_users_select($context) |
739 | - ); |
|
739 | + ); |
|
740 | 740 | return $data; |
741 | 741 | } |
742 | 742 | |
@@ -781,9 +781,9 @@ discard block |
||
781 | 781 | continue; |
782 | 782 | } |
783 | 783 | $participantlistarray[] = array( |
784 | - 'selectiontype' => 'role', |
|
785 | - 'selectionid' => $moderatordefault, |
|
786 | - 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
784 | + 'selectiontype' => 'role', |
|
785 | + 'selectionid' => $moderatordefault, |
|
786 | + 'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR); |
|
787 | 787 | } |
788 | 788 | return $participantlistarray; |
789 | 789 | } |
@@ -826,11 +826,11 @@ discard block |
||
826 | 826 | 'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'), |
827 | 827 | 'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'), |
828 | 828 | 'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'), |
829 | - ], |
|
829 | + ], |
|
830 | 830 | 'type_selected' => 'all', |
831 | 831 | 'options' => ['all' => '---------------'], |
832 | 832 | 'selected' => 'all', |
833 | - ]; |
|
833 | + ]; |
|
834 | 834 | } |
835 | 835 | |
836 | 836 | /** |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | $eventproperties['other'] = $options['other']; |
1112 | 1112 | } |
1113 | 1113 | $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
1114 | - array($eventproperties)); |
|
1114 | + array($eventproperties)); |
|
1115 | 1115 | $event->trigger(); |
1116 | 1116 | } |
1117 | 1117 | |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | // Ping again and refresh the cache. |
1156 | 1156 | $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
1157 | 1157 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1158 | - ); |
|
1158 | + ); |
|
1159 | 1159 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
1160 | 1160 | return $meetinginfo; |
1161 | 1161 | } |
@@ -1525,8 +1525,8 @@ discard block |
||
1525 | 1525 | } |
1526 | 1526 | $id = 'playbacks-'.$recording['recordID']; |
1527 | 1527 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1528 | - 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1529 | - 'title' => $title, $visibility => $visibility)); |
|
1528 | + 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
|
1529 | + 'title' => $title, $visibility => $visibility)); |
|
1530 | 1530 | foreach ($recording['playbacks'] as $playback) { |
1531 | 1531 | $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback); |
1532 | 1532 | } |
@@ -1551,7 +1551,7 @@ discard block |
||
1551 | 1551 | $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
1552 | 1552 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
1553 | 1553 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1554 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1554 | + '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1555 | 1555 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1556 | 1556 | $href .= '&href='.urlencode(trim($playback['url'])); |
1557 | 1557 | } |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | 'data-target' => $playback['type'], |
1564 | 1564 | 'data-href' => $href, |
1565 | 1565 | 'class' => 'btn btn-sm btn-default' |
1566 | - ); |
|
1566 | + ); |
|
1567 | 1567 | return $OUTPUT->action_link('#', $title, null, $linkattributes) . ' '; |
1568 | 1568 | } |
1569 | 1569 | |
@@ -1677,10 +1677,10 @@ discard block |
||
1677 | 1677 | 'id' => $id, |
1678 | 1678 | 'onclick' => $onclick, |
1679 | 1679 | 'data-action' => $data['action'] |
1680 | - ); |
|
1680 | + ); |
|
1681 | 1681 | if (!isset($recording['imported'])) { |
1682 | 1682 | $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances( |
1683 | - $recording['recordID']); |
|
1683 | + $recording['recordID']); |
|
1684 | 1684 | } |
1685 | 1685 | if (isset($data['disabled'])) { |
1686 | 1686 | $iconattributes['class'] .= ' fa-' . $data['disabled']; |
@@ -2225,8 +2225,8 @@ discard block |
||
2225 | 2225 | $activitytime = ''; |
2226 | 2226 | if ($time) { |
2227 | 2227 | $activitytime = calendar_day_representation($time).' '. |
2228 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2229 | - calendar_time_representation($time); |
|
2228 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2229 | + calendar_time_representation($time); |
|
2230 | 2230 | } |
2231 | 2231 | return $activitytime; |
2232 | 2232 | } |
@@ -2322,7 +2322,7 @@ discard block |
||
2322 | 2322 | global $BIGBLUEBUTTONBN_CFG; |
2323 | 2323 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
2324 | 2324 | $renderer->render_warning_message('general_warning', |
2325 | - get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn')); |
|
2325 | + get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn')); |
|
2326 | 2326 | } |
2327 | 2327 | } |
2328 | 2328 | |
@@ -2530,7 +2530,7 @@ discard block |
||
2530 | 2530 | $renderer->render_group_element('participant_moderator_default', |
2531 | 2531 | $renderer->render_group_element_configmultiselect('participant_moderator_default', |
2532 | 2532 | array_keys($owner), array_merge($owner, $roles)) |
2533 | - ); |
|
2533 | + ); |
|
2534 | 2534 | } |
2535 | 2535 | } |
2536 | 2536 | |
@@ -2630,7 +2630,7 @@ discard block |
||
2630 | 2630 | return $output; |
2631 | 2631 | } |
2632 | 2632 | $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
2633 | - 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2633 | + 'bigbluebuttonbn_view_general_warning') . "\n"; |
|
2634 | 2634 | $output .= ' ' . $message . "\n"; |
2635 | 2635 | $output .= ' <div class="singlebutton pull-right">' . "\n"; |
2636 | 2636 | if (!empty($href)) { |
@@ -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; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (isset($meta)) { |
101 | 101 | $log->meta = $meta; |
102 | 102 | } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
103 | - $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
103 | + $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
104 | 104 | } |
105 | 105 | $DB->insert_record('bigbluebuttonbn_logs', $log); |
106 | 106 | } |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | $data = null; |
149 | 149 | if (!is_null($pname) && !is_null($purl)) { |
150 | 150 | $method = 'POST'; |
151 | - $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='". |
|
152 | - $purl."' /></module></modules>"; |
|
151 | + $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . |
|
152 | + $purl . "' /></module></modules>"; |
|
153 | 153 | } |
154 | 154 | $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data); |
155 | 155 | if ($xml) { |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | // Override imported flag with actual ID. |
311 | 311 | $recording['imported'] = $recordimported->id; |
312 | 312 | if (isset($recordimported->protected)) { |
313 | - $recording['protected'] = (string) $recordimported->protected; |
|
313 | + $recording['protected'] = (string)$recordimported->protected; |
|
314 | 314 | } |
315 | 315 | $recordsimportedarray[$recording['recordID']] = $recording; |
316 | 316 | } |
@@ -340,21 +340,21 @@ discard block |
||
340 | 340 | // Add formats. |
341 | 341 | $playbackarray = array(); |
342 | 342 | foreach ($recording->playback->format as $format) { |
343 | - $playbackarray[(string) $format->type] = array('type' => (string) $format->type, |
|
344 | - 'url' => trim((string) $format->url), 'length' => (string) $format->length); |
|
343 | + $playbackarray[(string)$format->type] = array('type' => (string)$format->type, |
|
344 | + 'url' => trim((string)$format->url), 'length' => (string)$format->length); |
|
345 | 345 | // Add preview per format when existing. |
346 | 346 | if ($format->preview) { |
347 | - $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
347 | + $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview); |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | // Add the metadata to the recordings array. |
351 | 351 | $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata)); |
352 | - $recordingarray = array('recordID' => (string) $recording->recordID, |
|
353 | - 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, |
|
354 | - 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, |
|
355 | - 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray); |
|
352 | + $recordingarray = array('recordID' => (string)$recording->recordID, |
|
353 | + 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, |
|
354 | + 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, |
|
355 | + 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray); |
|
356 | 356 | if (isset($recording->protected)) { |
357 | - $recordingarray['protected'] = (string) $recording->protected; |
|
357 | + $recordingarray['protected'] = (string)$recording->protected; |
|
358 | 358 | } |
359 | 359 | return $recordingarray + $metadataarray; |
360 | 360 | } |
@@ -369,9 +369,9 @@ discard block |
||
369 | 369 | function bigbluebuttonbn_get_recording_preview_images($preview) { |
370 | 370 | $imagesarray = array(); |
371 | 371 | foreach ($preview->images->image as $image) { |
372 | - $imagearray = array('url' => trim((string) $image)); |
|
372 | + $imagearray = array('url' => trim((string)$image)); |
|
373 | 373 | foreach ($image->attributes() as $attkey => $attvalue) { |
374 | - $imagearray[$attkey] = (string) $attvalue; |
|
374 | + $imagearray[$attkey] = (string)$attvalue; |
|
375 | 375 | } |
376 | 376 | array_push($imagesarray, $imagearray); |
377 | 377 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | if (is_object($value)) { |
392 | 392 | $value = ''; |
393 | 393 | } |
394 | - $metadataarray['meta_'.$key] = $value; |
|
394 | + $metadataarray['meta_' . $key] = $value; |
|
395 | 395 | } |
396 | 396 | return $metadataarray; |
397 | 397 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $ids = explode(',', $recordids); |
464 | 464 | foreach ($ids as $id) { |
465 | 465 | $xml = bigbluebuttonbn_wrap_xml_load_file( |
466 | - \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params) |
|
466 | + \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params) |
|
467 | 467 | ); |
468 | 468 | if ($xml && $xml->returncode != 'SUCCESS') { |
469 | 469 | return false; |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | return $xml; |
544 | 544 | } catch (Exception $e) { |
545 | 545 | libxml_use_internal_errors($previous); |
546 | - $error = 'Caught exception: '.$e->getMessage(); |
|
546 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
547 | 547 | debugging($error, DEBUG_DEVELOPER); |
548 | 548 | return null; |
549 | 549 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS); |
555 | 555 | return $response; |
556 | 556 | } catch (Exception $e) { |
557 | - $error = 'Caught exception: '.$e->getMessage(); |
|
557 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
558 | 558 | debugging($error, DEBUG_DEVELOPER); |
559 | 559 | libxml_use_internal_errors($previous); |
560 | 560 | return null; |
@@ -581,8 +581,8 @@ discard block |
||
581 | 581 | |
582 | 582 | $options = array(); |
583 | 583 | $options['CURLOPT_HTTPHEADER'] = array( |
584 | - 'Content-Type: '.$contenttype, |
|
585 | - 'Content-Length: '.strlen($data), |
|
584 | + 'Content-Type: ' . $contenttype, |
|
585 | + 'Content-Length: ' . strlen($data), |
|
586 | 586 | 'Content-Language: en-US', |
587 | 587 | ); |
588 | 588 | |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | * @return void |
600 | 600 | */ |
601 | 601 | function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) { |
602 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
602 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
603 | 603 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
604 | 604 | bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass); |
605 | 605 | } |
@@ -619,9 +619,9 @@ discard block |
||
619 | 619 | if ($userroles) { |
620 | 620 | $where = ''; |
621 | 621 | foreach ($userroles as $userrole) { |
622 | - $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid; |
|
622 | + $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid; |
|
623 | 623 | } |
624 | - $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where); |
|
624 | + $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where); |
|
625 | 625 | } |
626 | 626 | return $userroles; |
627 | 627 | } |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | * @return array $users |
645 | 645 | */ |
646 | 646 | function bigbluebuttonbn_get_users(context $context = null) { |
647 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
647 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
648 | 648 | foreach ($users as $key => $value) { |
649 | 649 | $users[$key] = fullname($value); |
650 | 650 | } |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | * @return array $users |
660 | 660 | */ |
661 | 661 | function bigbluebuttonbn_get_users_select(context $context = null) { |
662 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
662 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
663 | 663 | foreach ($users as $key => $value) { |
664 | 664 | $users[$key] = array('id' => $value->id, 'name' => fullname($value)); |
665 | 665 | } |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | * @return array $roles |
675 | 675 | */ |
676 | 676 | function bigbluebuttonbn_get_roles(context $context = null) { |
677 | - $roles = (array) role_get_names($context); |
|
677 | + $roles = (array)role_get_names($context); |
|
678 | 678 | foreach ($roles as $key => $value) { |
679 | 679 | $roles[$key] = $value->localname; |
680 | 680 | } |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | * @return array $users |
690 | 690 | */ |
691 | 691 | function bigbluebuttonbn_get_roles_select(context $context = null) { |
692 | - $roles = (array) role_get_names($context); |
|
692 | + $roles = (array)role_get_names($context); |
|
693 | 693 | foreach ($roles as $key => $value) { |
694 | 694 | $roles[$key] = array('id' => $value->id, 'name' => $value->localname); |
695 | 695 | } |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | * @return object $role |
705 | 705 | */ |
706 | 706 | function bigbluebuttonbn_get_role($id) { |
707 | - $roles = (array) role_get_names(); |
|
707 | + $roles = (array)role_get_names(); |
|
708 | 708 | if (is_numeric($id)) { |
709 | 709 | return (object)$roles[$id]; |
710 | 710 | } |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | if (!isguestuser()) { |
860 | 860 | $userroles = bigbluebuttonbn_get_user_roles($context, $userid); |
861 | 861 | } |
862 | - return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles); |
|
862 | + return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles); |
|
863 | 863 | } |
864 | 864 | |
865 | 865 | /** |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | function bigbluebuttonbn_generate_nonce() { |
1015 | 1015 | $mt = microtime(); |
1016 | 1016 | $rand = mt_rand(); |
1017 | - return md5($mt.$rand); |
|
1017 | + return md5($mt . $rand); |
|
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | /** |
@@ -1040,21 +1040,21 @@ discard block |
||
1040 | 1040 | */ |
1041 | 1041 | function bigbluebuttonbn_events() { |
1042 | 1042 | return array( |
1043 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1044 | - (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1045 | - (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1046 | - (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1047 | - (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1048 | - (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1049 | - (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1050 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1051 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1052 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1053 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1054 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1055 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1056 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1057 | - (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1043 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1044 | + (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1045 | + (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1046 | + (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1047 | + (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1048 | + (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1049 | + (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1050 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1051 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1052 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1053 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1054 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1055 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1056 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1057 | + (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1058 | 1058 | ); |
1059 | 1059 | } |
1060 | 1060 | |
@@ -1065,21 +1065,21 @@ discard block |
||
1065 | 1065 | */ |
1066 | 1066 | function bigbluebuttonbn_events_action() { |
1067 | 1067 | return array( |
1068 | - 'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1069 | - 'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1070 | - 'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1071 | - 'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1072 | - 'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1073 | - 'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1074 | - 'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1075 | - 'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1076 | - 'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1077 | - 'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1078 | - 'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1079 | - 'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1080 | - 'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1081 | - 'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1082 | - 'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1068 | + 'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, |
|
1069 | + 'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED, |
|
1070 | + 'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION, |
|
1071 | + 'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED, |
|
1072 | + 'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED, |
|
1073 | + 'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED, |
|
1074 | + 'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT, |
|
1075 | + 'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED, |
|
1076 | + 'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED, |
|
1077 | + 'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED, |
|
1078 | + 'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED, |
|
1079 | + 'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED, |
|
1080 | + 'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED, |
|
1081 | + 'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED, |
|
1082 | + 'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED |
|
1083 | 1083 | ); |
1084 | 1084 | } |
1085 | 1085 | |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | if (array_key_exists('other', $options)) { |
1111 | 1111 | $eventproperties['other'] = $options['other']; |
1112 | 1112 | } |
1113 | - $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create', |
|
1113 | + $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create', |
|
1114 | 1114 | array($eventproperties)); |
1115 | 1115 | $event->trigger(); |
1116 | 1116 | } |
@@ -1150,10 +1150,10 @@ discard block |
||
1150 | 1150 | $now = time(); |
1151 | 1151 | if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) { |
1152 | 1152 | // Use the value in the cache. |
1153 | - return (array) json_decode($result['meeting_info']); |
|
1153 | + return (array)json_decode($result['meeting_info']); |
|
1154 | 1154 | } |
1155 | 1155 | // Ping again and refresh the cache. |
1156 | - $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file( |
|
1156 | + $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file( |
|
1157 | 1157 | \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid]) |
1158 | 1158 | ); |
1159 | 1159 | $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo))); |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | * @return object |
1249 | 1249 | */ |
1250 | 1250 | function bigbluebuttonbn_set_config_xml($meetingid, $configxml) { |
1251 | - $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?'; |
|
1251 | + $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?'; |
|
1252 | 1252 | $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml); |
1253 | 1253 | $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST', |
1254 | 1254 | $configxmlparams, 'application/x-www-form-urlencoded'); |
@@ -1264,8 +1264,8 @@ discard block |
||
1264 | 1264 | * @return string |
1265 | 1265 | */ |
1266 | 1266 | function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) { |
1267 | - $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid); |
|
1268 | - $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1267 | + $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid); |
|
1268 | + $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret')); |
|
1269 | 1269 | return $configxmlparams; |
1270 | 1270 | } |
1271 | 1271 | |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | */ |
1280 | 1280 | function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) { |
1281 | 1281 | $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml); |
1282 | - $configxmlarray = (array) $configxml; |
|
1282 | + $configxmlarray = (array)$configxml; |
|
1283 | 1283 | if ($configxmlarray['returncode'] != 'SUCCESS') { |
1284 | 1284 | debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER); |
1285 | 1285 | return ''; |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | global $USER; |
1372 | 1372 | $starttime = $starttime - ($starttime % 1000); |
1373 | 1373 | // Set formatted date. |
1374 | - $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
1374 | + $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1375 | 1375 | return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone)); |
1376 | 1376 | } |
1377 | 1377 | |
@@ -1482,7 +1482,7 @@ discard block |
||
1482 | 1482 | * @return string |
1483 | 1483 | */ |
1484 | 1484 | function bigbluebuttonbn_get_recording_data_row_preview($recording) { |
1485 | - $options = array('id' => 'preview-'.$recording['recordID'], 'class' => 'container'); |
|
1485 | + $options = array('id' => 'preview-' . $recording['recordID'], 'class' => 'container'); |
|
1486 | 1486 | if ($recording['published'] === 'false') { |
1487 | 1487 | $options['hidden'] = 'hidden'; |
1488 | 1488 | } |
@@ -1523,7 +1523,7 @@ discard block |
||
1523 | 1523 | if ($recording['published'] === 'false') { |
1524 | 1524 | $visibility = 'hidden '; |
1525 | 1525 | } |
1526 | - $id = 'playbacks-'.$recording['recordID']; |
|
1526 | + $id = 'playbacks-' . $recording['recordID']; |
|
1527 | 1527 | $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported, |
1528 | 1528 | 'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'], |
1529 | 1529 | 'title' => $title, $visibility => $visibility)); |
@@ -1548,12 +1548,12 @@ discard block |
||
1548 | 1548 | if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) { |
1549 | 1549 | return ''; |
1550 | 1550 | } |
1551 | - $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'); |
|
1551 | + $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'); |
|
1552 | 1552 | $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);'; |
1553 | 1553 | $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id . |
1554 | - '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1554 | + '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type']; |
|
1555 | 1555 | if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') { |
1556 | - $href .= '&href='.urlencode(trim($playback['url'])); |
|
1556 | + $href .= '&href=' . urlencode(trim($playback['url'])); |
|
1557 | 1557 | } |
1558 | 1558 | $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID']; |
1559 | 1559 | $linkattributes = array( |
@@ -1687,7 +1687,7 @@ discard block |
||
1687 | 1687 | $linkattributes['class'] = 'disabled'; |
1688 | 1688 | unset($linkattributes['onclick']); |
1689 | 1689 | } |
1690 | - $icon = new pix_icon('i/'.$data['tag'], |
|
1690 | + $icon = new pix_icon('i/' . $data['tag'], |
|
1691 | 1691 | get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'), |
1692 | 1692 | 'moodle', $iconattributes); |
1693 | 1693 | return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false); |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | */ |
1805 | 1805 | function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) { |
1806 | 1806 | $row = new html_table_row(); |
1807 | - $row->id = 'recording-td-'.$recording['recordID']; |
|
1807 | + $row->id = 'recording-td-' . $recording['recordID']; |
|
1808 | 1808 | $row->attributes['data-imported'] = 'false'; |
1809 | 1809 | $texthead = ''; |
1810 | 1810 | $texttail = ''; |
@@ -1868,9 +1868,9 @@ discard block |
||
1868 | 1868 | function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) { |
1869 | 1869 | $sender = get_admin(); |
1870 | 1870 | // Prepare message. |
1871 | - $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn'). |
|
1872 | - ' "' . $bigbluebuttonbn->name . '" '. |
|
1873 | - get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
1871 | + $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . |
|
1872 | + ' "' . $bigbluebuttonbn->name . '" ' . |
|
1873 | + get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1874 | 1874 | $context = context_course::instance($bigbluebuttonbn->course); |
1875 | 1875 | \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext); |
1876 | 1876 | } |
@@ -2092,7 +2092,7 @@ discard block |
||
2092 | 2092 | } |
2093 | 2093 | // Prepare select for loading records based on existent bigbluebuttonbns. |
2094 | 2094 | $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE '; |
2095 | - $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')'; |
|
2095 | + $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')'; |
|
2096 | 2096 | // Include only Create events and exclude those with record not true. |
2097 | 2097 | $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?'; |
2098 | 2098 | // Execute select for loading records based on existent bigbluebuttonbns. |
@@ -2224,8 +2224,8 @@ discard block |
||
2224 | 2224 | function bigbluebuttonbn_format_activity_time($time) { |
2225 | 2225 | $activitytime = ''; |
2226 | 2226 | if ($time) { |
2227 | - $activitytime = calendar_day_representation($time).' '. |
|
2228 | - get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '. |
|
2227 | + $activitytime = calendar_day_representation($time) . ' ' . |
|
2228 | + get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' . |
|
2229 | 2229 | calendar_time_representation($time); |
2230 | 2230 | } |
2231 | 2231 | return $activitytime; |
@@ -2622,7 +2622,7 @@ discard block |
||
2622 | 2622 | * |
2623 | 2623 | * @return string |
2624 | 2624 | */ |
2625 | -function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') { |
|
2625 | +function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') { |
|
2626 | 2626 | global $OUTPUT; |
2627 | 2627 | $output = "\n"; |
2628 | 2628 | // Evaluates if config_warning is enabled. |
@@ -2661,10 +2661,10 @@ discard block |
||
2661 | 2661 | if ($class == '') { |
2662 | 2662 | $class = 'btn btn-secondary'; |
2663 | 2663 | } |
2664 | - $output = ' <form method="post" action="' . $href . '" class="form-inline">'."\n"; |
|
2665 | - $output .= ' <button type="submit" class="' . $class . '"'."\n"; |
|
2666 | - $output .= ' title="' . $title . '"'."\n"; |
|
2667 | - $output .= ' >' . $text . '</button>'."\n"; |
|
2668 | - $output .= ' </form>'."\n"; |
|
2664 | + $output = ' <form method="post" action="' . $href . '" class="form-inline">' . "\n"; |
|
2665 | + $output .= ' <button type="submit" class="' . $class . '"' . "\n"; |
|
2666 | + $output .= ' title="' . $title . '"' . "\n"; |
|
2667 | + $output .= ' >' . $text . '</button>' . "\n"; |
|
2668 | + $output .= ' </form>' . "\n"; |
|
2669 | 2669 | return $output; |
2670 | 2670 | } |
@@ -205,7 +205,7 @@ |
||
205 | 205 | !isset($CFG->bigbluebuttonbn['recordings_imported_editable']) || |
206 | 206 | !isset($CFG->bigbluebuttonbn['recordings_preview_default']) || |
207 | 207 | !isset($CFG->bigbluebuttonbn['recordings_preview_editable']) |
208 | - ); |
|
208 | + ); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -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 rendering HTML for settings.php. |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $itemname = get_string('config_' . $name, 'bigbluebuttonbn'); |
67 | 67 | } |
68 | 68 | if ($itemdescription === null) { |
69 | - $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn'); |
|
69 | + $itemdescription = get_string('config_' . $name . '_description', 'bigbluebuttonbn'); |
|
70 | 70 | } |
71 | 71 | $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription); |
72 | 72 | $this->settings->add($item); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | public function render_warning_message($name, $message, $type = 'warning', $closable = true) { |
149 | 149 | global $OUTPUT; |
150 | 150 | $output = $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in', |
151 | - 'bigbluebuttonbn_' . $name)."\n"; |
|
151 | + 'bigbluebuttonbn_' . $name) . "\n"; |
|
152 | 152 | if ($closable) { |
153 | 153 | $output .= ' <button type="button" class="close" data-dismiss="alert">×</button>' . "\n"; |
154 | 154 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public static function notification_process($context, $bigbluebuttonbn, $action) { |
48 | 48 | global $USER; |
49 | 49 | // Prepare message. |
50 | - $msg = (object) array(); |
|
50 | + $msg = (object)array(); |
|
51 | 51 | // Build the message_body. |
52 | 52 | $msg->action = $action; |
53 | 53 | $msg->activity_type = ''; |
@@ -72,26 +72,26 @@ discard block |
||
72 | 72 | * @return string |
73 | 73 | */ |
74 | 74 | public static function notification_msg_html($msg) { |
75 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
|
76 | - get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
77 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '. |
|
78 | - get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
79 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
80 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
81 | - get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
82 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n"; |
|
83 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
84 | - get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
85 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n"; |
|
86 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
87 | - get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
88 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
89 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
90 | - get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
91 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
92 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '. |
|
93 | - get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
94 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
75 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
76 | + get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
77 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' . |
|
78 | + get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
79 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
80 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
81 | + get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
82 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n"; |
|
83 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
84 | + get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
85 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n"; |
|
86 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
87 | + get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
88 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
89 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
90 | + get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
91 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
92 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . |
|
93 | + get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
94 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
95 | 95 | return $messagetext; |
96 | 96 | } |
97 | 97 | |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | global $DB; |
109 | 109 | $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST); |
110 | 110 | // Complete message. |
111 | - $msg = (object) array(); |
|
111 | + $msg = (object)array(); |
|
112 | 112 | $msg->user_name = fullname($sender); |
113 | 113 | $msg->user_email = $sender->email; |
114 | 114 | $msg->course_name = "$course->fullname"; |
115 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. |
|
116 | - $msg->user_name.'('.$msg->user_email.') '; |
|
117 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
118 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
115 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . |
|
116 | + $msg->user_name . '(' . $msg->user_email . ') '; |
|
117 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
118 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
119 | 119 | foreach ($users as $user) { |
120 | 120 | if ($user->id != $sender->id) { |
121 | 121 | message_post_message($sender, $user, $message, FORMAT_HTML); |