@@ -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 | 44 | if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) { |
45 | 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 | /* |
@@ -106,18 +106,18 @@ discard block |
||
106 | 106 | return null; |
107 | 107 | } |
108 | 108 | $features = array( |
109 | - (string) FEATURE_IDNUMBER => true, |
|
110 | - (string) FEATURE_GROUPS => true, |
|
111 | - (string) FEATURE_GROUPINGS => true, |
|
112 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
113 | - (string) FEATURE_MOD_INTRO => true, |
|
114 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
115 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
116 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
117 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
118 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
109 | + (string)FEATURE_IDNUMBER => true, |
|
110 | + (string)FEATURE_GROUPS => true, |
|
111 | + (string)FEATURE_GROUPINGS => true, |
|
112 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
113 | + (string)FEATURE_MOD_INTRO => true, |
|
114 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
115 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
116 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
117 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
118 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
119 | 119 | ); |
120 | - if (isset($features[(string) $feature])) { |
|
120 | + if (isset($features[(string)$feature])) { |
|
121 | 121 | return $features[$feature]; |
122 | 122 | } |
123 | 123 | return null; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
217 | 217 | global $DB; |
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 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
222 | 222 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -239,10 +239,10 @@ discard block |
||
239 | 239 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
240 | 240 | global $DB; |
241 | 241 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
242 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
242 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
243 | 243 | if ($completed > 0) { |
244 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
245 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
244 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
245 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
246 | 246 | get_string('view_message_times', 'bigbluebuttonbn'); |
247 | 247 | } |
248 | 248 | return ''; |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
263 | 263 | global $DB; |
264 | 264 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
265 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
265 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
266 | 266 | '*', IGNORE_MULTIPLE); |
267 | 267 | return $completed > 0; |
268 | 268 | } |
@@ -348,16 +348,16 @@ discard block |
||
348 | 348 | if ($bigbluebuttonbn->visible) { |
349 | 349 | $classes = 'class="dimmed" '; |
350 | 350 | } |
351 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
352 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
353 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
354 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
355 | - $str .= ' </div>'."\n"; |
|
356 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
357 | - '</div>'."\n"; |
|
358 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
359 | - .'</div>'."\n"; |
|
360 | - $str .= '</div>'."\n"; |
|
351 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
352 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
353 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
354 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
355 | + $str .= ' </div>' . "\n"; |
|
356 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
357 | + '</div>' . "\n"; |
|
358 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
359 | + .'</div>' . "\n"; |
|
360 | + $str .= '</div>' . "\n"; |
|
361 | 361 | return $str; |
362 | 362 | } |
363 | 363 | |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | if (count($files) == 1) { |
590 | 590 | // Get the first (and only) file. |
591 | 591 | $file = reset($files); |
592 | - $filesrc = '/'.$file->get_filename(); |
|
592 | + $filesrc = '/' . $file->get_filename(); |
|
593 | 593 | } |
594 | 594 | return $filesrc; |
595 | 595 | } |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | if (!$filename) { |
659 | 659 | return false; |
660 | 660 | } |
661 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
661 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
662 | 662 | $fs = get_file_storage(); |
663 | 663 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
664 | 664 | if (!$file || $file->is_directory()) { |