@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | |
31 | 31 | // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility. |
32 | 32 | if (!class_exists('\Firebase\JWT\JWT')) { |
33 | - if (file_exists($CFG->libdir.'/php-jwt/src/JWT.php')) { |
|
34 | - require_once($CFG->libdir.'/php-jwt/src/JWT.php'); |
|
33 | + if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) { |
|
34 | + require_once($CFG->libdir . '/php-jwt/src/JWT.php'); |
|
35 | 35 | } else { |
36 | - require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
36 | + require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $CFG->bigbluebuttonbn = array(); |
42 | 42 | } |
43 | 43 | |
44 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
45 | - require_once(dirname(__FILE__).'/config.php'); |
|
44 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
45 | + require_once(dirname(__FILE__) . '/config.php'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /* |
@@ -99,19 +99,19 @@ discard block |
||
99 | 99 | return null; |
100 | 100 | } |
101 | 101 | $features = array( |
102 | - (string) FEATURE_IDNUMBER => true, |
|
103 | - (string) FEATURE_GROUPS => true, |
|
104 | - (string) FEATURE_GROUPINGS => true, |
|
105 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
106 | - (string) FEATURE_MOD_INTRO => true, |
|
107 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
108 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
109 | - (string) FEATURE_COMPLETION_HAS_RULES => true, |
|
110 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
111 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
112 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
102 | + (string)FEATURE_IDNUMBER => true, |
|
103 | + (string)FEATURE_GROUPS => true, |
|
104 | + (string)FEATURE_GROUPINGS => true, |
|
105 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
106 | + (string)FEATURE_MOD_INTRO => true, |
|
107 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
108 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
109 | + (string)FEATURE_COMPLETION_HAS_RULES => true, |
|
110 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
111 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
112 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
113 | 113 | ); |
114 | - if (isset($features[(string) $feature])) { |
|
114 | + if (isset($features[(string)$feature])) { |
|
115 | 115 | return $features[$feature]; |
116 | 116 | } |
117 | 117 | return null; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
305 | 305 | global $DB; |
306 | 306 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
307 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
307 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
308 | 308 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
309 | 309 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
310 | 310 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
326 | 326 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) { |
327 | 327 | return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
328 | - get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string) $completed . ' ' . |
|
328 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
329 | 329 | get_string('view_message_times', 'bigbluebuttonbn'); |
330 | 330 | } |
331 | 331 | return ''; |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | * @return array status array |
518 | 518 | */ |
519 | 519 | function bigbluebuttonbn_reset_recordings($courseid) { |
520 | - require_once(__DIR__.'/locallib.php'); |
|
520 | + require_once(__DIR__ . '/locallib.php'); |
|
521 | 521 | // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true]. |
522 | 522 | $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true); |
523 | 523 | // Remove all the recordings. |
@@ -586,16 +586,16 @@ discard block |
||
586 | 586 | if ($bigbluebuttonbn->visible) { |
587 | 587 | $classes = 'class="dimmed" '; |
588 | 588 | } |
589 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
590 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
591 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
592 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
593 | - $str .= ' </div>'."\n"; |
|
594 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
595 | - '</div>'."\n"; |
|
596 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
597 | - .'</div>'."\n"; |
|
598 | - $str .= '</div>'."\n"; |
|
589 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
590 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
591 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
592 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
593 | + $str .= ' </div>' . "\n"; |
|
594 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
595 | + '</div>' . "\n"; |
|
596 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
597 | + .'</div>' . "\n"; |
|
598 | + $str .= '</div>' . "\n"; |
|
599 | 599 | return $str; |
600 | 600 | } |
601 | 601 | |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | * @return void |
684 | 684 | **/ |
685 | 685 | function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) { |
686 | - require_once(__DIR__.'/locallib.php'); |
|
686 | + require_once(__DIR__ . '/locallib.php'); |
|
687 | 687 | $bigbluebuttonbn->timemodified = time(); |
688 | 688 | if ((integer)$bigbluebuttonbn->instance == 0) { |
689 | 689 | $bigbluebuttonbn->meetingid = 0; |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | if (count($files) == 1) { |
872 | 872 | // Get the first (and only) file. |
873 | 873 | $file = reset($files); |
874 | - $filesrc = '/'.$file->get_filename(); |
|
874 | + $filesrc = '/' . $file->get_filename(); |
|
875 | 875 | } |
876 | 876 | return $filesrc; |
877 | 877 | } |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | if (!$filename) { |
941 | 941 | return false; |
942 | 942 | } |
943 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
943 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
944 | 944 | $fs = get_file_storage(); |
945 | 945 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
946 | 946 | if (!$file || $file->is_directory()) { |