Completed
Push — master ( e66db5...3ed694 )
by Jesus
13s
created
lib.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
206 206
     global $DB;
207 207
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
208
-                                                              'bigbluebuttonbnid' => $bigbluebuttonbn->id,
209
-                                                              'userid' => $user->id,
210
-                                                              'log' => 'Join', ), '*');
208
+                                                                'bigbluebuttonbnid' => $bigbluebuttonbn->id,
209
+                                                                'userid' => $user->id,
210
+                                                                'log' => 'Join', ), '*');
211 211
     if ($completed > 0) {
212 212
         return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
213 213
             get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
 function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) {
226 226
     global $DB;
227 227
     $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id,
228
-                                                              'bigbluebuttonbnid' => $bigbluebuttonbn->id,
229
-                                                              'userid' => $user->id,
230
-                                                              'log' => 'Join', ), '*', IGNORE_MULTIPLE);
228
+                                                                'bigbluebuttonbnid' => $bigbluebuttonbn->id,
229
+                                                                'userid' => $user->id,
230
+                                                                'log' => 'Join', ), '*', IGNORE_MULTIPLE);
231 231
     return $completed > 0;
232 232
 }
233 233
 
@@ -299,12 +299,12 @@  discard block
 block discarded – undo
299 299
     $str = '<div class="bigbluebuttonbn overview">'."\n";
300 300
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
301 301
     $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
302
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
302
+        '">'.$bigbluebuttonbn->name.'</a>'."\n";
303 303
     $str .= '  </div>'."\n";
304 304
     $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
305 305
         '</div>'."\n";
306 306
     $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
307
-      .'</div>'."\n";
307
+        .'</div>'."\n";
308 308
     $str .= '</div>'."\n";
309 309
 
310 310
     return $str;
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -27,32 +27,32 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -207,10 +207,10 @@  discard block
 block discarded – undo
207 207
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
208 208
                                                               'bigbluebuttonbnid' => $bigbluebuttonbn->id,
209 209
                                                               'userid' => $user->id,
210
-                                                              'log' => 'Join', ), '*');
210
+                                                              'log' => 'Join',), '*');
211 211
     if ($completed > 0) {
212
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
213
-            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
212
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
213
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
214 214
             get_string('view_message_times', 'bigbluebuttonbn');
215 215
     }
216 216
     return '';
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id,
228 228
                                                               'bigbluebuttonbnid' => $bigbluebuttonbn->id,
229 229
                                                               'userid' => $user->id,
230
-                                                              'log' => 'Join', ), '*', IGNORE_MULTIPLE);
230
+                                                              'log' => 'Join',), '*', IGNORE_MULTIPLE);
231 231
     return $completed > 0;
232 232
 }
233 233
 
@@ -296,16 +296,16 @@  discard block
 block discarded – undo
296 296
     if ($bigbluebuttonbn->visible) {
297 297
         $classes = 'class="dimmed" ';
298 298
     }
299
-    $str = '<div class="bigbluebuttonbn overview">'."\n";
300
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
301
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
302
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
303
-    $str .= '  </div>'."\n";
304
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
305
-        '</div>'."\n";
306
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
307
-      .'</div>'."\n";
308
-    $str .= '</div>'."\n";
299
+    $str = '<div class="bigbluebuttonbn overview">' . "\n";
300
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
301
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
302
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
303
+    $str .= '  </div>' . "\n";
304
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
305
+        '</div>' . "\n";
306
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
307
+      .'</div>' . "\n";
308
+    $str .= '</div>' . "\n";
309 309
 
310 310
     return $str;
311 311
 }
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
     /* Now that an id was assigned, generate and set the meetingid property based on
397 397
      * [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) */
398 398
     if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) {
399
-        $meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
399
+        $meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
400 400
         $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $bigbluebuttonbn->id));
401 401
 
402 402
         $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn');
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
     if (count($files) == 1) {
479 479
         // Get the first (and only) file.
480 480
         $file = reset($files);
481
-        $filesrc = '/'.$file->get_filename();
481
+        $filesrc = '/' . $file->get_filename();
482 482
     }
483 483
     // Set the presentation column in the bigbluebuttonbn table.
484 484
     $DB->set_field('bigbluebuttonbn', 'presentation', $filesrc, array('id' => $bigbluebuttonbnid));
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
         return false;
536 536
     }
537 537
 
538
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
538
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
539 539
     $fs = get_file_storage();
540 540
     $file = $fs->get_file_by_hash(sha1($fullpath));
541 541
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.