| @@ -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 | } | 
| @@ -83,19 +83,19 @@ discard block | ||
| 83 | 83 | } | 
| 84 | 84 | |
| 85 | 85 | $features = array( | 
| 86 | - (string) FEATURE_IDNUMBER => true, | |
| 87 | - (string) FEATURE_GROUPS => true, | |
| 88 | - (string) FEATURE_GROUPINGS => true, | |
| 89 | - (string) FEATURE_GROUPMEMBERSONLY => true, | |
| 90 | - (string) FEATURE_MOD_INTRO => true, | |
| 91 | - (string) FEATURE_BACKUP_MOODLE2 => true, | |
| 92 | - (string) FEATURE_COMPLETION_TRACKS_VIEWS => true, | |
| 93 | - (string) FEATURE_GRADE_HAS_GRADE => false, | |
| 94 | - (string) FEATURE_GRADE_OUTCOMES => false, | |
| 95 | - (string) FEATURE_SHOW_DESCRIPTION => true, | |
| 86 | + (string)FEATURE_IDNUMBER => true, | |
| 87 | + (string)FEATURE_GROUPS => true, | |
| 88 | + (string)FEATURE_GROUPINGS => true, | |
| 89 | + (string)FEATURE_GROUPMEMBERSONLY => true, | |
| 90 | + (string)FEATURE_MOD_INTRO => true, | |
| 91 | + (string)FEATURE_BACKUP_MOODLE2 => true, | |
| 92 | + (string)FEATURE_COMPLETION_TRACKS_VIEWS => true, | |
| 93 | + (string)FEATURE_GRADE_HAS_GRADE => false, | |
| 94 | + (string)FEATURE_GRADE_OUTCOMES => false, | |
| 95 | + (string)FEATURE_SHOW_DESCRIPTION => true, | |
| 96 | 96 | ); | 
| 97 | 97 | |
| 98 | -    if (isset($features[(string) $feature])) { | |
| 98 | +    if (isset($features[(string)$feature])) { | |
| 99 | 99 | return $features[$feature]; | 
| 100 | 100 | } | 
| 101 | 101 | |
| @@ -212,10 +212,10 @@ discard block | ||
| 212 | 212 |      $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, | 
| 213 | 213 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, | 
| 214 | 214 | 'userid' => $user->id, | 
| 215 | - 'log' => 'Join', ), '*'); | |
| 215 | + 'log' => 'Join',), '*'); | |
| 216 | 216 |      if ($completed > 0) { | 
| 217 | -        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '. | |
| 218 | -            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '. | |
| 217 | +        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . | |
| 218 | +            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . | |
| 219 | 219 |              get_string('view_message_times', 'bigbluebuttonbn'); | 
| 220 | 220 | } | 
| 221 | 221 | return ''; | 
| @@ -232,7 +232,7 @@ discard block | ||
| 232 | 232 |      $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, | 
| 233 | 233 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, | 
| 234 | 234 | 'userid' => $user->id, | 
| 235 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); | |
| 235 | + 'log' => 'Join',), '*', IGNORE_MULTIPLE); | |
| 236 | 236 | return $completed > 0; | 
| 237 | 237 | } | 
| 238 | 238 | |
| @@ -300,16 +300,16 @@ discard block | ||
| 300 | 300 |      if ($bigbluebuttonbn->visible) { | 
| 301 | 301 | $classes = 'class="dimmed" '; | 
| 302 | 302 | } | 
| 303 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; | |
| 304 | -    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; | |
| 305 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. | |
| 306 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; | |
| 307 | - $str .= ' </div>'."\n"; | |
| 308 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime). | |
| 309 | - '</div>'."\n"; | |
| 310 | -    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) | |
| 311 | - .'</div>'."\n"; | |
| 312 | - $str .= '</div>'."\n"; | |
| 303 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; | |
| 304 | +    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; | |
| 305 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . | |
| 306 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; | |
| 307 | + $str .= ' </div>' . "\n"; | |
| 308 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . | |
| 309 | + '</div>' . "\n"; | |
| 310 | +    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) | |
| 311 | + .'</div>' . "\n"; | |
| 312 | + $str .= '</div>' . "\n"; | |
| 313 | 313 | return $str; | 
| 314 | 314 | } | 
| 315 | 315 | |
| @@ -464,7 +464,7 @@ discard block | ||
| 464 | 464 |      if (count($files) == 1) { | 
| 465 | 465 | // Get the first (and only) file. | 
| 466 | 466 | $file = reset($files); | 
| 467 | - $filesrc = '/'.$file->get_filename(); | |
| 467 | + $filesrc = '/' . $file->get_filename(); | |
| 468 | 468 | } | 
| 469 | 469 | return $filesrc; | 
| 470 | 470 | } | 
| @@ -514,7 +514,7 @@ discard block | ||
| 514 | 514 |      if (!$filename) { | 
| 515 | 515 | return false; | 
| 516 | 516 | } | 
| 517 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; | |
| 517 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; | |
| 518 | 518 | $fs = get_file_storage(); | 
| 519 | 519 | $file = $fs->get_file_by_hash(sha1($fullpath)); | 
| 520 | 520 |      if (!$file || $file->is_directory()) { |