@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @uses FEATURE_GRADE_OUTCOMES |
| 104 | 104 | * @uses FEATURE_SHOW_DESCRIPTION |
| 105 | 105 | * @param string $feature |
| 106 | - * @return mixed True if yes (some features may use other values) |
|
| 106 | + * @return null|boolean True if yes (some features may use other values) |
|
| 107 | 107 | */ |
| 108 | 108 | function bigbluebuttonbn_supports($feature) { |
| 109 | 109 | if (!$feature) { |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | * |
| 273 | 273 | * @param object $bigbluebuttonbn Id of the module instance |
| 274 | 274 | * |
| 275 | - * @return bool Success/Failure |
|
| 275 | + * @return boolean|null Success/Failure |
|
| 276 | 276 | */ |
| 277 | 277 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
| 278 | 278 | global $DB; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | * @param object $mod |
| 294 | 294 | * @param object $bigbluebuttonbn |
| 295 | 295 | * |
| 296 | - * @return bool |
|
| 296 | + * @return string |
|
| 297 | 297 | */ |
| 298 | 298 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 299 | 299 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) { |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | * @param stdClass $context context object |
| 870 | 870 | * @param string $filearea file area |
| 871 | 871 | * |
| 872 | - * @return false|null false if file not valid |
|
| 872 | + * @return boolean false if file not valid |
|
| 873 | 873 | */ |
| 874 | 874 | function bigbluebuttonbn_pluginfile_valid($context, $filearea) { |
| 875 | 875 | |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | $sql = "SELECT COUNT(*) FROM {bigbluebuttonbn_logs} "; |
| 357 | 357 | $sql .= "WHERE courseid = ? AND bigbluebuttonbnid = ? AND userid = ? AND (log = ? OR log = ?)"; |
| 358 | 358 | $result = $DB->count_records_sql($sql, array($course->id, $bigbluebuttonbn->id, $user->id, |
| 359 | - BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED)); |
|
| 359 | + BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED)); |
|
| 360 | 360 | return $result; |
| 361 | 361 | } |
| 362 | 362 | |
@@ -589,12 +589,12 @@ discard block |
||
| 589 | 589 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
| 590 | 590 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
| 591 | 591 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
| 592 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 592 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 593 | 593 | $str .= ' </div>'."\n"; |
| 594 | 594 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
| 595 | 595 | '</div>'."\n"; |
| 596 | 596 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
| 597 | - .'</div>'."\n"; |
|
| 597 | + .'</div>'."\n"; |
|
| 598 | 598 | $str .= '</div>'."\n"; |
| 599 | 599 | return $str; |
| 600 | 600 | } |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | 'bigbluebuttonbn', |
| 837 | 837 | $bigbluebuttonbn->id, |
| 838 | 838 | $bigbluebuttonbn->completionexpected |
| 839 | - ); |
|
| 839 | + ); |
|
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 | |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility. |
| 32 | 32 | if (!class_exists('\Firebase\JWT\JWT')) { |
| 33 | - if (file_exists($CFG->libdir.'/php-jwt/src/JWT.php')) { |
|
| 34 | - require_once($CFG->libdir.'/php-jwt/src/JWT.php'); |
|
| 33 | + if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) { |
|
| 34 | + require_once($CFG->libdir . '/php-jwt/src/JWT.php'); |
|
| 35 | 35 | } else { |
| 36 | - require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 36 | + require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php'); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | $CFG->bigbluebuttonbn = array(); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | -if (file_exists(dirname(__FILE__).'/config.php')) { |
|
| 45 | - require_once(dirname(__FILE__).'/config.php'); |
|
| 44 | +if (file_exists(dirname(__FILE__) . '/config.php')) { |
|
| 45 | + require_once(dirname(__FILE__) . '/config.php'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /* |
@@ -99,19 +99,19 @@ discard block |
||
| 99 | 99 | return null; |
| 100 | 100 | } |
| 101 | 101 | $features = array( |
| 102 | - (string) FEATURE_IDNUMBER => true, |
|
| 103 | - (string) FEATURE_GROUPS => true, |
|
| 104 | - (string) FEATURE_GROUPINGS => true, |
|
| 105 | - (string) FEATURE_GROUPMEMBERSONLY => true, |
|
| 106 | - (string) FEATURE_MOD_INTRO => true, |
|
| 107 | - (string) FEATURE_BACKUP_MOODLE2 => true, |
|
| 108 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 109 | - (string) FEATURE_COMPLETION_HAS_RULES => true, |
|
| 110 | - (string) FEATURE_GRADE_HAS_GRADE => false, |
|
| 111 | - (string) FEATURE_GRADE_OUTCOMES => false, |
|
| 112 | - (string) FEATURE_SHOW_DESCRIPTION => true, |
|
| 102 | + (string)FEATURE_IDNUMBER => true, |
|
| 103 | + (string)FEATURE_GROUPS => true, |
|
| 104 | + (string)FEATURE_GROUPINGS => true, |
|
| 105 | + (string)FEATURE_GROUPMEMBERSONLY => true, |
|
| 106 | + (string)FEATURE_MOD_INTRO => true, |
|
| 107 | + (string)FEATURE_BACKUP_MOODLE2 => true, |
|
| 108 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, |
|
| 109 | + (string)FEATURE_COMPLETION_HAS_RULES => true, |
|
| 110 | + (string)FEATURE_GRADE_HAS_GRADE => false, |
|
| 111 | + (string)FEATURE_GRADE_OUTCOMES => false, |
|
| 112 | + (string)FEATURE_SHOW_DESCRIPTION => true, |
|
| 113 | 113 | ); |
| 114 | - if (isset($features[(string) $feature])) { |
|
| 114 | + if (isset($features[(string)$feature])) { |
|
| 115 | 115 | return $features[$feature]; |
| 116 | 116 | } |
| 117 | 117 | return null; |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) { |
| 305 | 305 | global $DB; |
| 306 | 306 | $sql = "SELECT * FROM {bigbluebuttonbn_logs} "; |
| 307 | - $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?"; |
|
| 307 | + $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?"; |
|
| 308 | 308 | $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}")); |
| 309 | 309 | $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}"; |
| 310 | 310 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta); |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) { |
| 326 | 326 | if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) { |
| 327 | 327 | return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . |
| 328 | - get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string) $completed . ' ' . |
|
| 328 | + get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . |
|
| 329 | 329 | get_string('view_message_times', 'bigbluebuttonbn'); |
| 330 | 330 | } |
| 331 | 331 | return ''; |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | * @return array status array |
| 518 | 518 | */ |
| 519 | 519 | function bigbluebuttonbn_reset_recordings($courseid) { |
| 520 | - require_once(__DIR__.'/locallib.php'); |
|
| 520 | + require_once(__DIR__ . '/locallib.php'); |
|
| 521 | 521 | // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true]. |
| 522 | 522 | $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true); |
| 523 | 523 | // Remove all the recordings. |
@@ -586,16 +586,16 @@ discard block |
||
| 586 | 586 | if ($bigbluebuttonbn->visible) { |
| 587 | 587 | $classes = 'class="dimmed" '; |
| 588 | 588 | } |
| 589 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
| 590 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
| 591 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
| 592 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
| 593 | - $str .= ' </div>'."\n"; |
|
| 594 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). |
|
| 595 | - '</div>'."\n"; |
|
| 596 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
| 597 | - .'</div>'."\n"; |
|
| 598 | - $str .= '</div>'."\n"; |
|
| 589 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
| 590 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
| 591 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
| 592 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
| 593 | + $str .= ' </div>' . "\n"; |
|
| 594 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . |
|
| 595 | + '</div>' . "\n"; |
|
| 596 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
| 597 | + .'</div>' . "\n"; |
|
| 598 | + $str .= '</div>' . "\n"; |
|
| 599 | 599 | return $str; |
| 600 | 600 | } |
| 601 | 601 | |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | * @return void |
| 684 | 684 | **/ |
| 685 | 685 | function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) { |
| 686 | - require_once(__DIR__.'/locallib.php'); |
|
| 686 | + require_once(__DIR__ . '/locallib.php'); |
|
| 687 | 687 | $bigbluebuttonbn->timemodified = time(); |
| 688 | 688 | if ((integer)$bigbluebuttonbn->instance == 0) { |
| 689 | 689 | $bigbluebuttonbn->meetingid = 0; |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | **/ |
| 787 | 787 | function bigbluebuttonbn_process_post_save_event(&$bigbluebuttonbn) { |
| 788 | 788 | global $CFG, $DB; |
| 789 | - require_once($CFG->dirroot.'/calendar/lib.php'); |
|
| 789 | + require_once($CFG->dirroot . '/calendar/lib.php'); |
|
| 790 | 790 | $eventid = $DB->get_field('event', 'id', array('modulename' => 'bigbluebuttonbn', |
| 791 | 791 | 'instance' => $bigbluebuttonbn->id)); |
| 792 | 792 | // Delete the event from calendar when/if openingtime is NOT set. |
@@ -872,7 +872,7 @@ discard block |
||
| 872 | 872 | if (count($files) == 1) { |
| 873 | 873 | // Get the first (and only) file. |
| 874 | 874 | $file = reset($files); |
| 875 | - $filesrc = '/'.$file->get_filename(); |
|
| 875 | + $filesrc = '/' . $file->get_filename(); |
|
| 876 | 876 | } |
| 877 | 877 | return $filesrc; |
| 878 | 878 | } |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | if (!$filename) { |
| 942 | 942 | return false; |
| 943 | 943 | } |
| 944 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
| 944 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
| 945 | 945 | $fs = get_file_storage(); |
| 946 | 946 | $file = $fs->get_file_by_hash(sha1($fullpath)); |
| 947 | 947 | if (!$file || $file->is_directory()) { |