@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | if ($keyId !== null) { |
| 157 | 157 | $header['kid'] = $keyId; |
| 158 | 158 | } |
| 159 | - if ( isset($head) && is_array($head) ) { |
|
| 159 | + if (isset($head) && is_array($head)) { |
|
| 160 | 160 | $header = array_merge($head, $header); |
| 161 | 161 | } |
| 162 | 162 | $segments = array(); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | throw new DomainException('Algorithm not supported'); |
| 189 | 189 | } |
| 190 | 190 | list($function, $algorithm) = static::$supported_algs[$alg]; |
| 191 | - switch($function) { |
|
| 191 | + switch ($function) { |
|
| 192 | 192 | case 'hash_hmac': |
| 193 | 193 | return hash_hmac($algorithm, $msg, $key, true); |
| 194 | 194 | case 'openssl': |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | list($function, $algorithm) = static::$supported_algs[$alg]; |
| 225 | - switch($function) { |
|
| 225 | + switch ($function) { |
|
| 226 | 226 | case 'openssl': |
| 227 | 227 | $success = openssl_verify($msg, $signature, $key, $algorithm); |
| 228 | 228 | if (!$success) { |
@@ -270,8 +270,8 @@ discard block |
||
| 270 | 270 | * manually detect large ints in the JSON string and quote them (thus converting |
| 271 | 271 | *them to strings) before decoding, hence the preg_replace() call. |
| 272 | 272 | */ |
| 273 | - $max_int_length = strlen((string) PHP_INT_MAX) - 1; |
|
| 274 | - $json_without_bigints = preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $input); |
|
| 273 | + $max_int_length = strlen((string)PHP_INT_MAX) - 1; |
|
| 274 | + $json_without_bigints = preg_replace('/:\s*(-?\d{' . $max_int_length . ',})/', ': "$1"', $input); |
|
| 275 | 275 | $obj = json_decode($json_without_bigints); |
| 276 | 276 | } |
| 277 | 277 | |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | * Decodes a JWT string into a PHP object. |
| 49 | 49 | * |
| 50 | 50 | * @param string $jwt The JWT |
| 51 | - * @param string|array $key The key, or map of keys. |
|
| 51 | + * @param string $key The key, or map of keys. |
|
| 52 | 52 | * If the algorithm used is asymmetric, this is the public key |
| 53 | - * @param array $allowed_algs List of supported verification algorithms |
|
| 53 | + * @param string[] $allowed_algs List of supported verification algorithms |
|
| 54 | 54 | * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256' |
| 55 | 55 | * |
| 56 | 56 | * @return object The JWT's payload as a PHP object |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * Sign a string with a given key and algorithm. |
| 175 | 175 | * |
| 176 | 176 | * @param string $msg The message to sign |
| 177 | - * @param string|resource $key The secret key |
|
| 177 | + * @param string $key The secret key |
|
| 178 | 178 | * @param string $alg The signing algorithm. |
| 179 | 179 | * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256' |
| 180 | 180 | * |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * $return->time = the time they did it |
| 227 | 227 | * $return->info = a short text description. |
| 228 | 228 | * |
| 229 | - * @return bool |
|
| 229 | + * @return string |
|
| 230 | 230 | */ |
| 231 | 231 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 232 | 232 | global $DB; |
@@ -315,6 +315,9 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | +/** |
|
| 319 | + * @param integer $now |
|
| 320 | + */ |
|
| 318 | 321 | function bigbluebuttonbn_print_overview_element($bigbluebuttonbn, $now) { |
| 319 | 322 | global $CFG; |
| 320 | 323 | |
@@ -550,6 +553,11 @@ discard block |
||
| 550 | 553 | send_stored_file($file, 0, 0, $forcedownload, $options); // download MUST be forced - security! |
| 551 | 554 | } |
| 552 | 555 | |
| 556 | +/** |
|
| 557 | + * @param stdClass $course |
|
| 558 | + * @param stdClass $cm |
|
| 559 | + * @param stdClass $context |
|
| 560 | + */ |
|
| 553 | 561 | function bigbluebuttonbn_pluginfile_filename($course, $cm, $context, $args) { |
| 554 | 562 | global $DB; |
| 555 | 563 | |
@@ -644,6 +652,9 @@ discard block |
||
| 644 | 652 | bigbluebuttonbn_notification_send($USER, $bigbluebuttonbn, bigbluebuttonbn_notification_msg_html($msg)); |
| 645 | 653 | } |
| 646 | 654 | |
| 655 | +/** |
|
| 656 | + * @param stdClass $msg |
|
| 657 | + */ |
|
| 647 | 658 | function bigbluebuttonbn_notification_msg_html($msg) { |
| 648 | 659 | $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
| 649 | 660 | get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
@@ -232,9 +232,9 @@ discard block |
||
| 232 | 232 | global $DB; |
| 233 | 233 | |
| 234 | 234 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 235 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
| 236 | - 'userid' => $user->id, |
|
| 237 | - 'log' => 'Join', ), '*'); |
|
| 235 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
| 236 | + 'userid' => $user->id, |
|
| 237 | + 'log' => 'Join', ), '*'); |
|
| 238 | 238 | |
| 239 | 239 | if ($completed > 0) { |
| 240 | 240 | return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
@@ -254,9 +254,9 @@ discard block |
||
| 254 | 254 | function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) { |
| 255 | 255 | global $DB; |
| 256 | 256 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 257 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
| 258 | - 'userid' => $user->id, |
|
| 259 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
| 257 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
| 258 | + 'userid' => $user->id, |
|
| 259 | + 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
| 260 | 260 | |
| 261 | 261 | return $completed > 0; |
| 262 | 262 | } |
@@ -329,12 +329,12 @@ discard block |
||
| 329 | 329 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
| 330 | 330 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
| 331 | 331 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
| 332 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 332 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 333 | 333 | $str .= ' </div>'."\n"; |
| 334 | 334 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
| 335 | 335 | '</div>'."\n"; |
| 336 | 336 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
| 337 | - .'</div>'."\n"; |
|
| 337 | + .'</div>'."\n"; |
|
| 338 | 338 | $str .= '</div>'."\n"; |
| 339 | 339 | |
| 340 | 340 | return $str; |
@@ -27,32 +27,32 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | global $CFG; |
| 29 | 29 | |
| 30 | -require_once($CFG->dirroot.'/calendar/lib.php'); |
|
| 31 | -require_once($CFG->dirroot.'/message/lib.php'); |
|
| 32 | -require_once($CFG->dirroot.'/mod/lti/OAuth.php'); |
|
| 33 | -require_once($CFG->libdir.'/accesslib.php'); |
|
| 34 | -require_once($CFG->libdir.'/completionlib.php'); |
|
| 35 | -require_once($CFG->libdir.'/datalib.php'); |
|
| 36 | -require_once($CFG->libdir.'/coursecatlib.php'); |
|
| 37 | -require_once($CFG->libdir.'/enrollib.php'); |
|
| 38 | -require_once($CFG->libdir.'/filelib.php'); |
|
| 39 | -require_once($CFG->libdir.'/formslib.php'); |
|
| 40 | - |
|
| 41 | -if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) { |
|
| 42 | - require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 30 | +require_once($CFG->dirroot . '/calendar/lib.php'); |
|
| 31 | +require_once($CFG->dirroot . '/message/lib.php'); |
|
| 32 | +require_once($CFG->dirroot . '/mod/lti/OAuth.php'); |
|
| 33 | +require_once($CFG->libdir . '/accesslib.php'); |
|
| 34 | +require_once($CFG->libdir . '/completionlib.php'); |
|
| 35 | +require_once($CFG->libdir . '/datalib.php'); |
|
| 36 | +require_once($CFG->libdir . '/coursecatlib.php'); |
|
| 37 | +require_once($CFG->libdir . '/enrollib.php'); |
|
| 38 | +require_once($CFG->libdir . '/filelib.php'); |
|
| 39 | +require_once($CFG->libdir . '/formslib.php'); |
|
| 40 | + |
|
| 41 | +if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) { |
|
| 42 | + require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (!isset($CFG->bigbluebuttonbn)) { |
| 46 | 46 | $CFG->bigbluebuttonbn = array(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
| 50 | - require_once(dirname(__FILE__).'/config.php'); |
|
| 49 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
| 50 | + require_once(dirname(__FILE__) . '/config.php'); |
|
| 51 | 51 | // Old BigBlueButtonBN cfg schema. For backward compatibility. |
| 52 | 52 | global $BIGBLUEBUTTONBN_CFG; |
| 53 | 53 | |
| 54 | 54 | if (isset($BIGBLUEBUTTONBN_CFG)) { |
| 55 | - foreach ((array) $BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
| 55 | + foreach ((array)$BIGBLUEBUTTONBN_CFG as $key => $value) { |
|
| 56 | 56 | $cfgkey = str_replace("bigbluebuttonbn_", "", $key); |
| 57 | 57 | $CFG->bigbluebuttonbn[$cfgkey] = $value; |
| 58 | 58 | } |
@@ -82,19 +82,19 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $features = array( |
| 85 | - (string) FEATURE_IDNUMBER => true, |
|
| 86 | - (string) FEATURE_GROUPS => true, |
|
| 87 | - (string) FEATURE_GROUPINGS => true, |
|
| 88 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
| 89 | - (string) FEATURE_MOD_INTRO => true, |
|
| 90 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
| 91 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 92 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
| 93 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
| 94 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
| 85 | + (string)FEATURE_IDNUMBER => true, |
|
| 86 | + (string)FEATURE_GROUPS => true, |
|
| 87 | + (string)FEATURE_GROUPINGS => true, |
|
| 88 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
| 89 | + (string)FEATURE_MOD_INTRO => true, |
|
| 90 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
| 91 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 92 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
| 93 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
| 94 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
| 95 | 95 | ); |
| 96 | 96 | |
| 97 | - if (isset($features[(string) $feature])) { |
|
| 97 | + if (isset($features[(string)$feature])) { |
|
| 98 | 98 | return $features[$feature]; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | // End the session associated with this instance (if it's running). |
| 177 | - $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id; |
|
| 177 | + $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id; |
|
| 178 | 178 | $modpw = $bigbluebuttonbn->moderatorpass; |
| 179 | 179 | |
| 180 | 180 | if (bigbluebuttonbn_is_meeting_running($meetingid)) { |
@@ -234,11 +234,11 @@ discard block |
||
| 234 | 234 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 235 | 235 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
| 236 | 236 | 'userid' => $user->id, |
| 237 | - 'log' => 'Join', ), '*'); |
|
| 237 | + 'log' => 'Join',), '*'); |
|
| 238 | 238 | |
| 239 | 239 | if ($completed > 0) { |
| 240 | - return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. |
|
| 241 | - get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. |
|
| 240 | + return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
|
| 241 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
| 242 | 242 | get_string('view_message_times', 'bigbluebuttonbn'); |
| 243 | 243 | } |
| 244 | 244 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
| 257 | 257 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
| 258 | 258 | 'userid' => $user->id, |
| 259 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
| 259 | + 'log' => 'Join',), '*', IGNORE_MULTIPLE); |
|
| 260 | 260 | |
| 261 | 261 | return $completed > 0; |
| 262 | 262 | } |
@@ -326,16 +326,16 @@ discard block |
||
| 326 | 326 | if ($bigbluebuttonbn->visible) { |
| 327 | 327 | $classes = 'class="dimmed" '; |
| 328 | 328 | } |
| 329 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
| 330 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
| 331 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
| 332 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 333 | - $str .= ' </div>'."\n"; |
|
| 334 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
| 335 | - '</div>'."\n"; |
|
| 336 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
| 337 | - .'</div>'."\n"; |
|
| 338 | - $str .= '</div>'."\n"; |
|
| 329 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
| 330 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
| 331 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
| 332 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
| 333 | + $str .= ' </div>' . "\n"; |
|
| 334 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
| 335 | + '</div>' . "\n"; |
|
| 336 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
| 337 | + .'</div>' . "\n"; |
|
| 338 | + $str .= '</div>' . "\n"; |
|
| 339 | 339 | |
| 340 | 340 | return $str; |
| 341 | 341 | } |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | /* Now that an id was assigned, generate and set the meetingid property based on |
| 427 | 427 | * [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) */ |
| 428 | 428 | if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
| 429 | - $meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 429 | + $meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . bigbluebuttonbn_get_cfg_shared_secret()); |
|
| 430 | 430 | $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $bigbluebuttonbn->id)); |
| 431 | 431 | |
| 432 | 432 | $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn'); |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | // Get the first (and only) file. |
| 501 | 501 | $file = reset($files); |
| 502 | 502 | // Set the presentation column in the bigbluebuttonbn table. |
| 503 | - $DB->set_field('bigbluebuttonbn', 'presentation', '/'.$file->get_filename(), array('id' => $bigbluebuttonbnid)); |
|
| 503 | + $DB->set_field('bigbluebuttonbn', 'presentation', '/' . $file->get_filename(), array('id' => $bigbluebuttonbnid)); |
|
| 504 | 504 | } else { |
| 505 | 505 | // Set the presentation column in the bigbluebuttonbn table. |
| 506 | 506 | $DB->set_field('bigbluebuttonbn', 'presentation', '', array('id' => $bigbluebuttonbnid)); |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | return false; |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
| 543 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
| 544 | 544 | $fs = get_file_storage(); |
| 545 | 545 | if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) { |
| 546 | 546 | return false; |
@@ -645,26 +645,26 @@ discard block |
||
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | function bigbluebuttonbn_notification_msg_html($msg) { |
| 648 | - $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '. |
|
| 649 | - get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
| 650 | - $messagetext .= '<p><b>'.$msg->activity_title.'</b> '. |
|
| 651 | - get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
| 652 | - $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
| 653 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 654 | - get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 655 | - $messagetext .= $msg->activity_title.'</td></tr>'."\n"; |
|
| 656 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 657 | - get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 658 | - $messagetext .= $msg->activity_description.'</td></tr>'."\n"; |
|
| 659 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 660 | - get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 661 | - $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
| 662 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'. |
|
| 663 | - get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 664 | - $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
| 665 | - $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '. |
|
| 666 | - get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
| 667 | - $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
| 648 | + $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . |
|
| 649 | + get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
| 650 | + $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' . |
|
| 651 | + get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
| 652 | + $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
| 653 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 654 | + get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 655 | + $messagetext .= $msg->activity_title . '</td></tr>' . "\n"; |
|
| 656 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 657 | + get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 658 | + $messagetext .= $msg->activity_description . '</td></tr>' . "\n"; |
|
| 659 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 660 | + get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 661 | + $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
| 662 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . |
|
| 663 | + get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 664 | + $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
| 665 | + $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . |
|
| 666 | + get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
| 667 | + $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | function bigbluebuttonbn_notification_send($sender, $bigbluebuttonbn, $message = '') { |
@@ -678,18 +678,18 @@ discard block |
||
| 678 | 678 | $msg->user_name = fullname($sender); |
| 679 | 679 | $msg->user_email = $sender->email; |
| 680 | 680 | $msg->course_name = "$course->fullname"; |
| 681 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '. |
|
| 682 | - $msg->user_name.'('.$msg->user_email.') '; |
|
| 683 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
| 681 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . |
|
| 682 | + $msg->user_name . '(' . $msg->user_email . ') '; |
|
| 683 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
| 684 | 684 | |
| 685 | 685 | $users = get_enrolled_users($context); |
| 686 | 686 | foreach ($users as $user) { |
| 687 | 687 | if ($user->id != $sender->id) { |
| 688 | 688 | $messageid = message_post_message($sender, $user, $message, FORMAT_HTML); |
| 689 | 689 | if (!empty($messageid)) { |
| 690 | - debugging('Msg to '.$msg->user_name.' was sent.', DEBUG_DEVELOPER); |
|
| 690 | + debugging('Msg to ' . $msg->user_name . ' was sent.', DEBUG_DEVELOPER); |
|
| 691 | 691 | } else { |
| 692 | - debugging('Msg to '.$msg->user_name.' was NOT sent.', DEBUG_DEVELOPER); |
|
| 692 | + debugging('Msg to ' . $msg->user_name . ' was NOT sent.', DEBUG_DEVELOPER); |
|
| 693 | 693 | } |
| 694 | 694 | } |
| 695 | 695 | } |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | * @return string |
| 53 | 53 | */ |
| 54 | 54 | public function get_description() { |
| 55 | - $a = (object) array('userid' => $this->userid, |
|
| 55 | + $a = (object)array('userid' => $this->userid, |
|
| 56 | 56 | 'bigbluebuttonbnid' => $this->objectid, |
| 57 | 57 | 'courseid' => $this->contextinstanceid); |
| 58 | 58 | |
| 59 | - return "The user with id '$a->userid' viewed the bigbluebuttonbn activity ". |
|
| 59 | + return "The user with id '$a->userid' viewed the bigbluebuttonbn activity " . |
|
| 60 | 60 | "with id '$a->bigbluebuttonbnid' for the course id '$a->courseid'."; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected function get_legacy_logdata() { |
| 69 | 69 | return array($this->courseid, 'bigbluebuttonbn', 'activity viewed', |
| 70 | - 'view.php?pageid='.$this->objectid, 'BigBlueButtonBN activity viewed', |
|
| 70 | + 'view.php?pageid=' . $this->objectid, 'BigBlueButtonBN activity viewed', |
|
| 71 | 71 | $this->contextinstanceid); |
| 72 | 72 | } |
| 73 | 73 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function get_description() { |
| 55 | 55 | $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
| 56 | - $a = (object) array('userid' => $this->userid, |
|
| 56 | + $a = (object)array('userid' => $this->userid, |
|
| 57 | 57 | 'recordingid' => $rid, |
| 58 | 58 | 'courseid' => $this->contextinstanceid); |
| 59 | 59 | |
| 60 | - return "The user with id '$a->userid' has imported a recording with id ". |
|
| 60 | + return "The user with id '$a->userid' has imported a recording with id " . |
|
| 61 | 61 | "'$a->recordingid' into the course id '$a->courseid'."; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function get_legacy_logdata() { |
| 70 | 70 | return array($this->courseid, 'bigbluebuttonbn', 'recording imported', |
| 71 | - 'view.php?pageid='.$this->objectid, 'Recording imported', |
|
| 71 | + 'view.php?pageid=' . $this->objectid, 'Recording imported', |
|
| 72 | 72 | $this->contextinstanceid); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function get_description() { |
| 55 | 55 | $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
| 56 | - $a = (object) array('userid' => $this->userid, |
|
| 56 | + $a = (object)array('userid' => $this->userid, |
|
| 57 | 57 | 'recordingid' => $rid, |
| 58 | 58 | 'courseid' => $this->contextinstanceid); |
| 59 | 59 | |
| 60 | - return "The user with id '$a->userid' has published a recording with id ". |
|
| 60 | + return "The user with id '$a->userid' has published a recording with id " . |
|
| 61 | 61 | "'$a->recordingid' in the course id '$a->courseid'."; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function get_legacy_logdata() { |
| 70 | 70 | return array($this->courseid, 'bigbluebuttonbn', 'recording published', |
| 71 | - 'view.php?pageid='.$this->objectid, 'Recording published', |
|
| 71 | + 'view.php?pageid=' . $this->objectid, 'Recording published', |
|
| 72 | 72 | $this->contextinstanceid); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function get_description() { |
| 55 | 55 | $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
| 56 | - $a = (object) array('userid' => $this->userid, |
|
| 56 | + $a = (object)array('userid' => $this->userid, |
|
| 57 | 57 | 'recordingid' => $rid, |
| 58 | 58 | 'courseid' => $this->contextinstanceid); |
| 59 | 59 | |
| 60 | - return "The user with id '$a->userid' has unpublished a recording with id ". |
|
| 60 | + return "The user with id '$a->userid' has unpublished a recording with id " . |
|
| 61 | 61 | "'$a->recordingid' in the course id '$a->courseid'."; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function get_legacy_logdata() { |
| 70 | 70 | return array($this->courseid, 'bigbluebuttonbn', 'recording unpublished', |
| 71 | - 'view.php?pageid='.$this->objectid, 'Recording unpublished', |
|
| 71 | + 'view.php?pageid=' . $this->objectid, 'Recording unpublished', |
|
| 72 | 72 | $this->contextinstanceid); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | * @return string |
| 53 | 53 | */ |
| 54 | 54 | public function get_description() { |
| 55 | - $a = (object) array('userid' => $this->userid, |
|
| 55 | + $a = (object)array('userid' => $this->userid, |
|
| 56 | 56 | 'bigbluebuttonbnid' => $this->objectid, |
| 57 | 57 | 'courseid' => $this->contextinstanceid); |
| 58 | 58 | |
| 59 | - return "The user with id '$a->userid' has left a bigbluebutton meeting for ". |
|
| 60 | - "the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for the course id ". |
|
| 59 | + return "The user with id '$a->userid' has left a bigbluebutton meeting for " . |
|
| 60 | + "the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for the course id " . |
|
| 61 | 61 | "'$a->courseid'."; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function get_legacy_logdata() { |
| 70 | 70 | return array($this->courseid, 'bigbluebuttonbn', 'meeting left', |
| 71 | - 'view.php?pageid='.$this->objectid, 'BigBlueButtonBN meeting left', |
|
| 71 | + 'view.php?pageid=' . $this->objectid, 'BigBlueButtonBN meeting left', |
|
| 72 | 72 | $this->contextinstanceid); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | * @return string |
| 53 | 53 | */ |
| 54 | 54 | public function get_description() { |
| 55 | - $a = (object) array('userid' => $this->userid, |
|
| 55 | + $a = (object)array('userid' => $this->userid, |
|
| 56 | 56 | 'bigbluebuttonbnid' => $this->objectid, |
| 57 | 57 | 'courseid' => $this->contextinstanceid); |
| 58 | 58 | |
| 59 | - return "A bigbluebutton meeting for the bigbluebuttonbn activity with id ". |
|
| 60 | - "'$a->bigbluebuttonbnid' for the course id '$a->courseid' has been forcibly ". |
|
| 59 | + return "A bigbluebutton meeting for the bigbluebuttonbn activity with id " . |
|
| 60 | + "'$a->bigbluebuttonbnid' for the course id '$a->courseid' has been forcibly " . |
|
| 61 | 61 | "ended by the user with id '$a->userid'."; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function get_legacy_logdata() { |
| 70 | 70 | return array($this->courseid, 'bigbluebuttonbn', 'meeting ended', |
| 71 | - 'view.php?pageid='.$this->objectid, 'BigBlueButtonBN meeting forcibly ended', |
|
| 71 | + 'view.php?pageid=' . $this->objectid, 'BigBlueButtonBN meeting forcibly ended', |
|
| 72 | 72 | $this->contextinstanceid); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function get_description() { |
| 55 | 55 | $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
| 56 | - $a = (object) array('userid' => $this->userid, |
|
| 56 | + $a = (object)array('userid' => $this->userid, |
|
| 57 | 57 | 'recordingid' => $rid, |
| 58 | 58 | 'courseid' => $this->contextinstanceid); |
| 59 | 59 | |
| 60 | - return "The user with id '$a->userid' has deleted a recording with id ". |
|
| 60 | + return "The user with id '$a->userid' has deleted a recording with id " . |
|
| 61 | 61 | "'$a->recordingid' from the course id '$a->courseid'."; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function get_legacy_logdata() { |
| 70 | 70 | return array($this->courseid, 'bigbluebuttonbn', 'recording deleted', |
| 71 | - 'view.php?pageid='.$this->objectid, 'Recording deleted', |
|
| 71 | + 'view.php?pageid=' . $this->objectid, 'Recording deleted', |
|
| 72 | 72 | $this->contextinstanceid); |
| 73 | 73 | } |
| 74 | 74 | |