Completed
Pull Request — master (#173)
by
unknown
02:53
created
lib.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
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';
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     $sql = "SELECT COUNT(*) FROM {bigbluebuttonbn_logs} ";
376 376
     $sql .= "WHERE courseid = ? AND bigbluebuttonbnid = ? AND userid = ? AND (log = ? OR log = ?)";
377 377
     $result = $DB->count_records_sql($sql, array($course->id, $bigbluebuttonbn->id, $user->id,
378
-                                              BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED));
378
+                                                BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED));
379 379
     return $result;
380 380
 }
381 381
 
@@ -620,12 +620,12 @@  discard block
 block discarded – undo
620 620
     $str  = '<div class="bigbluebuttonbn overview">'."\n";
621 621
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
622 622
     $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
623
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
623
+        '">'.$bigbluebuttonbn->name.'</a>'."\n";
624 624
     $str .= '  </div>'."\n";
625 625
     $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
626 626
         '</div>'."\n";
627 627
     $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
628
-      .'</div>'."\n";
628
+        .'</div>'."\n";
629 629
     $str .= '</div>'."\n";
630 630
     return $str;
631 631
 }
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
             'bigbluebuttonbn',
878 878
             $bigbluebuttonbn->id,
879 879
             $bigbluebuttonbn->completionexpected
880
-          );
880
+            );
881 881
     }
882 882
 }
883 883
 
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -28,22 +28,22 @@  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.'/tag/lib.php');
34
-require_once($CFG->libdir.'/accesslib.php');
35
-require_once($CFG->libdir.'/completionlib.php');
36
-require_once($CFG->libdir.'/datalib.php');
37
-require_once($CFG->libdir.'/enrollib.php');
38
-require_once($CFG->libdir.'/filelib.php');
39
-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 . '/tag/lib.php');
34
+require_once($CFG->libdir . '/accesslib.php');
35
+require_once($CFG->libdir . '/completionlib.php');
36
+require_once($CFG->libdir . '/datalib.php');
37
+require_once($CFG->libdir . '/enrollib.php');
38
+require_once($CFG->libdir . '/filelib.php');
39
+require_once($CFG->libdir . '/formslib.php');
40 40
 
41 41
 // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility.
42 42
 if (!class_exists('\Firebase\JWT\JWT')) {
43
-    if (file_exists($CFG->libdir.'/php-jwt/src/JWT.php')) {
44
-        require_once($CFG->libdir.'/php-jwt/src/JWT.php');
43
+    if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) {
44
+        require_once($CFG->libdir . '/php-jwt/src/JWT.php');
45 45
     } else {
46
-        require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php');
46
+        require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php');
47 47
     }
48 48
 }
49 49
 
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
     $CFG->bigbluebuttonbn = array();
52 52
 }
53 53
 
54
-if (file_exists(dirname(__FILE__).'/config.php')) {
55
-    require_once(dirname(__FILE__).'/config.php');
54
+if (file_exists(dirname(__FILE__) . '/config.php')) {
55
+    require_once(dirname(__FILE__) . '/config.php');
56 56
 }
57 57
 
58 58
 /*
@@ -109,19 +109,19 @@  discard block
 block discarded – undo
109 109
         return null;
110 110
     }
111 111
     $features = array(
112
-        (string) FEATURE_IDNUMBER => true,
113
-        (string) FEATURE_GROUPS => true,
114
-        (string) FEATURE_GROUPINGS => true,
115
-        (string) FEATURE_GROUPMEMBERSONLY => true,
116
-        (string) FEATURE_MOD_INTRO => true,
117
-        (string) FEATURE_BACKUP_MOODLE2 => true,
118
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
119
-        (string) FEATURE_COMPLETION_HAS_RULES => true,
120
-        (string) FEATURE_GRADE_HAS_GRADE => false,
121
-        (string) FEATURE_GRADE_OUTCOMES => false,
122
-        (string) FEATURE_SHOW_DESCRIPTION => true,
112
+        (string)FEATURE_IDNUMBER => true,
113
+        (string)FEATURE_GROUPS => true,
114
+        (string)FEATURE_GROUPINGS => true,
115
+        (string)FEATURE_GROUPMEMBERSONLY => true,
116
+        (string)FEATURE_MOD_INTRO => true,
117
+        (string)FEATURE_BACKUP_MOODLE2 => true,
118
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
119
+        (string)FEATURE_COMPLETION_HAS_RULES => true,
120
+        (string)FEATURE_GRADE_HAS_GRADE => false,
121
+        (string)FEATURE_GRADE_OUTCOMES => false,
122
+        (string)FEATURE_SHOW_DESCRIPTION => true,
123 123
     );
124
-    if (isset($features[(string) $feature])) {
124
+    if (isset($features[(string)$feature])) {
125 125
         return $features[$feature];
126 126
     }
127 127
     return null;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) {
315 315
     global $DB;
316 316
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
317
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
317
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
318 318
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
319 319
     $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}";
320 320
     bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta);
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
336 336
     if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) {
337 337
         return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
338
-            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string) $completed . ' ' .
338
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
339 339
             get_string('view_message_times', 'bigbluebuttonbn');
340 340
     }
341 341
     return '';
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
  * @return array status array
527 527
  */
528 528
 function bigbluebuttonbn_reset_recordings($courseid) {
529
-    require_once(__DIR__.'/locallib.php');
529
+    require_once(__DIR__ . '/locallib.php');
530 530
     // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true].
531 531
     $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true);
532 532
     // Remove all the recordings.
@@ -594,16 +594,16 @@  discard block
 block discarded – undo
594 594
     if ($bigbluebuttonbn->visible) {
595 595
         $classes = 'class="dimmed" ';
596 596
     }
597
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
598
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
599
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
600
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
601
-    $str .= '  </div>'."\n";
602
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
603
-        '</div>'."\n";
604
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
605
-      .'</div>'."\n";
606
-    $str .= '</div>'."\n";
597
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
598
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
599
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
600
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
601
+    $str .= '  </div>' . "\n";
602
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
603
+        '</div>' . "\n";
604
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
605
+      .'</div>' . "\n";
606
+    $str .= '</div>' . "\n";
607 607
     return $str;
608 608
 }
