@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
| 209 | 209 | $callbackresponse['status'] = true; |
| 210 | 210 | $callbackresponse['found'] = true; |
| 211 | - $callbackresponse['published'] = (string) $recording['published']; |
|
| 211 | + $callbackresponse['published'] = (string)$recording['published']; |
|
| 212 | 212 | if (!isset($params['meta']) || empty($params['meta'])) { |
| 213 | 213 | return $callbackresponse; |
| 214 | 214 | } |
@@ -535,8 +535,8 @@ discard block |
||
| 535 | 535 | $decodedparameters = \Firebase\JWT\JWT::decode($params['signed_parameters'], |
| 536 | 536 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 537 | 537 | } catch (Exception $e) { |
| 538 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 539 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 538 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 539 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 540 | 540 | return; |
| 541 | 541 | } |
| 542 | 542 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -561,12 +561,12 @@ discard block |
||
| 561 | 561 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
| 562 | 562 | } |
| 563 | 563 | $overrides = array('meetingid' => $decodedparameters->meeting_id); |
| 564 | - $meta = '{"recordid":'.$decodedparameters->record_id.'}'; |
|
| 564 | + $meta = '{"recordid":' . $decodedparameters->record_id . '}'; |
|
| 565 | 565 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta); |
| 566 | 566 | header('HTTP/1.0 202 Accepted'); |
| 567 | 567 | } catch (Exception $e) { |
| 568 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 569 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
| 568 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 569 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
| 570 | 570 | } |
| 571 | 571 | } |
| 572 | 572 | |
@@ -587,13 +587,13 @@ discard block |
||
| 587 | 587 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
| 588 | 588 | if (!isset($importrecordings[$params['id']])) { |
| 589 | 589 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
| 590 | - header('HTTP/1.0 404 Not found. '.$error); |
|
| 590 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
| 591 | 591 | return; |
| 592 | 592 | } |
| 593 | 593 | $callbackresponse = array('status' => true); |
| 594 | 594 | $importrecordings[$params['id']]['imported'] = true; |
| 595 | 595 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
| 596 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
| 596 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
| 597 | 597 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
| 598 | 598 | // Moodle event logger: Create an event for recording imported. |
| 599 | 599 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -618,8 +618,8 @@ discard block |
||
| 618 | 618 | $decodedparameters = \Firebase\JWT\JWT::decode($params['signed_parameters'], |
| 619 | 619 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 620 | 620 | } catch (Exception $e) { |
| 621 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 622 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 621 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 622 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 623 | 623 | return; |
| 624 | 624 | } |
| 625 | 625 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | } |
| 661 | 661 | $action = strtolower($params['action']); |
| 662 | 662 | if (!array_key_exists($action, $requiredparams)) { |
| 663 | - return 'Action '.$params['action'].' can not be performed.'; |
|
| 663 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
| 664 | 664 | } |
| 665 | 665 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
| 666 | 666 | } |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | -require(__DIR__.'/../../config.php'); |
|
| 27 | -require_once(__DIR__.'/locallib.php'); |
|
| 28 | -require_once(__DIR__.'/brokerlib.php'); |
|
| 26 | +require(__DIR__ . '/../../config.php'); |
|
| 27 | +require_once(__DIR__ . '/locallib.php'); |
|
| 28 | +require_once(__DIR__ . '/brokerlib.php'); |
|
| 29 | 29 | |
| 30 | 30 | global $PAGE, $USER, $CFG, $SESSION, $DB; |
| 31 | 31 | |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | require_login(null, true); |
| 42 | 42 | |
| 43 | 43 | if (empty($params['action'])) { |
| 44 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
| 44 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
| 45 | 45 | return; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
| 49 | 49 | if (!empty($error)) { |
| 50 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 50 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | echo bigbluebuttonbn_broker_recording_import($bbbsession, $params); |
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
| 124 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
| 125 | 125 | } catch (Exception $e) { |
| 126 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
| 126 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
| 127 | 127 | } |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | * @author Darko Miletic (darko.miletic [at] gmail [dt] com) |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -require(__DIR__.'/../../config.php'); |
|
| 28 | -require_once(__DIR__.'/locallib.php'); |
|
| 29 | -require_once(__DIR__.'/brokerlib.php'); |
|
| 27 | +require(__DIR__ . '/../../config.php'); |
|
| 28 | +require_once(__DIR__ . '/locallib.php'); |
|
| 29 | +require_once(__DIR__ . '/brokerlib.php'); |
|
| 30 | 30 | |
| 31 | 31 | use \Firebase\JWT\JWT; |
| 32 | 32 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
| 43 | 43 | |
| 44 | 44 | if (empty($params['action'])) { |
| 45 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
| 45 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
| 62 | 62 | if (!empty($error)) { |
| 63 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 63 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn); |
| 80 | 80 | return; |
| 81 | 81 | } |
| 82 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
| 82 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
| 83 | 83 | } catch (Exception $e) { |
| 84 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
| 84 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
| 85 | 85 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @uses FEATURE_GRADE_OUTCOMES |
| 102 | 102 | * @uses FEATURE_SHOW_DESCRIPTION |
| 103 | 103 | * @param string $feature |
| 104 | - * @return mixed True if yes (some features may use other values) |
|
| 104 | + * @return null|boolean True if yes (some features may use other values) |
|
| 105 | 105 | */ |
| 106 | 106 | function bigbluebuttonbn_supports($feature) { |
| 107 | 107 | if (!$feature) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * |
| 221 | 221 | * @param object $bigbluebuttonbn Id of the module instance |
| 222 | 222 | * |
| 223 | - * @return bool Success/Failure |
|
| 223 | + * @return boolean|null Success/Failure |
|
| 224 | 224 | */ |
| 225 | 225 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
| 226 | 226 | global $DB; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * @param object $mod |
| 242 | 242 | * @param object $bigbluebuttonbn |
| 243 | 243 | * |
| 244 | - * @return bool |
|
| 244 | + * @return string |
|
| 245 | 245 | */ |
| 246 | 246 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 247 | 247 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn)) { |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | * @param stdClass $context context object |
| 783 | 783 | * @param string $filearea file area |
| 784 | 784 | * |
| 785 | - * @return false|null false if file not valid |
|
| 785 | + * @return boolean false if file not valid |
|
| 786 | 786 | */ |
| 787 | 787 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
| 788 | 788 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * Remove this block when restored |
| 65 | 65 | */ |
| 66 | 66 | |
| 67 | - /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
| 67 | + /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */ |
|
| 68 | 68 | const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/'; |
| 69 | 69 | /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */ |
| 70 | 70 | const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6'; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $sql = "SELECT COUNT(*) FROM {bigbluebuttonbn_logs} "; |
| 279 | 279 | $sql .= "WHERE courseid = ? AND bigbluebuttonbnid = ? AND userid = ? AND (log = ? OR log = ?)"; |
| 280 | 280 | $result = $DB->count_records_sql($sql, array($course->id, $bigbluebuttonbn->id, $user->id, |
| 281 | - BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED)); |
|
| 281 | + BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED)); |
|
| 282 | 282 | return $result; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -507,12 +507,12 @@ discard block |
||
| 507 | 507 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
| 508 | 508 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
| 509 | 509 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
| 510 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 510 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 511 | 511 | $str .= ' </div>'."\n"; |
| 512 | 512 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
| 513 | 513 | '</div>'."\n"; |
| 514 | 514 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
| 515 | - .'</div>'."\n"; |
|
| 515 | + .'</div>'."\n"; |
|
| 516 | 516 | $str .= '</div>'."\n"; |
| 517 | 517 | return $str; |
| 518 | 518 | } |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | $bigbluebuttonbn->coursemodule, |
| 718 | 718 | 'bigbluebuttonbn', |
| 719 | 719 | $bigbluebuttonbn->id, $bigbluebuttonbn->completionexpected |
| 720 | - ); |
|
| 720 | + ); |
|
| 721 | 721 | } |
| 722 | 722 | } |
| 723 | 723 | /** |
@@ -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); |