@@ -28,29 +28,29 @@ 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 | |
43 | 43 | if (!class_exists('\Firebase\JWT\JWT') && |
44 | - file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
45 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'); |
|
44 | + file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { |
|
45 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | if (!isset($CFG->bigbluebuttonbn)) { |
49 | 49 | $CFG->bigbluebuttonbn = array(); |
50 | 50 | } |
51 | 51 | |
52 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
53 | - require_once(dirname(__FILE__).'/config.php'); |
|
52 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
53 | + require_once(dirname(__FILE__) . '/config.php'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /* |
@@ -103,18 +103,18 @@ 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_GRADE_HAS_GRADE => false, |
|
114 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
115 | - (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_GRADE_HAS_GRADE => false, |
|
114 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
115 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
116 | 116 | ); |
117 | - if (isset($features[(string) $feature])) { |
|
117 | + if (isset($features[(string)$feature])) { |
|
118 | 118 | return $features[$feature]; |
119 | 119 | } |
120 | 120 | return null; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
214 | 214 | global $DB; |
215 | 215 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
216 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
216 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
217 | 217 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
218 | 218 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
219 | 219 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
237 | 237 | global $DB; |
238 | 238 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
239 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
239 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
240 | 240 | if ($completed > 0) { |
241 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
242 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
241 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
242 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
243 | 243 | get_string('view_message_times', 'bigbluebuttonbn'); |
244 | 244 | } |
245 | 245 | return ''; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
260 | 260 | global $DB; |
261 | 261 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
262 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
262 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
263 | 263 | '*', IGNORE_MULTIPLE); |
264 | 264 | return $completed > 0; |
265 | 265 | } |
@@ -345,16 +345,16 @@ discard block |
||
345 | 345 | if ($bigbluebuttonbn->visible) { |
346 | 346 | $classes = 'class="dimmed" '; |
347 | 347 | } |
348 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
349 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
350 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
351 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
352 | - $str .= ' </div>'."\n"; |
|
353 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
354 | - '</div>'."\n"; |
|
355 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
356 | - .'</div>'."\n"; |
|
357 | - $str .= '</div>'."\n"; |
|
348 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
349 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
350 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
351 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
352 | + $str .= ' </div>' . "\n"; |
|
353 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
354 | + '</div>' . "\n"; |
|
355 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
356 | + .'</div>' . "\n"; |
|
357 | + $str .= '</div>' . "\n"; |
|
358 | 358 | return $str; |
359 | 359 | } |
360 | 360 | |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | if (count($files) == 1) { |
574 | 574 | // Get the first (and only) file. |
575 | 575 | $file = reset($files); |
576 | - $filesrc = '/'.$file->get_filename(); |
|
576 | + $filesrc = '/' . $file->get_filename(); |
|
577 | 577 | } |
578 | 578 | return $filesrc; |
579 | 579 | } |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | if (!$filename) { |
642 | 642 | return false; |
643 | 643 | } |
644 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
644 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
645 | 645 | $fs = get_file_storage(); |
646 | 646 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
647 | 647 | if (!$file || $file->is_directory()) { |