@@ -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.'/coursecatlib.php'); |
|
39 | -require_once($CFG->libdir.'/enrollib.php'); |
|
40 | -require_once($CFG->libdir.'/filelib.php'); |
|
41 | -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 . '/coursecatlib.php'); |
|
39 | +require_once($CFG->libdir . '/enrollib.php'); |
|
40 | +require_once($CFG->libdir . '/filelib.php'); |
|
41 | +require_once($CFG->libdir . '/formslib.php'); |
|
42 | 42 | |
43 | 43 | |
44 | -if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
45 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'); |
|
44 | +if (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 | /* |
@@ -97,18 +97,18 @@ discard block |
||
97 | 97 | return null; |
98 | 98 | } |
99 | 99 | $features = array( |
100 | - (string) FEATURE_IDNUMBER => true, |
|
101 | - (string) FEATURE_GROUPS => true, |
|
102 | - (string) FEATURE_GROUPINGS => true, |
|
103 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
104 | - (string) FEATURE_MOD_INTRO => true, |
|
105 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
106 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
107 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
108 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
109 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
100 | + (string)FEATURE_IDNUMBER => true, |
|
101 | + (string)FEATURE_GROUPS => true, |
|
102 | + (string)FEATURE_GROUPINGS => true, |
|
103 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
104 | + (string)FEATURE_MOD_INTRO => true, |
|
105 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
106 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
107 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
108 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
109 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
110 | 110 | ); |
111 | - if (isset($features[(string) $feature])) { |
|
111 | + if (isset($features[(string)$feature])) { |
|
112 | 112 | return $features[$feature]; |
113 | 113 | } |
114 | 114 | return null; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $log->timecreated = time(); |
209 | 209 | $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE; |
210 | 210 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
211 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
211 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
212 | 212 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
213 | 213 | $log->meta = "{\"has_recordings\":false}"; |
214 | 214 | if (!empty($logs)) { |
@@ -237,10 +237,10 @@ discard block |
||
237 | 237 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
238 | 238 | global $DB; |
239 | 239 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
240 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*'); |
|
240 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*'); |
|
241 | 241 | if ($completed > 0) { |
242 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
243 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
242 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
243 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
244 | 244 | get_string('view_message_times', 'bigbluebuttonbn'); |
245 | 245 | } |
246 | 246 | return ''; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
261 | 261 | global $DB; |
262 | 262 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
263 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), |
|
263 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), |
|
264 | 264 | '*', IGNORE_MULTIPLE); |
265 | 265 | return $completed > 0; |
266 | 266 | } |
@@ -335,16 +335,16 @@ discard block |
||
335 | 335 | if ($bigbluebuttonbn->visible) { |
336 | 336 | $classes = 'class="dimmed" '; |
337 | 337 | } |
338 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
339 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
340 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
341 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
342 | - $str .= ' </div>'."\n"; |
|
343 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
344 | - '</div>'."\n"; |
|
345 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
346 | - .'</div>'."\n"; |
|
347 | - $str .= '</div>'."\n"; |
|
338 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
339 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
340 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
341 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
342 | + $str .= ' </div>' . "\n"; |
|
343 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
344 | + '</div>' . "\n"; |
|
345 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
346 | + .'</div>' . "\n"; |
|
347 | + $str .= '</div>' . "\n"; |
|
348 | 348 | return $str; |
349 | 349 | } |
350 | 350 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | if (count($files) == 1) { |
545 | 545 | // Get the first (and only) file. |
546 | 546 | $file = reset($files); |
547 | - $filesrc = '/'.$file->get_filename(); |
|
547 | + $filesrc = '/' . $file->get_filename(); |
|
548 | 548 | } |
549 | 549 | return $filesrc; |
550 | 550 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | if (!$filename) { |
613 | 613 | return false; |
614 | 614 | } |
615 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
615 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
616 | 616 | $fs = get_file_storage(); |
617 | 617 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
618 | 618 | if (!$file || $file->is_directory()) { |
@@ -109,7 +109,7 @@ |
||
109 | 109 | * @since Moodle 3.3 |
110 | 110 | */ |
111 | 111 | public static function get_bigbluebuttonbns_by_courses_parameters() { |
112 | - return new external_function_parameters ( |
|
112 | + return new external_function_parameters( |
|
113 | 113 | array( |
114 | 114 | 'courseids' => new external_multiple_structure( |
115 | 115 | new external_value(PARAM_INT, 'Course id'), 'Array of course ids', VALUE_DEFAULT, array() |