609 609
 
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
  * @return void
692 692
  **/
693 693
 function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) {
694
-    require_once(__DIR__.'/locallib.php');
694
+    require_once(__DIR__ . '/locallib.php');
695 695
     $bigbluebuttonbn->timemodified = time();
696 696
     if ((integer)$bigbluebuttonbn->instance == 0) {
697 697
         $bigbluebuttonbn->meetingid = 0;
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
     if (count($files) == 1) {
880 880
         // Get the first (and only) file.
881 881
         $file = reset($files);
882
-        $filesrc = '/'.$file->get_filename();
882
+        $filesrc = '/' . $file->get_filename();
883 883
     }
884 884
     return $filesrc;
885 885
 }
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
     if (!$filename) {
949 949
         return false;
950 950
     }
951
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
951
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
952 952
     $fs = get_file_storage();
953 953
     $file = $fs->get_file_by_hash(sha1($fullpath));
954 954
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
brokerlib.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
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
     }
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
             array('HS256')
560 560
         );
561 561
     } catch (Exception $e) {
562
-        $error = 'Caught exception: '.$e->getMessage();
563
-        header('HTTP/1.0 400 Bad Request. '.$error);
562
+        $error = 'Caught exception: ' . $e->getMessage();
563
+        header('HTTP/1.0 400 Bad Request. ' . $error);
564 564
         return;
565 565
     }
566 566
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -590,8 +590,8 @@  discard block
 block discarded – undo
590 590
         bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, json_encode($meta));
591 591
         header('HTTP/1.0 202 Accepted');
592 592
     } catch (Exception $e) {
593
-        $error = 'Caught exception: '.$e->getMessage();
594
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
593
+        $error = 'Caught exception: ' . $e->getMessage();
594
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
595 595
     }
596 596
 }
597 597
 
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
613 613
     if (!isset($importrecordings[$params['id']])) {
614 614
         $error = "Recording {$params['id']} could not be found. It can not be imported";
615
-        header('HTTP/1.0 404 Not found. '.$error);
615
+        header('HTTP/1.0 404 Not found. ' . $error);
616 616
         return;
617 617
     }
618 618
     $callbackresponse = array('status' => true);
619 619
     $importrecordings[$params['id']]['imported'] = true;
620 620
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
621
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
621
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
622 622
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
623 623
     // Moodle event logger: Create an event for recording imported.
624 624
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
     $action = strtolower($params['action']);
713 713
     $requiredparams = bigbluebuttonbn_broker_required_parameters();
714 714
     if (!array_key_exists($action, $requiredparams)) {
715
-        return 'Action '.$params['action'].' can not be performed.';
715
+        return 'Action ' . $params['action'] . ' can not be performed.';
716 716
     }
717 717
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
718 718
 }
Please login to merge, or discard this patch.
classes/locallib/notifier.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
      *
112 112
      * @param object $bigbluebuttonbn
113 113
      *
