@@ -28,23 +28,23 @@ 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 | // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility. |
43 | 43 | if (!class_exists('\Firebase\JWT\JWT')) { |
44 | - if (file_exists($CFG->libdir.'/php-jwt/src/JWT.php')) { |
|
45 | - require_once($CFG->libdir.'/php-jwt/src/JWT.php'); |
|
44 | + if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) { |
|
45 | + require_once($CFG->libdir . '/php-jwt/src/JWT.php'); |
|
46 | 46 | } else { |
47 | - require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
47 | + require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | $CFG->bigbluebuttonbn = array(); |
53 | 53 | } |
54 | 54 | |
55 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
56 | - require_once(dirname(__FILE__).'/config.php'); |
|
55 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
56 | + require_once(dirname(__FILE__) . '/config.php'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /* |
@@ -108,18 +108,18 @@ discard block |
||
108 | 108 | return null; |
109 | 109 | } |
110 | 110 | $features = array( |
111 | - (string) FEATURE_IDNUMBER => true, |
|
112 | - (string) FEATURE_GROUPS => true, |
|
113 | - (string) FEATURE_GROUPINGS => true, |
|
114 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
115 | - (string) FEATURE_MOD_INTRO => true, |
|
116 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
117 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
118 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
119 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
120 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
111 | + (string)FEATURE_IDNUMBER => true, |
|
112 | + (string)FEATURE_GROUPS => true, |
|
113 | + (string)FEATURE_GROUPINGS => true, |
|
114 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
115 | + (string)FEATURE_MOD_INTRO => true, |
|
116 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
117 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
118 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
119 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
120 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
121 | 121 | ); |
122 | - if (isset($features[(string) $feature])) { |
|
122 | + if (isset($features[(string)$feature])) { |
|
123 | 123 | return $features[$feature]; |
124 | 124 | } |
125 | 125 | return null; |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
226 | 226 | global $DB; |
227 | 227 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
228 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
228 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
229 | 229 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
230 | 230 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
231 | 231 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -245,8 +245,8 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
247 | 247 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn)) { |
248 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
249 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
248 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
249 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
250 | 250 | get_string('view_message_times', 'bigbluebuttonbn'); |
251 | 251 | } |
252 | 252 | return ''; |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * @return array status array |
437 | 437 | */ |
438 | 438 | function bigbluebuttonbn_reset_recordings($courseid) { |
439 | - require_once(__DIR__.'/locallib.php'); |
|
439 | + require_once(__DIR__ . '/locallib.php'); |
|
440 | 440 | // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true]. |
441 | 441 | $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true); |
442 | 442 | // Remove all the recordings. |
@@ -504,16 +504,16 @@ discard block |
||
504 | 504 | if ($bigbluebuttonbn->visible) { |
505 | 505 | $classes = 'class="dimmed" '; |
506 | 506 | } |
507 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
508 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
509 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
510 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
511 | - $str .= ' </div>'."\n"; |
|
512 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
513 | - '</div>'."\n"; |
|
514 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
515 | - .'</div>'."\n"; |
|
516 | - $str .= '</div>'."\n"; |
|
507 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
508 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
509 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
510 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
511 | + $str .= ' </div>' . "\n"; |
|
512 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
513 | + '</div>' . "\n"; |
|
514 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
515 | + .'</div>' . "\n"; |
|
516 | + $str .= '</div>' . "\n"; |
|
517 | 517 | return $str; |
518 | 518 | } |
519 | 519 | |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | if (count($files) == 1) { |
746 | 746 | // Get the first (and only) file. |
747 | 747 | $file = reset($files); |
748 | - $filesrc = '/'.$file->get_filename(); |
|
748 | + $filesrc = '/' . $file->get_filename(); |
|
749 | 749 | } |
750 | 750 | return $filesrc; |
751 | 751 | } |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | if (!$filename) { |
815 | 815 | return false; |
816 | 816 | } |
817 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
817 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
818 | 818 | $fs = get_file_storage(); |
819 | 819 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
820 | 820 | if (!$file || $file->is_directory()) { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public static function notification_process($context, $bigbluebuttonbn, $action) { |
48 | 48 | global $USER; |
49 | 49 | // Prepare message. |
50 | - $msg = (object) array(); |
|
50 | + $msg = (object)array(); |
|
51 | 51 | // Build the message_body. |
52 | 52 | $msg->action = $action; |
53 | 53 | $msg->activity_type = ''; |
@@ -72,26 +72,26 @@ discard block |
||
72 | 72 | * @return string |
73 | 73 | */ |
74 | 74 | public static function notification_msg_html($msg) { |
75 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
|
76 | - get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
77 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '. |
|
78 | - get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
79 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
80 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
81 | - get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
82 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n"; |
|
83 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
84 | - get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
85 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n"; |
|
86 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
87 | - get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
88 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
89 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
90 | - get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
91 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
92 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '. |
|
93 | - get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
94 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
75 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
76 | + get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
77 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' . |
|
78 | + get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
79 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
80 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
81 | + get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
82 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n"; |
|
83 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
84 | + get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
85 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n"; |
|
86 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
87 | + get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
88 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
89 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
90 | + get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
91 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
92 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . |
|
93 | + get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
94 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
95 | 95 | return $messagetext; |
96 | 96 | } |
97 | 97 | |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | global $DB; |
109 | 109 | $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST); |
110 | 110 | // Complete message. |
111 | - $msg = (object) array(); |
|
111 | + $msg = (object)array(); |
|
112 | 112 | $msg->user_name = fullname($sender); |
113 | 113 | $msg->user_email = $sender->email; |
114 | 114 | $msg->course_name = $course->fullname; |
115 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. |
|
116 | - $msg->user_name.'('.$msg->user_email.') '; |
|
117 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
115 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . |
|
116 | + $msg->user_name . '(' . $msg->user_email . ') '; |
|
117 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
118 | 118 | // Process the message sending. |
119 | 119 | foreach (self::users_to_notify($context, $course) as $user) { |
120 | 120 | if ($user->id != $sender->id) { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | * @return array |
132 | 132 | */ |
133 | 133 | public static function users_to_notify($context, $course) { |
134 | - $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
134 | + $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true); |
|
135 | 135 | $modinfo = get_fast_modinfo($course); |
136 | 136 | $coursemodule = $modinfo->get_cm($context->instanceid); |
137 | 137 | $info = new \core_availability\info_module($coursemodule); |