@@ -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 | |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $CFG->bigbluebuttonbn = array(); |
45 | 45 | } |
46 | 46 | |
47 | - if (file_exists(dirname(__FILE__).'/config.php')) { |
|
48 | - require_once(dirname(__FILE__).'/config.php'); |
|
47 | + if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
48 | + require_once(dirname(__FILE__) . '/config.php'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /* |
@@ -103,19 +103,19 @@ discard block |
||
103 | 103 | return null; |
104 | 104 | } |
105 | 105 | $features = array( |
106 | - (string) FEATURE_IDNUMBER => true, |
|
107 | - (string) FEATURE_GROUPS => true, |
|
108 | - (string) FEATURE_GROUPINGS => true, |
|
109 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
110 | - (string) FEATURE_MOD_INTRO => true, |
|
111 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
112 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
113 | - (string) FEATURE_COMPLETION_HAS_RULES => true, |
|
114 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
115 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
116 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
106 | + (string)FEATURE_IDNUMBER => true, |
|
107 | + (string)FEATURE_GROUPS => true, |
|
108 | + (string)FEATURE_GROUPINGS => true, |
|
109 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
110 | + (string)FEATURE_MOD_INTRO => true, |
|
111 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
112 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
113 | + (string)FEATURE_COMPLETION_HAS_RULES => true, |
|
114 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
115 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
116 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
117 | 117 | ); |
118 | - if (isset($features[(string) $feature])) { |
|
118 | + if (isset($features[(string)$feature])) { |
|
119 | 119 | return $features[$feature]; |
120 | 120 | } |
121 | 121 | return null; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
309 | 309 | global $DB; |
310 | 310 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
311 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
311 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
312 | 312 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
313 | 313 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
314 | 314 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
330 | 330 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) { |
331 | 331 | return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
332 | - get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string) $completed . ' ' . |
|
332 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
333 | 333 | get_string('view_message_times', 'bigbluebuttonbn'); |
334 | 334 | } |
335 | 335 | return ''; |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | * @return array status array |
522 | 522 | */ |
523 | 523 | function bigbluebuttonbn_reset_recordings($courseid) { |
524 | - require_once(__DIR__.'/locallib.php'); |
|
524 | + require_once(__DIR__ . '/locallib.php'); |
|
525 | 525 | // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true]. |
526 | 526 | $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true); |
527 | 527 | // Remove all the recordings. |
@@ -590,16 +590,16 @@ discard block |
||
590 | 590 | if ($bigbluebuttonbn->visible) { |
591 | 591 | $classes = 'class="dimmed" '; |
592 | 592 | } |
593 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
594 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
595 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
596 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
597 | - $str .= ' </div>'."\n"; |
|
598 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
599 | - '</div>'."\n"; |
|
600 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
601 | - .'</div>'."\n"; |
|
602 | - $str .= '</div>'."\n"; |
|
593 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
594 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
595 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
596 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
597 | + $str .= ' </div>' . "\n"; |
|
598 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
599 | + '</div>' . "\n"; |
|
600 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
601 | + .'</div>' . "\n"; |
|
602 | + $str .= '</div>' . "\n"; |
|
603 | 603 | return $str; |
604 | 604 | } |
605 | 605 | |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | * @return void |
688 | 688 | **/ |
689 | 689 | function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) { |
690 | - require_once(__DIR__.'/locallib.php'); |
|
690 | + require_once(__DIR__ . '/locallib.php'); |
|
691 | 691 | $bigbluebuttonbn->timemodified = time(); |
692 | 692 | if ((integer)$bigbluebuttonbn->instance == 0) { |
693 | 693 | $bigbluebuttonbn->meetingid = 0; |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | **/ |
794 | 794 | function bigbluebuttonbn_process_post_save_event(&$bigbluebuttonbn) { |
795 | 795 | global $CFG, $DB; |
796 | - require_once($CFG->dirroot.'/calendar/lib.php'); |
|
796 | + require_once($CFG->dirroot . '/calendar/lib.php'); |
|
797 | 797 | $eventid = $DB->get_field('event', 'id', array('modulename' => 'bigbluebuttonbn', |
798 | 798 | 'instance' => $bigbluebuttonbn->id)); |
799 | 799 | // Delete the event from calendar when/if openingtime is NOT set. |
@@ -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()) { |