114
-     * @return void
114
+     * @return string
115 115
      */
116 116
     public static function htmlmsg_recording_ready($bigbluebuttonbn) {
117 117
         return '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -44,29 +44,29 @@  discard block
 block discarded – undo
44 44
      * @return string
45 45
      */
46 46
     public static function htmlmsg_instance_updated($msg) {
47
-        $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.
48
-            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
49
-        $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.
50
-            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
51
-        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
52
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
53
-            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
54
-        $messagetext .= $msg->activity_title.'</td></tr>'."\n";
55
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
56
-            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
57
-        $messagetext .= $msg->activity_description.'</td></tr>'."\n";
58
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
59
-            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
60
-        $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";
61
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
62
-            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
63
-        $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";
64
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.
65
-            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
66
-        $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
67
-        $messagetext .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.
68
-            $msg->user_name.'('.$msg->user_email.') ';
69
-        $messagetext .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
47
+        $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' .
48
+            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
49
+        $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .
50
+            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
51
+        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
52
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
53
+            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
54
+        $messagetext .= $msg->activity_title . '</td></tr>' . "\n";
55
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
56
+            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
57
+        $messagetext .= $msg->activity_description . '</td></tr>' . "\n";
58
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
59
+            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
60
+        $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";
61
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
62
+            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
63
+        $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";
64
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .
65
+            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
66
+        $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
67
+        $messagetext .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' .
68
+            $msg->user_name . '(' . $msg->user_email . ') ';
69
+        $messagetext .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
70 70
         return $messagetext;
71 71
     }
72 72
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $course = $coursemodinfo->get_course($bigbluebuttonbn->course);
84 84
         $sender = $USER;
85 85
         // Prepare message.
86
-        $msg = (object) array();
86
+        $msg = (object)array();
87 87
         // Build the message_body.
88 88
         $msg->action = $action;
89 89
         $msg->activity_type = '';
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
      * @return void
115 115
      */
116 116
     public static function htmlmsg_recording_ready($bigbluebuttonbn) {
117
-        return '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
118
-            ' &quot;' . $bigbluebuttonbn->name . '&quot; '.
119
-            get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
117
+        return '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') .
118
+            ' &quot;' . $bigbluebuttonbn->name . '&quot; ' .
119
+            get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
120 120
     }
121 121
 
122 122
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                     // Enqueue it.
159 159
                     \core\task\manager::queue_adhoc_task($task);
160 160
                 } catch (Exception $e) {
161
-                    mtrace("Error while enqueuing completion_uopdate_state task. " . (string) $e);
161
+                    mtrace("Error while enqueuing completion_uopdate_state task. " . (string)$e);
162 162
                 }
163 163
             }
164 164
         }
Please login to merge, or discard this patch.
locallib.php 2 patches
Doc Comments   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
  * Helper function to retrieve imported recordings from the Moodle database.
307 307
  * The references are stored as events in bigbluebuttonbn_logs.
308 308
  *
309
- * @param string $courseid
309
+ * @param integer $courseid
310 310
  * @param string $bigbluebuttonbnid
311 311
  * @param bool   $subset
312 312
  *
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 /**
335 335
  * Helper function to retrive the default config.xml file.
336 336
  *
337
- * @return string
337
+ * @return null|SimpleXMLElement
338 338
  */
