Completed
Push — master ( c705de...72ce29 )
by Jesus
02:21 queued 11s
created
lib.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -28,23 +28,23 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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').':&nbsp;'."\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') . ':&nbsp;' . "\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
 
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
  * @return void
566 566
  **/
567 567
 function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) {
568
-    require_once(__DIR__.'/locallib.php');
568
+    require_once(__DIR__ . '/locallib.php');
569 569
     $bigbluebuttonbn->timemodified = time();
570 570
     if ((integer)$bigbluebuttonbn->instance == 0) {
571 571
         $bigbluebuttonbn->meetingid = 0;
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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()) {
Please login to merge, or discard this patch.