@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * Remove this block when restored |
65 | 65 | */ |
66 | 66 | |
67 | - /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
67 | + /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
68 | 68 | const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/'; |
69 | 69 | /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */ |
70 | 70 | const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6'; |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $sql = "SELECT COUNT(*) FROM {bigbluebuttonbn_logs} "; |
279 | 279 | $sql .= "WHERE courseid = ? AND bigbluebuttonbnid = ? AND userid = ? AND (log = ? OR log = ?)"; |
280 | 280 | $result = $DB->count_records_sql($sql, array($course->id, $bigbluebuttonbn->id, $user->id, |
281 | - BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED)); |
|
281 | + BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED)); |
|
282 | 282 | return $result; |
283 | 283 | } |
284 | 284 | |
@@ -507,12 +507,12 @@ discard block |
||
507 | 507 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
508 | 508 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
509 | 509 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
510 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
510 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
511 | 511 | $str .= ' </div>'."\n"; |
512 | 512 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
513 | 513 | '</div>'."\n"; |
514 | 514 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
515 | - .'</div>'."\n"; |
|
515 | + .'</div>'."\n"; |
|
516 | 516 | $str .= '</div>'."\n"; |
517 | 517 | return $str; |
518 | 518 | } |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | $bigbluebuttonbn->coursemodule, |
721 | 721 | 'bigbluebuttonbn', |
722 | 722 | $bigbluebuttonbn->id, $bigbluebuttonbn->completionexpected |
723 | - ); |
|
723 | + ); |
|
724 | 724 | } |
725 | 725 | } |
726 | 726 |
@@ -28,23 +28,23 @@ 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.'/enrollib.php'); |
|
39 | -require_once($CFG->libdir.'/filelib.php'); |
|
40 | -require_once($CFG->libdir.'/formslib.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 . '/enrollib.php'); |
|
39 | +require_once($CFG->libdir . '/filelib.php'); |
|
40 | +require_once($CFG->libdir . '/formslib.php'); |
|
41 | 41 | |
42 | 42 | // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility. |
43 | 43 | if (!class_exists('\Firebase\JWT\JWT')) { |
44 | - if (file_exists($CFG->libdir.'/php-jwt/src/JWT.php')) { |
|
45 | - require_once($CFG->libdir.'/php-jwt/src/JWT.php'); |
|
44 | + if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) { |
|
45 | + require_once($CFG->libdir . '/php-jwt/src/JWT.php'); |
|
46 | 46 | } else { |
47 | - require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
47 | + require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | $CFG->bigbluebuttonbn = array(); |
53 | 53 | } |
54 | 54 | |
55 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
56 | - require_once(dirname(__FILE__).'/config.php'); |
|
55 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
56 | + require_once(dirname(__FILE__) . '/config.php'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /* |
@@ -110,19 +110,19 @@ discard block |
||
110 | 110 | return null; |
111 | 111 | } |
112 | 112 | $features = array( |
113 | - (string) FEATURE_IDNUMBER => true, |
|
114 | - (string) FEATURE_GROUPS => true, |
|
115 | - (string) FEATURE_GROUPINGS => true, |
|
116 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
117 | - (string) FEATURE_MOD_INTRO => true, |
|
118 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
119 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
120 | - (string) FEATURE_COMPLETION_HAS_RULES => true, |
|
121 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
122 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
123 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
113 | + (string)FEATURE_IDNUMBER => true, |
|
114 | + (string)FEATURE_GROUPS => true, |
|
115 | + (string)FEATURE_GROUPINGS => true, |
|
116 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
117 | + (string)FEATURE_MOD_INTRO => true, |
|
118 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
119 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
120 | + (string)FEATURE_COMPLETION_HAS_RULES => true, |
|
121 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
122 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
123 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
124 | 124 | ); |
125 | - if (isset($features[(string) $feature])) { |
|
125 | + if (isset($features[(string)$feature])) { |
|
126 | 126 | return $features[$feature]; |
127 | 127 | } |
128 | 128 | return null; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
278 | 278 | global $DB; |
279 | 279 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
280 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
280 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
281 | 281 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
282 | 282 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
283 | 283 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
299 | 299 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) { |
300 | 300 | return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
301 | - get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string) $completed . ' ' . |
|
301 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
302 | 302 | get_string('view_message_times', 'bigbluebuttonbn'); |
303 | 303 | } |
304 | 304 | return ''; |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | * @return array status array |
488 | 488 | */ |
489 | 489 | function bigbluebuttonbn_reset_recordings($courseid) { |
490 | - require_once(__DIR__.'/locallib.php'); |
|
490 | + require_once(__DIR__ . '/locallib.php'); |
|
491 | 491 | // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true]. |
492 | 492 | $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true); |
493 | 493 | // Remove all the recordings. |
@@ -555,16 +555,16 @@ discard block |
||
555 | 555 | if ($bigbluebuttonbn->visible) { |
556 | 556 | $classes = 'class="dimmed" '; |
557 | 557 | } |
558 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
559 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
560 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
561 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
562 | - $str .= ' </div>'."\n"; |
|
563 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
564 | - '</div>'."\n"; |
|
565 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
566 | - .'</div>'."\n"; |
|
567 | - $str .= '</div>'."\n"; |
|
558 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
559 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
560 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
561 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
562 | + $str .= ' </div>' . "\n"; |
|
563 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
564 | + '</div>' . "\n"; |
|
565 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
566 | + .'</div>' . "\n"; |
|
567 | + $str .= '</div>' . "\n"; |
|
568 | 568 | return $str; |
569 | 569 | } |
570 | 570 | |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | * @return void |
652 | 652 | **/ |
653 | 653 | function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) { |
654 | - require_once(__DIR__.'/locallib.php'); |
|
654 | + require_once(__DIR__ . '/locallib.php'); |
|
655 | 655 | $bigbluebuttonbn->timemodified = time(); |
656 | 656 | if ((integer)$bigbluebuttonbn->instance == 0) { |
657 | 657 | $bigbluebuttonbn->meetingid = 0; |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | if (count($files) == 1) { |
837 | 837 | // Get the first (and only) file. |
838 | 838 | $file = reset($files); |
839 | - $filesrc = '/'.$file->get_filename(); |
|
839 | + $filesrc = '/' . $file->get_filename(); |
|
840 | 840 | } |
841 | 841 | return $filesrc; |
842 | 842 | } |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | if (!$filename) { |
906 | 906 | return false; |
907 | 907 | } |
908 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
908 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
909 | 909 | $fs = get_file_storage(); |
910 | 910 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
911 | 911 | if (!$file || $file->is_directory()) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @uses FEATURE_GRADE_OUTCOMES |
104 | 104 | * @uses FEATURE_SHOW_DESCRIPTION |
105 | 105 | * @param string $feature |
106 | - * @return mixed True if yes (some features may use other values) |
|
106 | + * @return null|boolean True if yes (some features may use other values) |
|
107 | 107 | */ |
108 | 108 | function bigbluebuttonbn_supports($feature) { |
109 | 109 | if (!$feature) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * |
273 | 273 | * @param object $bigbluebuttonbn Id of the module instance |
274 | 274 | * |
275 | - * @return bool Success/Failure |
|
275 | + * @return boolean|null Success/Failure |
|
276 | 276 | */ |
277 | 277 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
278 | 278 | global $DB; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @param object $mod |
294 | 294 | * @param object $bigbluebuttonbn |
295 | 295 | * |
296 | - * @return bool |
|
296 | + * @return string |
|
297 | 297 | */ |
298 | 298 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
299 | 299 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) { |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | * @param stdClass $context context object |
870 | 870 | * @param string $filearea file area |
871 | 871 | * |
872 | - * @return false|null false if file not valid |
|
872 | + * @return boolean false if file not valid |
|
873 | 873 | */ |
874 | 874 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
875 | 875 |
@@ -309,10 +309,10 @@ discard block |
||
309 | 309 | */ |
310 | 310 | function bigbluebuttonbn_bbb_view_create_meeting_data(&$bbbsession) { |
311 | 311 | $data = ['meetingID' => $bbbsession['meetingid'], |
312 | - 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
313 | - 'attendeePW' => $bbbsession['viewerPW'], |
|
314 | - 'moderatorPW' => $bbbsession['modPW'], |
|
315 | - 'logoutURL' => $bbbsession['logoutURL'], |
|
312 | + 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
313 | + 'attendeePW' => $bbbsession['viewerPW'], |
|
314 | + 'moderatorPW' => $bbbsession['modPW'], |
|
315 | + 'logoutURL' => $bbbsession['logoutURL'], |
|
316 | 316 | ]; |
317 | 317 | $data['record'] = bigbluebuttonbn_bbb_view_create_meeting_data_record($bbbsession['record']); |
318 | 318 | // Check if auto_start_record is enable. |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | '%duration%', |
335 | 335 | (string) $durationtime, |
336 | 336 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
337 | - ); |
|
337 | + ); |
|
338 | 338 | } |
339 | 339 | $voicebridge = intval($bbbsession['voicebridge']); |
340 | 340 | if ($voicebridge > 0 && $voicebridge < 79999) { |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
24 | 24 | */ |
25 | 25 | |
26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
28 | 28 | |
29 | 29 | global $SESSION; |
30 | 30 | |
@@ -70,23 +70,23 @@ discard block |
||
70 | 70 | if (is_null($serverversion)) { |
71 | 71 | if ($bbbsession['administrator']) { |
72 | 72 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
73 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
73 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
74 | 74 | exit; |
75 | 75 | } |
76 | 76 | if ($bbbsession['moderator']) { |
77 | 77 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
78 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
78 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
79 | 79 | exit; |
80 | 80 | } |
81 | 81 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
82 | - $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course); |
|
82 | + $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course); |
|
83 | 83 | exit; |
84 | 84 | } |
85 | - $bbbsession['serverversion'] = (string) $serverversion; |
|
85 | + $bbbsession['serverversion'] = (string)$serverversion; |
|
86 | 86 | |
87 | 87 | // Operation URLs. |
88 | 88 | $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id; |
89 | - $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id . |
|
89 | + $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id . |
|
90 | 90 | '&bn=' . $bbbsession['bigbluebuttonbn']->id; |
91 | 91 | $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' . |
92 | 92 | 'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id; |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | // Assign group default values. |
117 | - $bbbsession['meetingid'] .= '['.$bbbsession['group'].']'; |
|
118 | - $bbbsession['meetingname'] .= ' ('.$groupname.')'; |
|
117 | + $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']'; |
|
118 | + $bbbsession['meetingname'] .= ' (' . $groupname . ')'; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | // Initialize session variable used across views. |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
182 | 182 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
183 | - header('Location: '.$bbbsession['logoutURL']); |
|
183 | + header('Location: ' . $bbbsession['logoutURL']); |
|
184 | 184 | break; |
185 | 185 | } |
186 | 186 | // As the meeting doesn't exist, try to create it. |
@@ -194,16 +194,16 @@ discard block |
||
194 | 194 | // The server is unreachable. |
195 | 195 | if ($bbbsession['administrator']) { |
196 | 196 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
197 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
197 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
198 | 198 | break; |
199 | 199 | } |
200 | 200 | if ($bbbsession['moderator']) { |
201 | 201 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
202 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
202 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
203 | 203 | break; |
204 | 204 | } |
205 | 205 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
206 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
206 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
207 | 207 | break; |
208 | 208 | } |
209 | 209 | if ($response['returncode'] == 'FAILED') { |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_create'], $bigbluebuttonbn); |
225 | 225 | // Internal logger: Insert a record with the meeting created. |
226 | 226 | $overrides = array('meetingid' => $bbbsession['meetingid']); |
227 | - $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}'; |
|
227 | + $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
228 | 228 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta); |
229 | 229 | // Since the meeting is already running, we just join the session. |
230 | 230 | bigbluebuttonbn_bbb_view_join_meeting($bbbsession, $bigbluebuttonbn, $origin); |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $overrides = array('meetingid' => $bbbsession['meetingid']); |
239 | 239 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_PLAYED, $overrides); |
240 | 240 | // Execute the redirect. |
241 | - header('Location: '.urldecode($href)); |
|
241 | + header('Location: ' . urldecode($href)); |
|
242 | 242 | break; |
243 | 243 | default: |
244 | 244 | bigbluebuttonbn_bbb_view_close_window(); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $data['welcome'] .= '<br><br>'; |
333 | 333 | $data['welcome'] .= str_replace( |
334 | 334 | '%duration%', |
335 | - (string) $durationtime, |
|
335 | + (string)$durationtime, |
|
336 | 336 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
337 | 337 | ); |
338 | 338 | } |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE); |
399 | 399 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
400 | 400 | // No more users allowed to join. |
401 | - header('Location: '.$bbbsession['logoutURL']); |
|
401 | + header('Location: ' . $bbbsession['logoutURL']); |
|
402 | 402 | return; |
403 | 403 | } |
404 | 404 | // Build the URL. |
@@ -412,13 +412,13 @@ discard block |
||
412 | 412 | bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_join'], $bigbluebuttonbn); |
413 | 413 | // Internal logger: Instert a record with the meeting created. |
414 | 414 | $overrides = array('meetingid' => $bbbsession['meetingid']); |
415 | - $meta = '{"origin":'.$origin.'}'; |
|
415 | + $meta = '{"origin":' . $origin . '}'; |
|
416 | 416 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_JOIN, $overrides, $meta); |
417 | 417 | // Before executing the redirect, increment the number of participants. |
418 | 418 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
419 | 419 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
420 | 420 | // Execute the redirect. |
421 | - header('Location: '.$joinurl); |
|
421 | + header('Location: ' . $joinurl); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -430,13 +430,13 @@ discard block |
||
430 | 430 | */ |
431 | 431 | function bigbluebuttonbn_bbb_view_errors($serrors, $id) { |
432 | 432 | global $CFG, $OUTPUT; |
433 | - $errors = (array) json_decode(urldecode($serrors)); |
|
433 | + $errors = (array)json_decode(urldecode($serrors)); |
|
434 | 434 | $msgerrors = ''; |
435 | 435 | foreach ($errors as $error) { |
436 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
436 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
437 | 437 | } |
438 | 438 | echo $OUTPUT->header(); |
439 | 439 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
440 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
440 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
441 | 441 | echo $OUTPUT->footer(); |
442 | 442 | } |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | * @author Darko Miletic (darko.miletic [at] gmail [dt] com) |
25 | 25 | */ |
26 | 26 | |
27 | -require(__DIR__.'/../../config.php'); |
|
28 | -require_once(__DIR__.'/locallib.php'); |
|
29 | -require_once(__DIR__.'/brokerlib.php'); |
|
27 | +require(__DIR__ . '/../../config.php'); |
|
28 | +require_once(__DIR__ . '/locallib.php'); |
|
29 | +require_once(__DIR__ . '/brokerlib.php'); |
|
30 | 30 | |
31 | 31 | use \Firebase\JWT\JWT; |
32 | 32 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $params = $_REQUEST; |
36 | 36 | |
37 | 37 | if (!isset($params['action']) || empty($params['action'])) { |
38 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
38 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
52 | 52 | if (!empty($error)) { |
53 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
53 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
54 | 54 | return; |
55 | 55 | } |
56 | 56 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | bigbluebuttonbn_broker_meeting_events($bigbluebuttonbn); |
72 | 72 | return; |
73 | 73 | } |
74 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
74 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
75 | 75 | } catch (Exception $e) { |
76 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
76 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
77 | 77 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
209 | 209 | $callbackresponse['status'] = true; |
210 | 210 | $callbackresponse['found'] = true; |
211 | - $callbackresponse['published'] = (string) $recording['published']; |
|
211 | + $callbackresponse['published'] = (string)$recording['published']; |
|
212 | 212 | if (!isset($params['meta']) || empty($params['meta'])) { |
213 | 213 | return $callbackresponse; |
214 | 214 | } |
@@ -535,8 +535,8 @@ discard block |
||
535 | 535 | $decodedparameters = \Firebase\JWT\JWT::decode($params['signed_parameters'], |
536 | 536 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
537 | 537 | } catch (Exception $e) { |
538 | - $error = 'Caught exception: '.$e->getMessage(); |
|
539 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
538 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
539 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
540 | 540 | return; |
541 | 541 | } |
542 | 542 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -566,8 +566,8 @@ discard block |
||
566 | 566 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, json_encode($meta)); |
567 | 567 | header('HTTP/1.0 202 Accepted'); |
568 | 568 | } catch (Exception $e) { |
569 | - $error = 'Caught exception: '.$e->getMessage(); |
|
570 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
569 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
570 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
571 | 571 | } |
572 | 572 | } |
573 | 573 | |
@@ -588,13 +588,13 @@ discard block |
||
588 | 588 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
589 | 589 | if (!isset($importrecordings[$params['id']])) { |
590 | 590 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
591 | - header('HTTP/1.0 404 Not found. '.$error); |
|
591 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
592 | 592 | return; |
593 | 593 | } |
594 | 594 | $callbackresponse = array('status' => true); |
595 | 595 | $importrecordings[$params['id']]['imported'] = true; |
596 | 596 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
597 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
597 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
598 | 598 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
599 | 599 | // Moodle event logger: Create an event for recording imported. |
600 | 600 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | $action = strtolower($params['action']); |
683 | 683 | $requiredparams = bigbluebuttonbn_broker_required_parameters(); |
684 | 684 | if (!array_key_exists($action, $requiredparams)) { |
685 | - return 'Action '.$params['action'].' can not be performed.'; |
|
685 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
686 | 686 | } |
687 | 687 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
688 | 688 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public static function notification_process($bigbluebuttonbn, $action) { |
47 | 47 | global $USER; |
48 | 48 | // Prepare message. |
49 | - $msg = (object) array(); |
|
49 | + $msg = (object)array(); |
|
50 | 50 | // Build the message_body. |
51 | 51 | $msg->action = $action; |
52 | 52 | $msg->activity_type = ''; |
@@ -71,26 +71,26 @@ discard block |
||
71 | 71 | * @return string |
72 | 72 | */ |
73 | 73 | public static function notification_msg_html($msg) { |
74 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
|
75 | - get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
76 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '. |
|
77 | - get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
78 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
79 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
80 | - get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
81 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n"; |
|
82 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
83 | - get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
84 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n"; |
|
85 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
86 | - get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
87 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
88 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
89 | - get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
90 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
91 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '. |
|
92 | - get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
93 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
74 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
75 | + get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
76 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' . |
|
77 | + get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
78 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
79 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
80 | + get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
81 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n"; |
|
82 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
83 | + get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
84 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n"; |
|
85 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
86 | + get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
87 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
88 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
89 | + get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
90 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
91 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . |
|
92 | + get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
93 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
94 | 94 | return $messagetext; |
95 | 95 | } |
96 | 96 | |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | $coursemodinfo = \course_modinfo::instance($bigbluebuttonbn->course); |
107 | 107 | $course = $coursemodinfo->get_course($bigbluebuttonbn->course); |
108 | 108 | // Complete message. |
109 | - $msg = (object) array(); |
|
109 | + $msg = (object)array(); |
|
110 | 110 | $msg->user_name = fullname($sender); |
111 | 111 | $msg->user_email = $sender->email; |
112 | 112 | $msg->course_name = $course->fullname; |
113 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. |
|
114 | - $msg->user_name.'('.$msg->user_email.') '; |
|
115 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
113 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . |
|
114 | + $msg->user_name . '(' . $msg->user_email . ') '; |
|
115 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
116 | 116 | // Process the message sending. |
117 | 117 | foreach (self::users_to_notify($bigbluebuttonbn->course) as $user) { |
118 | 118 | if ($user->id != $sender->id) { |