339 339
 function bigbluebuttonbn_get_default_config_xml() {
340 340
     $xml = bigbluebuttonbn_wrap_xml_load_file(
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
  * @param object $a
417 417
  * @param object $b
418 418
  *
419
- * @return array
419
+ * @return integer
420 420
  */
421 421
 function bigbluebuttonbn_recording_build_sorter($a, $b) {
422 422
     global $CFG;
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
  * @param string $data
531 531
  * @param string $contenttype
532 532
  *
533
- * @return object
533
+ * @return null|SimpleXMLElement
534 534
  */
535 535
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
536 536
     if (extension_loaded('curl')) {
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
  * @param string $data
572 572
  * @param string $contenttype
573 573
  *
574
- * @return object
574
+ * @return string
575 575
  */
576 576
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
577 577
     $c = new curl();
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
  * @param integer $instance
945 945
  * @param integer $voicebridge
946 946
  *
947
- * @return string
947
+ * @return boolean
948 948
  */
949 949
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
950 950
     global $DB;
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
  * @param string $meetingid
1293 1293
  * @param string $configxml
1294 1294
  *
1295
- * @return object
1295
+ * @return null|SimpleXMLElement
1296 1296
  */
1297 1297
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1298 1298
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
  * @param array $recording
1347 1347
  * @param array $tools
1348 1348
  *
1349
- * @return array
1349
+ * @return null|stdClass
1350 1350
  */
1351 1351
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1352 1352
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
  *
1982 1982
  * @param array $bbbsession
1983 1983
  * @param array $recording
1984
- * @param object $rowdata
1984
+ * @param stdClass $rowdata
1985 1985
  *
1986 1986
  * @return object
1987 1987
  */
@@ -2176,7 +2176,7 @@  discard block
 block discarded – undo
2176 2176
  *
2177 2177
  * @param array $bbbsession
2178 2178
  * @param array $recordings
2179
- * @param array $tools
2179
+ * @param string[] $tools
2180 2180
  *
2181 2181
  * @return array
2182 2182
  */
@@ -2257,7 +2257,7 @@  discard block
 block discarded – undo
2257 2257
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2258 2258
  * in the getRecordings request considering only those that belong to deleted activities.
2259 2259
  *
2260
- * @param string $courseid
2260
+ * @param integer $courseid
2261 2261
  * @param string $bigbluebuttonbnid
2262 2262
  * @param bool   $subset
2263 2263
  *
@@ -2281,7 +2281,7 @@  discard block
 block discarded – undo
2281 2281
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2282 2282
  * in the getRecordings request considering only those that belong to imported recordings.
2283 2283
  *
2284
- * @param string $courseid
2284
+ * @param integer $courseid
2285 2285
  * @param string $bigbluebuttonbnid
2286 2286
  * @param bool   $subset
2287 2287
  *
@@ -2304,7 +2304,7 @@  discard block
 block discarded – undo
2304 2304
 /**
2305 2305
  * Helper function to get recordings and imported recordings together.
2306 2306
  *
2307
- * @param string $courseid
2307
+ * @param integer $courseid
2308 2308
  * @param string $bigbluebuttonbnid
2309 2309
  * @param bool   $subset
2310 2310
  * @param bool   $includedeleted
@@ -2322,7 +2322,7 @@  discard block
 block discarded – undo
2322 2322
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2323 2323
  * in bigbluebuttonbn_logs.
2324 2324
  *
2325
- * @param string $courseid
2325
+ * @param integer $courseid
2326 2326
  * @param string $bigbluebuttonbnid
2327 2327
  * @param bool   $subset
2328 2328
  * @param bool   $includedeleted
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     }
191 191
     if ($xml) {
192 192
         // Either failure or success without meeting info.
193
-        return (array) $xml;
193
+        return (array)$xml;
194 194
     }
195 195
     // If the server is unreachable, then prompts the user of the necessary action.
196 196
     return array('returncode' => 'FAILED', 'message' => 'unreachable', 'messageKey' => 'Server is unreachable');
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
                 foreach ($recordingxml->breakoutRooms->breakoutRoom as $breakoutroom) {
270 270
                     $url = \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url(
271 271
                         'getRecordings',
272
-                        ['recordID' => implode(',', (array) $breakoutroom)]
272
+                        ['recordID' => implode(',', (array)$breakoutroom)]
273 273
                     );
274 274
                     $xml = bigbluebuttonbn_wrap_xml_load_file($url);
275 275
                     if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         // Override imported flag with actual ID.
326 326
         $recording['imported'] = $recordimported->id;
327 327
         if (isset($recordimported->protected)) {
328
-            $recording['protected'] = (string) $recordimported->protected;
328
+            $recording['protected'] = (string)$recordimported->protected;
329 329
         }
330 330
         $recordsimportedarray[$recording['recordID']] = $recording;
331 331
     }
@@ -355,21 +355,21 @@  discard block
 block discarded – undo
355 355
     // Add formats.
356 356
     $playbackarray = array();
357 357
     foreach ($recording->playback->format as $format) {
358
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
359
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
358
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
359
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
360 360
         // Add preview per format when existing.
361 361
         if ($format->preview) {
362
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
362
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
363 363
         }
364 364
     }
365 365
     // Add the metadata to the recordings array.
366 366
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
367
-    $recordingarray = array('recordID' => (string) $recording->recordID,
368
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
369
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
370
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
367
+    $recordingarray = array('recordID' => (string)$recording->recordID,
368
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
369
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
370
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
371 371
     if (isset($recording->protected)) {
372
-        $recordingarray['protected'] = (string) $recording->protected;
372
+        $recordingarray['protected'] = (string)$recording->protected;
373 373
     }
374 374
     return $recordingarray + $metadataarray;
375 375
 }
@@ -384,9 +384,9 @@  discard block
 block discarded – undo
384 384
 function bigbluebuttonbn_get_recording_preview_images($preview) {
385 385
     $imagesarray = array();
386 386
     foreach ($preview->images->image as $image) {
387
-        $imagearray = array('url' => trim((string) $image));
387
+        $imagearray = array('url' => trim((string)$image));
388 388
         foreach ($image->attributes() as $attkey => $attvalue) {
389
-            $imagearray[$attkey] = (string) $attvalue;
389
+            $imagearray[$attkey] = (string)$attvalue;
390 390
         }
391 391
         array_push($imagesarray, $imagearray);
392 392
     }
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
     $ids = explode(',', $recordids);
482 482
     foreach ($ids as $id) {
483 483
         $xml = bigbluebuttonbn_wrap_xml_load_file(
484
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
484
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
485 485
         );
486 486
         if ($xml && $xml->returncode != 'SUCCESS') {
487 487
             return false;
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
  * @return array $users
651 651
  */
652 652
 function bigbluebuttonbn_get_users(context $context = null) {
653
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
653
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
654 654
     foreach ($users as $key => $value) {
655 655
         $users[$key] = fullname($value);
656 656
     }
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 function bigbluebuttonbn_get_users_select(context $context = null, $bbactivityid = 0) {
668 668
     // CONTRIB-7972, check the group of current user and course group mode.
669 669
     $groups = null;
670
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
670
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
671 671
     if ($bbactivityid) {
672 672
         list($course, $cm) = get_course_and_cm_from_instance($bbactivityid, 'bigbluebuttonbn');
673 673
         $groupmode = groups_get_activity_groupmode($cm);
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
             $groups = groups_get_all_groups($course->id, $USER->id);
677 677
             $users = [];
678 678
             foreach ($groups as $g) {
679
-                $users += (array) get_enrolled_users($context, '', $g->id, 'u.*', null, 0, 0, true);
679
+                $users += (array)get_enrolled_users($context, '', $g->id, 'u.*', null, 0, 0, true);
680 680
             }
681 681
         }
682 682
     }
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
  * @return array $roles
696 696
  */
697 697
 function bigbluebuttonbn_get_roles(context $context = null) {
698
-    $roles = (array) role_get_names($context);
698
+    $roles = (array)role_get_names($context);
699 699
     foreach ($roles as $key => $value) {
700 700
         $roles[$key] = $value->localname;
701 701
     }
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
  * @return array $users
711 711
  */
712 712
 function bigbluebuttonbn_get_roles_select(context $context = null) {
713
-    $roles = (array) role_get_names($context);
713
+    $roles = (array)role_get_names($context);
714 714
     foreach ($roles as $key => $value) {
715 715
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
716 716
     }
@@ -725,9 +725,9 @@  discard block
 block discarded – undo
725 725
  * @return object $role
726 726
  */
727 727
 function bigbluebuttonbn_get_role($id) {
728
-    $roles = (array) role_get_names();
728
+    $roles = (array)role_get_names();
729 729
     if (is_numeric($id) && isset($roles[$id])) {
730
-        return (object) $roles[$id];
730
+        return (object)$roles[$id];
731 731
     }
732 732
     foreach ($roles as $role) {
733 733
         if ($role->shortname == $id) {
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
             if (!empty($ownerid) && is_enrolled($context, $ownerid)) {
808 808
                 $participantlist[] = array(
809 809
                     'selectiontype' => 'user',
810
-                    'selectionid' => (string) $ownerid,
810
+                    'selectionid' => (string)$ownerid,
811 811
                     'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
812 812
             }
813 813
             continue;
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
     $now = time();
990 990
     if ($closingtime > 0 && $now < $closingtime) {
991 991
         $duration = ceil(($closingtime - $now) / 60);
992
-        $compensationtime = intval((int) \mod_bigbluebuttonbn\locallib\config::get('scheduled_duration_compensation'));
992
+        $compensationtime = intval((int)\mod_bigbluebuttonbn\locallib\config::get('scheduled_duration_compensation'));
993 993
         $duration = intval($duration) + $compensationtime;
994 994
     }
995 995
     return $duration;
@@ -1191,16 +1191,16 @@  discard block
 block discarded – undo
1191 1191
  * @return array
1192 1192
  */
1193 1193
 function bigbluebuttonbn_get_meeting_info($meetingid, $updatecache = false) {
1194
-    $cachettl = (int) \mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
1194
+    $cachettl = (int)\mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
1195 1195
     $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache');
1196 1196
     $result = $cache->get($meetingid);
1197 1197
     $now = time();
1198 1198
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1199 1199
         // Use the value in the cache.
1200
-        return (array) json_decode($result['meeting_info']);
1200
+        return (array)json_decode($result['meeting_info']);
1201 1201
     }
1202 1202
     // Ping again and refresh the cache.
1203
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1203
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1204 1204
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1205 1205
     );
1206 1206
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
  */
1348 1348
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1349 1349
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1350
-    $configxmlarray = (array) $configxml;
1350
+    $configxmlarray = (array)$configxml;
1351 1351
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1352 1352
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1353 1353
         return '';
@@ -1402,7 +1402,7 @@  discard block
 block discarded – undo
1402 1402
  * @return boolean
1403 1403
  */
1404 1404
 function bigbluebuttonbn_get_recording_data_row_editable($bbbsession) {
1405
-    return ($bbbsession['managerecordings'] && ((double) $bbbsession['serverversion'] >= 1.0 || $bbbsession['bnserver']));
1405
+    return ($bbbsession['managerecordings'] && ((double)$bbbsession['serverversion'] >= 1.0 || $bbbsession['bnserver']));
1406 1406
 }
1407 1407
 
1408 1408
 /**
@@ -1413,7 +1413,7 @@  discard block
 block discarded – undo
1413 1413
  * @return boolean
1414 1414
  */
1415 1415
 function bigbluebuttonbn_get_recording_data_preview_enabled($bbbsession) {
1416
-    return ((double) $bbbsession['serverversion'] >= 1.0 && $bbbsession['bigbluebuttonbn']->recordings_preview == '1');
1416
+    return ((double)$bbbsession['serverversion'] >= 1.0 && $bbbsession['bigbluebuttonbn']->recordings_preview == '1');
1417 1417
 }
1418 1418
 
1419 1419
 /**
@@ -1837,7 +1837,7 @@  discard block
 block discarded – undo
1837 1837
     }
1838 1838
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1839 1839
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording' . ucfirst($data['action']) . '(this);';
1840
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1840
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1841 1841
         // With icon for $manageaction.
1842 1842
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1843 1843
         $linkattributes = array(
@@ -2121,7 +2121,7 @@  discard block
 block discarded – undo
2121 2121
         // Enqueue it.
2122 2122
         \core\task\manager::queue_adhoc_task($task);
2123 2123
     } catch (Exception $e) {
2124
-        mtrace("Error while enqueuing completion_update_state task. " . (string) $e);
2124
+        mtrace("Error while enqueuing completion_update_state task. " . (string)$e);
2125 2125
     }
2126 2126
 }
2127 2127
 
@@ -2658,7 +2658,7 @@  discard block
 block discarded – undo
2658 2658
  */
2659 2659
 function bigbluebuttonbn_settings_general(&$renderer) {
2660 2660
     // Configuration for BigBlueButton.
2661
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_general_shown()) {
2661
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_general_shown()) {
2662 2662
         $renderer->render_group_header('general');
2663 2663
         $renderer->render_group_element(
2664 2664
             'server_url',
@@ -2680,7 +2680,7 @@  discard block
 block discarded – undo
2680 2680
  */
2681 2681
 function bigbluebuttonbn_settings_record(&$renderer) {
2682 2682
     // Configuration for 'recording' feature.
2683
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_record_meeting_shown()) {
2683
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_record_meeting_shown()) {
2684 2684
         $renderer->render_group_header('recording');
2685 2685
         $renderer->render_group_element(
2686 2686
             'recording_default',
@@ -2724,7 +2724,7 @@  discard block
 block discarded – undo
2724 2724
  */
2725 2725
 function bigbluebuttonbn_settings_importrecordings(&$renderer) {
2726 2726
     // Configuration for 'import recordings' feature.
2727
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_import_recordings_shown()) {
2727
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_import_recordings_shown()) {
2728 2728
         $renderer->render_group_header('importrecordings');
2729 2729
         $renderer->render_group_element(
2730 2730
             'importrecordings_enabled',
@@ -2746,7 +2746,7 @@  discard block
 block discarded – undo
2746 2746
  */
2747 2747
 function bigbluebuttonbn_settings_showrecordings(&$renderer) {
2748 2748
     // Configuration for 'show recordings' feature.
2749
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_show_recordings_shown()) {
2749
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_show_recordings_shown()) {
2750 2750
         $renderer->render_group_header('recordings');
2751 2751
         $renderer->render_group_element(
2752 2752
             'recordings_html_default',
@@ -2796,7 +2796,7 @@  discard block
 block discarded – undo
2796 2796
  */
2797 2797
 function bigbluebuttonbn_settings_waitmoderator(&$renderer) {
2798 2798
     // Configuration for wait for moderator feature.
2799
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_wait_moderator_shown()) {
2799
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_wait_moderator_shown()) {
2800 2800
         $renderer->render_group_header('waitformoderator');
2801 2801
         $renderer->render_group_element(
2802 2802
             'waitformoderator_default',
@@ -2826,7 +2826,7 @@  discard block
 block discarded – undo
2826 2826
  */
2827 2827
 function bigbluebuttonbn_settings_voicebridge(&$renderer) {
2828 2828
     // Configuration for "static voice bridge" feature.
2829
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_static_voice_bridge_shown()) {
2829
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_static_voice_bridge_shown()) {
2830 2830
         $renderer->render_group_header('voicebridge');
2831 2831
         $renderer->render_group_element(
2832 2832
             'voicebridge_editable',
@@ -2844,7 +2844,7 @@  discard block
 block discarded – undo
2844 2844
  */
2845 2845
 function bigbluebuttonbn_settings_preupload(&$renderer) {
2846 2846
     // Configuration for "preupload presentation" feature.
2847
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2847
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2848 2848
         // This feature only works if curl is installed.
2849 2849
         $preuploaddescripion = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn');
2850 2850
         if (!extension_loaded('curl')) {
@@ -2872,7 +2872,7 @@  discard block
 block discarded – undo
2872 2872
  */
2873 2873
 function bigbluebuttonbn_settings_preupload_manage_default_file(&$renderer) {
2874 2874
     // Configuration for "preupload presentation" feature.
2875
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2875
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2876 2876
         if (extension_loaded('curl')) {
2877 2877
             // This feature only works if curl is installed.
2878 2878
             $renderer->render_filemanager_default_file_presentation("presentation_default");
@@ -2889,7 +2889,7 @@  discard block
 block discarded – undo
2889 2889
  */
2890 2890
 function bigbluebuttonbn_settings_userlimit(&$renderer) {
2891 2891
     // Configuration for "user limit" feature.
2892
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_user_limit_shown()) {
2892
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_user_limit_shown()) {
2893 2893
         $renderer->render_group_header('userlimit');
2894 2894
         $renderer->render_group_element(
2895 2895
             'userlimit_default',
@@ -2911,7 +2911,7 @@  discard block
 block discarded – undo
2911 2911
  */
2912 2912
 function bigbluebuttonbn_settings_duration(&$renderer) {
2913 2913
     // Configuration for "scheduled duration" feature.
2914
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_scheduled_duration_shown()) {
2914
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_scheduled_duration_shown()) {
2915 2915
         $renderer->render_group_header('scheduled');
2916 2916
         $renderer->render_group_element(
2917 2917
             'scheduled_duration_enabled',
@@ -2937,7 +2937,7 @@  discard block
 block discarded – undo
2937 2937
  */
2938 2938
 function bigbluebuttonbn_settings_participants(&$renderer) {
2939 2939
     // Configuration for defining the default role/user that will be moderator on new activities.
2940
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_moderator_default_shown()) {
2940
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_moderator_default_shown()) {
2941 2941
         $renderer->render_group_header('participant');
2942 2942
         // UI for 'participants' feature.
2943 2943
         $roles = bigbluebuttonbn_get_roles();
@@ -2962,7 +2962,7 @@  discard block
 block discarded – undo
2962 2962
  */
2963 2963
 function bigbluebuttonbn_settings_notifications(&$renderer) {
2964 2964
     // Configuration for "send notifications" feature.
2965
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_send_notifications_shown()) {
2965
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_send_notifications_shown()) {
2966 2966
         $renderer->render_group_header('sendnotifications');
2967 2967
         $renderer->render_group_element(
2968 2968
             'sendnotifications_enabled',
@@ -2980,14 +2980,14 @@  discard block
 block discarded – undo
2980 2980
  */
2981 2981
 function bigbluebuttonbn_settings_clienttype(&$renderer) {
2982 2982
     // Configuration for "clienttype" feature.
2983
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_clienttype_shown()) {
2983
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_clienttype_shown()) {
2984 2984
         $renderer->render_group_header('clienttype');
2985 2985
         $renderer->render_group_element(
2986 2986
             'clienttype_editable',
2987 2987
             $renderer->render_group_element_checkbox('clienttype_editable', 0)
2988 2988
         );
2989 2989
         // Web Client default.
2990
-        $default = intval((int) \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
2990
+        $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
2991 2991
         $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
2992 2992
             BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2993 2993
         $renderer->render_group_element(
@@ -3010,7 +3010,7 @@  discard block
 block discarded – undo
3010 3010
  */
3011 3011
 function bigbluebuttonbn_settings_muteonstart(&$renderer) {
3012 3012
     // Configuration for BigBlueButton.
3013
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_muteonstart_shown()) {
3013
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_muteonstart_shown()) {
3014 3014
         $renderer->render_group_header('muteonstart');
3015 3015
         $renderer->render_group_element(
3016 3016
             'muteonstart_default',
@@ -3032,7 +3032,7 @@  discard block
 block discarded – undo
3032 3032
  */
3033 3033
 function bigbluebuttonbn_settings_extended(&$renderer) {
3034 3034
     // Configuration for 'notify users when recording ready' feature.
3035
-    if (!(boolean) \mod_bigbluebuttonbn\settings\validator::section_settings_extended_shown()) {
3035
+    if (!(boolean)\mod_bigbluebuttonbn\settings\validator::section_settings_extended_shown()) {
3036 3036
         return;
3037 3037
     }
3038 3038
     $renderer->render_group_header('extended_capabilities');
@@ -3060,7 +3060,7 @@  discard block
 block discarded – undo
3060 3060
     global $DB;
3061 3061
     do {
3062 3062
         $encodedseed = sha1(bigbluebuttonbn_random_password(12));
3063
-        $meetingid = (string) $DB->get_field('bigbluebuttonbn', 'meetingid', array('meetingid' => $encodedseed));
3063
+        $meetingid = (string)$DB->get_field('bigbluebuttonbn', 'meetingid', array('meetingid' => $encodedseed));
3064 3064
     } while ($meetingid == $encodedseed);
3065 3065
     return $encodedseed;
3066 3066
 }
@@ -3273,7 +3273,7 @@  discard block
 block discarded – undo
3273 3273
 function bigbluebuttonbn_instance_ownerid($bigbluebuttonbn) {
3274 3274
     global $DB;
3275 3275
     $filters = array('bigbluebuttonbnid' => $bigbluebuttonbn->id, 'log' => 'Add');
3276
-    $ownerid = (integer) $DB->get_field('bigbluebuttonbn_logs', 'userid', $filters);
3276
+    $ownerid = (integer)$DB->get_field('bigbluebuttonbn_logs', 'userid', $filters);
3277 3277
     return $ownerid;
3278 3278
 }
3279 3279
 
@@ -3316,8 +3316,8 @@  discard block
 block discarded – undo
3316 3316
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
3317 3317
     $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro;
3318 3318
     // Extra data for setting up the Meeting.
3319
-    $bbbsession['userlimit'] = intval((int) \mod_bigbluebuttonbn\locallib\config::get('userlimit_default'));
3320
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('userlimit_editable')) {
3319
+    $bbbsession['userlimit'] = intval((int)\mod_bigbluebuttonbn\locallib\config::get('userlimit_default'));
3320
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('userlimit_editable')) {
3321 3321
         $bbbsession['userlimit'] = intval($bbbsession['bigbluebuttonbn']->userlimit);
3322 3322
     }
3323 3323
     $bbbsession['voicebridge'] = $bbbsession['bigbluebuttonbn']->voicebridge;
@@ -3467,7 +3467,7 @@  discard block
 block discarded – undo
3467 3467
         'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
3468 3468
     ];
3469 3469
     // Special metadata for recording processing.
3470
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
3470
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
3471 3471
         $metadata["bn-recording-status"] = json_encode(
3472 3472
             array(
3473 3473
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
@@ -3475,10 +3475,10 @@  discard block
 block discarded – undo
3475 3475
             )
3476 3476
         );
3477 3477
     }
3478
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3478
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3479 3479
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
3480 3480
     }
3481
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('meetingevents_enabled')) {
3481
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('meetingevents_enabled')) {
3482 3482
         $metadata['analytics-callback-url'] = $bbbsession['meetingEventsURL'];
3483 3483
     }
3484 3484
     return $metadata;
Please login to merge, or discard this patch.
bbb_ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
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
 
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 require_sesskey();
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
 
49 49
 $error = bigbluebuttonbn_broker_validate_parameters($params);
50 50
 if (!empty($error)) {
51
-    header('HTTP/1.0 400 Bad Request. '.$error);
51
+    header('HTTP/1.0 400 Bad Request. ' . $error);
52 52
     return;
53 53
 }
54 54
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         echo $completionvalidate;
128 128
         return;
129 129
     }
130
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
130
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
131 131
 } catch (Exception $e) {
132
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
132
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
133 133
 }
Please login to merge, or discard this patch.