@@ -28,22 +28,22 @@ 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.'/tag/lib.php'); |
|
34 | -require_once($CFG->libdir.'/accesslib.php'); |
|
35 | -require_once($CFG->libdir.'/completionlib.php'); |
|
36 | -require_once($CFG->libdir.'/datalib.php'); |
|
37 | -require_once($CFG->libdir.'/enrollib.php'); |
|
38 | -require_once($CFG->libdir.'/filelib.php'); |
|
39 | -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 . '/tag/lib.php'); |
|
34 | +require_once($CFG->libdir . '/accesslib.php'); |
|
35 | +require_once($CFG->libdir . '/completionlib.php'); |
|
36 | +require_once($CFG->libdir . '/datalib.php'); |
|
37 | +require_once($CFG->libdir . '/enrollib.php'); |
|
38 | +require_once($CFG->libdir . '/filelib.php'); |
|
39 | +require_once($CFG->libdir . '/formslib.php'); |
|
40 | 40 | |
41 | 41 | // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility. |
42 | 42 | if (!class_exists('\Firebase\JWT\JWT')) { |
43 | - if (file_exists($CFG->libdir.'/php-jwt/src/JWT.php')) { |
|
44 | - require_once($CFG->libdir.'/php-jwt/src/JWT.php'); |
|
43 | + if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) { |
|
44 | + require_once($CFG->libdir . '/php-jwt/src/JWT.php'); |
|
45 | 45 | } else { |
46 | - require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
46 | + require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | $CFG->bigbluebuttonbn = array(); |
52 | 52 | } |
53 | 53 | |
54 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
55 | - require_once(dirname(__FILE__).'/config.php'); |
|
54 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
55 | + require_once(dirname(__FILE__) . '/config.php'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /* |
@@ -109,19 +109,19 @@ discard block |
||
109 | 109 | return null; |
110 | 110 | } |
111 | 111 | $features = array( |
112 | - (string) FEATURE_IDNUMBER => true, |
|
113 | - (string) FEATURE_GROUPS => true, |
|
114 | - (string) FEATURE_GROUPINGS => true, |
|
115 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
116 | - (string) FEATURE_MOD_INTRO => true, |
|
117 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
118 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
119 | - (string) FEATURE_COMPLETION_HAS_RULES => true, |
|
120 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
121 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
122 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
112 | + (string)FEATURE_IDNUMBER => true, |
|
113 | + (string)FEATURE_GROUPS => true, |
|
114 | + (string)FEATURE_GROUPINGS => true, |
|
115 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
116 | + (string)FEATURE_MOD_INTRO => true, |
|
117 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
118 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
119 | + (string)FEATURE_COMPLETION_HAS_RULES => true, |
|
120 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
121 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
122 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
123 | 123 | ); |
124 | - if (isset($features[(string) $feature])) { |
|
124 | + if (isset($features[(string)$feature])) { |
|
125 | 125 | return $features[$feature]; |
126 | 126 | } |
127 | 127 | return null; |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
315 | 315 | global $DB; |
316 | 316 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
317 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
317 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
318 | 318 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
319 | 319 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
320 | 320 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
336 | 336 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) { |
337 | 337 | return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
338 | - get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string) $completed . ' ' . |
|
338 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
339 | 339 | get_string('view_message_times', 'bigbluebuttonbn'); |
340 | 340 | } |
341 | 341 | return ''; |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | * @return array status array |
527 | 527 | */ |
528 | 528 | function bigbluebuttonbn_reset_recordings($courseid) { |
529 | - require_once(__DIR__.'/locallib.php'); |
|
529 | + require_once(__DIR__ . '/locallib.php'); |
|
530 | 530 | // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true]. |
531 | 531 | $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true); |
532 | 532 | // Remove all the recordings. |
@@ -594,16 +594,16 @@ discard block |
||
594 | 594 | if ($bigbluebuttonbn->visible) { |
595 | 595 | $classes = 'class="dimmed" '; |
596 | 596 | } |
597 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
598 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
599 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
600 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
601 | - $str .= ' </div>'."\n"; |
|
602 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
603 | - '</div>'."\n"; |
|
604 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
605 | - .'</div>'."\n"; |
|
606 | - $str .= '</div>'."\n"; |
|
597 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
598 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
599 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
600 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
601 | + $str .= ' </div>' . "\n"; |
|
602 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
603 | + '</div>' . "\n"; |
|
604 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
605 | + .'</div>' . "\n"; |
|
606 | + $str .= '</div>' . "\n"; |
|
607 | 607 | return $str; |
608 | 608 | } |
609 | 609 | |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | * @return void |
692 | 692 | **/ |
693 | 693 | function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) { |
694 | - require_once(__DIR__.'/locallib.php'); |
|
694 | + require_once(__DIR__ . '/locallib.php'); |
|
695 | 695 | $bigbluebuttonbn->timemodified = time(); |
696 | 696 | if ((integer)$bigbluebuttonbn->instance == 0) { |
697 | 697 | $bigbluebuttonbn->meetingid = 0; |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | if (count($files) == 1) { |
880 | 880 | // Get the first (and only) file. |
881 | 881 | $file = reset($files); |
882 | - $filesrc = '/'.$file->get_filename(); |
|
882 | + $filesrc = '/' . $file->get_filename(); |
|
883 | 883 | } |
884 | 884 | return $filesrc; |
885 | 885 | } |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | if (!$filename) { |
949 | 949 | return false; |
950 | 950 | } |
951 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
951 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
952 | 952 | $fs = get_file_storage(); |
953 | 953 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
954 | 954 | if (!$file || $file->is_directory()) { |