Completed
Pull Request — master (#179)
by
unknown
02:03
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   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
589 589
     $str  = '<div class="bigbluebuttonbn overview">'."\n";
590 590
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\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
 block discarded – undo
836 836
             'bigbluebuttonbn',
837 837
             $bigbluebuttonbn->id,
838 838
             $bigbluebuttonbn->completionexpected
839
-          );
839
+            );
840 840
     }
841 841
 }
842 842
 
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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').':&nbsp;'."\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') . ':&nbsp;' . "\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
 block discarded – undo
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;
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
     if (count($files) == 1) {
872 872
         // Get the first (and only) file.
873 873
         $file = reset($files);
874
-        $filesrc = '/'.$file->get_filename();
874
+        $filesrc = '/' . $file->get_filename();
875 875
     }
876 876
     return $filesrc;
877 877
 }
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
     if (!$filename) {
941 941
         return false;
942 942
     }
943
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
943
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
944 944
     $fs = get_file_storage();
945 945
     $file = $fs->get_file_by_hash(sha1($fullpath));
946 946
     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.
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.
locallib.php 2 patches
Doc Comments   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
  * Helper function to retrieve imported recordings from the Moodle database.
318 318
  * The references are stored as events in bigbluebuttonbn_logs.
319 319
  *
320
- * @param string $courseid
320
+ * @param integer $courseid
321 321
  * @param string $bigbluebuttonbnid
322 322
  * @param bool   $subset
323 323
  *
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 /**
346 346
  * Helper function to retrive the default config.xml file.
347 347
  *
348
- * @return string
348
+ * @return null|SimpleXMLElement
349 349
  */
350 350
 function bigbluebuttonbn_get_default_config_xml() {
351 351
     $xml = bigbluebuttonbn_wrap_xml_load_file(
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
  * @param object $a
428 428
  * @param object $b
429 429
  *
430
- * @return array
430
+ * @return integer
431 431
  */
432 432
 function bigbluebuttonbn_recording_build_sorter($a, $b) {
433 433
     global $CFG;
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
  * @param string $data
542 542
  * @param string $contenttype
543 543
  *
544
- * @return object
544
+ * @return null|SimpleXMLElement
545 545
  */
546 546
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
547 547
     if (extension_loaded('curl')) {
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
  * @param string $data
583 583
  * @param string $contenttype
584 584
  *
585
- * @return object
585
+ * @return string
586 586
  */
587 587
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
588 588
     global $CFG;
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  * @param integer $instance
975 975
  * @param integer $voicebridge
976 976
  *
977
- * @return string
977
+ * @return boolean
978 978
  */
979 979
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
980 980
     global $DB;
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
  * @param string $meetingid
1323 1323
  * @param string $configxml
1324 1324
  *
1325
- * @return object
1325
+ * @return null|SimpleXMLElement
1326 1326
  */
1327 1327
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1328 1328
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
  * @param array $recording
1377 1377
  * @param array $tools
1378 1378
  *
1379
- * @return array
1379
+ * @return null|stdClass
1380 1380
  */
1381 1381
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1382 1382
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -2018,7 +2018,7 @@  discard block
 block discarded – undo
2018 2018
  *
2019 2019
  * @param array $bbbsession
2020 2020
  * @param array $recording
2021
- * @param object $rowdata
2021
+ * @param stdClass $rowdata
2022 2022
  *
2023 2023
  * @return object
2024 2024
  */
@@ -2215,7 +2215,7 @@  discard block
 block discarded – undo
2215 2215
  *
2216 2216
  * @param array $bbbsession
2217 2217
  * @param array $recordings
2218
- * @param array $tools
2218
+ * @param string[] $tools
2219 2219
  *
2220 2220
  * @return array
2221 2221
  */
@@ -2296,7 +2296,7 @@  discard block
 block discarded – undo
2296 2296
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2297 2297
  * in the getRecordings request considering only those that belong to deleted activities.
2298 2298
  *
2299
- * @param string $courseid
2299
+ * @param integer $courseid
2300 2300
  * @param string $bigbluebuttonbnid
2301 2301
  * @param bool   $subset
2302 2302
  *
@@ -2320,7 +2320,7 @@  discard block
 block discarded – undo
2320 2320
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2321 2321
  * in the getRecordings request considering only those that belong to imported recordings.
2322 2322
  *
2323
- * @param string $courseid
2323
+ * @param integer $courseid
2324 2324
  * @param string $bigbluebuttonbnid
2325 2325
  * @param bool   $subset
2326 2326
  *
@@ -2343,7 +2343,7 @@  discard block
 block discarded – undo
2343 2343
 /**
2344 2344
  * Helper function to get recordings and imported recordings together.
2345 2345
  *
2346
- * @param string $courseid
2346
+ * @param integer $courseid
2347 2347
  * @param string $bigbluebuttonbnid
2348 2348
  * @param bool   $subset
2349 2349
  * @param bool   $includedeleted
@@ -2361,7 +2361,7 @@  discard block
 block discarded – undo
2361 2361
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2362 2362
  * in bigbluebuttonbn_logs.
2363 2363
  *
2364
- * @param string $courseid
2364
+ * @param integer $courseid
2365 2365
  * @param string $bigbluebuttonbnid
2366 2366
  * @param bool   $subset
2367 2367
  * @param bool   $includedeleted
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 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');
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
                 foreach ($recordingxml->breakoutRooms->breakoutRoom as $breakoutroom) {
280 280
                     $url = \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url(
281 281
                         'getRecordings',
282
-                        ['recordID' => implode(',', (array) $breakoutroom)]
282
+                        ['recordID' => implode(',', (array)$breakoutroom)]
283 283
                     );
284 284
                     $xml = bigbluebuttonbn_wrap_xml_load_file($url);
285 285
                     if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
         // Override imported flag with actual ID.
336 336
         $recording['imported'] = $recordimported->id;
337 337
         if (isset($recordimported->protected)) {
338
-            $recording['protected'] = (string) $recordimported->protected;
338
+            $recording['protected'] = (string)$recordimported->protected;
339 339
         }
340 340
         $recordsimportedarray[$recording['recordID']] = $recording;
341 341
     }
@@ -365,21 +365,21 @@  discard block
 block discarded – undo
365 365
     // Add formats.
366 366
     $playbackarray = array();
367 367
     foreach ($recording->playback->format as $format) {
368
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
369
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
368
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
369
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
370 370
         // Add preview per format when existing.
371 371
         if ($format->preview) {
372
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
372
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
373 373
         }
374 374
     }
375 375
     // Add the metadata to the recordings array.
376 376
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
377
-    $recordingarray = array('recordID' => (string) $recording->recordID,
378
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
379
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
380
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
377
+    $recordingarray = array('recordID' => (string)$recording->recordID,
378
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
379
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
380
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
381 381
     if (isset($recording->protected)) {
382
-        $recordingarray['protected'] = (string) $recording->protected;
382
+        $recordingarray['protected'] = (string)$recording->protected;
383 383
     }
384 384
     return $recordingarray + $metadataarray;
385 385
 }
@@ -394,9 +394,9 @@  discard block
 block discarded – undo
394 394
 function bigbluebuttonbn_get_recording_preview_images($preview) {
395 395
     $imagesarray = array();
396 396
     foreach ($preview->images->image as $image) {
397
-        $imagearray = array('url' => trim((string) $image));
397
+        $imagearray = array('url' => trim((string)$image));
398 398
         foreach ($image->attributes() as $attkey => $attvalue) {
399
-            $imagearray[$attkey] = (string) $attvalue;
399
+            $imagearray[$attkey] = (string)$attvalue;
400 400
         }
401 401
         array_push($imagesarray, $imagearray);
402 402
     }
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
     $ids = explode(',', $recordids);
492 492
     foreach ($ids as $id) {
493 493
         $xml = bigbluebuttonbn_wrap_xml_load_file(
494
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
494
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
495 495
         );
496 496
         if ($xml && $xml->returncode != 'SUCCESS') {
497 497
             return false;
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
  * @return array $users
663 663
  */
664 664
 function bigbluebuttonbn_get_users(context $context = null) {
665
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
665
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
666 666
     foreach ($users as $key => $value) {
667 667
         $users[$key] = fullname($value);
668 668
     }
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 function bigbluebuttonbn_get_users_select(context $context = null, $bbactivity = null) {
682 682
     // CONTRIB-7972, check the group of current user and course group mode.
683 683
     $groups = null;
684
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
684
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
685 685
     if ($bbactivity) {
686 686
         list($course, $cm) = get_course_and_cm_from_instance($bbactivity->id, 'bigbluebuttonbn');
687 687
         $groupmode = groups_get_activity_groupmode($cm);
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
             $groups = groups_get_all_groups($course->id, $USER->id);
691 691
             $users = [];
692 692
             foreach ($groups as $g) {
693
-                $users += (array) get_enrolled_users($context, '', $g->id, 'u.*', null, 0, 0, true);
693
+                $users += (array)get_enrolled_users($context, '', $g->id, 'u.*', null, 0, 0, true);
694 694
             }
695 695
         }
696 696
     }
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
  * @return array $roles
710 710
  */
711 711
 function bigbluebuttonbn_get_roles(context $context = null) {
712
-    $roles = (array) role_get_names($context);
712
+    $roles = (array)role_get_names($context);
713 713
     foreach ($roles as $key => $value) {
714 714
         $roles[$key] = $value->localname;
715 715
     }
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
  * @return array $users
725 725
  */
726 726
 function bigbluebuttonbn_get_roles_select(context $context = null) {
727
-    $roles = (array) role_get_names($context);
727
+    $roles = (array)role_get_names($context);
728 728
     foreach ($roles as $key => $value) {
729 729
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
730 730
     }
@@ -739,9 +739,9 @@  discard block
 block discarded – undo
739 739
  * @return object $role
740 740
  */
741 741
 function bigbluebuttonbn_get_role($id) {
742
-    $roles = (array) role_get_names();
742
+    $roles = (array)role_get_names();
743 743
     if (is_numeric($id) && isset($roles[$id])) {
744
-        return (object) $roles[$id];
744
+        return (object)$roles[$id];
745 745
     }
746 746
     foreach ($roles as $role) {
747 747
         if ($role->shortname == $id) {
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
             if (!empty($ownerid) && is_enrolled($context, $ownerid)) {
822 822
                 $participantlist[] = array(
823 823
                     'selectiontype' => 'user',
824
-                    'selectionid' => (string) $ownerid,
824
+                    'selectionid' => (string)$ownerid,
825 825
                     'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
826 826
             }
827 827
             continue;
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
     $now = time();
1004 1004
     if ($closingtime > 0 && $now < $closingtime) {
1005 1005
         $duration = ceil(($closingtime - $now) / 60);
1006
-        $compensationtime = intval((int) \mod_bigbluebuttonbn\locallib\config::get('scheduled_duration_compensation'));
1006
+        $compensationtime = intval((int)\mod_bigbluebuttonbn\locallib\config::get('scheduled_duration_compensation'));
1007 1007
         $duration = intval($duration) + $compensationtime;
1008 1008
     }
1009 1009
     return $duration;
@@ -1205,16 +1205,16 @@  discard block
 block discarded – undo
1205 1205
  * @return array
1206 1206
  */
1207 1207
 function bigbluebuttonbn_get_meeting_info($meetingid, $updatecache = false) {
1208
-    $cachettl = (int) \mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
1208
+    $cachettl = (int)\mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
1209 1209
     $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache');
1210 1210
     $result = $cache->get($meetingid);
1211 1211
     $now = time();
1212 1212
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1213 1213
         // Use the value in the cache.
1214
-        return (array) json_decode($result['meeting_info']);
1214
+        return (array)json_decode($result['meeting_info']);
1215 1215
     }
1216 1216
     // Ping again and refresh the cache.
1217
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1217
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1218 1218
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1219 1219
     );
1220 1220
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
  */
1362 1362
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1363 1363
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1364
-    $configxmlarray = (array) $configxml;
1364
+    $configxmlarray = (array)$configxml;
1365 1365
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1366 1366
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1367 1367
         return '';
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
  * @return boolean
1417 1417
  */
1418 1418
 function bigbluebuttonbn_get_recording_data_row_editable($bbbsession) {
1419
-    return ($bbbsession['managerecordings'] && ((double) $bbbsession['serverversion'] >= 1.0 || $bbbsession['bnserver']));
1419
+    return ($bbbsession['managerecordings'] && ((double)$bbbsession['serverversion'] >= 1.0 || $bbbsession['bnserver']));
1420 1420
 }
1421 1421
 
1422 1422
 /**
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
  * @return boolean
1428 1428
  */
1429 1429
 function bigbluebuttonbn_get_recording_data_preview_enabled($bbbsession) {
1430
-    return ((double) $bbbsession['serverversion'] >= 1.0 && $bbbsession['bigbluebuttonbn']->recordings_preview == '1');
1430
+    return ((double)$bbbsession['serverversion'] >= 1.0 && $bbbsession['bigbluebuttonbn']->recordings_preview == '1');
1431 1431
 }
1432 1432
 
1433 1433
 /**
@@ -1851,7 +1851,7 @@  discard block
 block discarded – undo
1851 1851
     }
1852 1852
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1853 1853
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording' . ucfirst($data['action']) . '(this);';
1854
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1854
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1855 1855
         // With icon for $manageaction.
1856 1856
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1857 1857
         $linkattributes = array(
@@ -2135,7 +2135,7 @@  discard block
 block discarded – undo
2135 2135
         // Enqueue it.
2136 2136
         \core\task\manager::queue_adhoc_task($task);
2137 2137
     } catch (Exception $e) {
2138
-        mtrace("Error while enqueuing completion_update_state task. " . (string) $e);
2138
+        mtrace("Error while enqueuing completion_update_state task. " . (string)$e);
2139 2139
     }
2140 2140
 }
2141 2141
 
@@ -2149,7 +2149,7 @@  discard block
 block discarded – undo
2149 2149
  */
2150 2150
 function bigbluebuttonbn_completion_update_state($bigbluebuttonbn, $userid) {
2151 2151
     global $CFG;
2152
-    require_once($CFG->libdir.'/completionlib.php');
2152
+    require_once($CFG->libdir . '/completionlib.php');
2153 2153
     list($course, $cm) = get_course_and_cm_from_instance($bigbluebuttonbn, 'bigbluebuttonbn');
2154 2154
     $completion = new completion_info($course);
2155 2155
     if (!$completion->is_enabled($cm)) {
@@ -2578,7 +2578,7 @@  discard block
 block discarded – undo
2578 2578
  */
2579 2579
 function bigbluebuttonbn_format_activity_time($time) {
2580 2580
     global $CFG;
2581
-    require_once($CFG->dirroot.'/calendar/lib.php');
2581
+    require_once($CFG->dirroot . '/calendar/lib.php');
2582 2582
     $activitytime = '';
2583 2583
     if ($time) {
2584 2584
         $activitytime = calendar_day_representation($time) . ' ' .
@@ -2676,7 +2676,7 @@  discard block
 block discarded – undo
2676 2676
  */
2677 2677
 function bigbluebuttonbn_settings_general(&$renderer) {
2678 2678
     // Configuration for BigBlueButton.
2679
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_general_shown()) {
2679
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_general_shown()) {
2680 2680
         $renderer->render_group_header('general');
2681 2681
         $renderer->render_group_element(
2682 2682
             'server_url',
@@ -2698,7 +2698,7 @@  discard block
 block discarded – undo
2698 2698
  */
2699 2699
 function bigbluebuttonbn_settings_record(&$renderer) {
2700 2700
     // Configuration for 'recording' feature.
2701
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_record_meeting_shown()) {
2701
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_record_meeting_shown()) {
2702 2702
         $renderer->render_group_header('recording');
2703 2703
         $renderer->render_group_element(
2704 2704
             'recording_default',
@@ -2742,7 +2742,7 @@  discard block
 block discarded – undo
2742 2742
  */
2743 2743
 function bigbluebuttonbn_settings_importrecordings(&$renderer) {
2744 2744
     // Configuration for 'import recordings' feature.
2745
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_import_recordings_shown()) {
2745
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_import_recordings_shown()) {
2746 2746
         $renderer->render_group_header('importrecordings');
2747 2747
         $renderer->render_group_element(
2748 2748
             'importrecordings_enabled',
@@ -2764,7 +2764,7 @@  discard block
 block discarded – undo
2764 2764
  */
2765 2765
 function bigbluebuttonbn_settings_showrecordings(&$renderer) {
2766 2766
     // Configuration for 'show recordings' feature.
2767
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_show_recordings_shown()) {
2767
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_show_recordings_shown()) {
2768 2768
         $renderer->render_group_header('recordings');
2769 2769
         $renderer->render_group_element(
2770 2770
             'recordings_html_default',
@@ -2814,7 +2814,7 @@  discard block
 block discarded – undo
2814 2814
  */
2815 2815
 function bigbluebuttonbn_settings_waitmoderator(&$renderer) {
2816 2816
     // Configuration for wait for moderator feature.
2817
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_wait_moderator_shown()) {
2817
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_wait_moderator_shown()) {
2818 2818
         $renderer->render_group_header('waitformoderator');
2819 2819
         $renderer->render_group_element(
2820 2820
             'waitformoderator_default',
@@ -2844,7 +2844,7 @@  discard block
 block discarded – undo
2844 2844
  */
2845 2845
 function bigbluebuttonbn_settings_voicebridge(&$renderer) {
2846 2846
     // Configuration for "static voice bridge" feature.
2847
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_static_voice_bridge_shown()) {
2847
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_static_voice_bridge_shown()) {
2848 2848
         $renderer->render_group_header('voicebridge');
2849 2849
         $renderer->render_group_element(
2850 2850
             'voicebridge_editable',
@@ -2862,7 +2862,7 @@  discard block
 block discarded – undo
2862 2862
  */
2863 2863
 function bigbluebuttonbn_settings_preupload(&$renderer) {
2864 2864
     // Configuration for "preupload presentation" feature.
2865
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2865
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2866 2866
         // This feature only works if curl is installed.
2867 2867
         $preuploaddescripion = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn');
2868 2868
         if (!extension_loaded('curl')) {
@@ -2890,7 +2890,7 @@  discard block
 block discarded – undo
2890 2890
  */
2891 2891
 function bigbluebuttonbn_settings_preupload_manage_default_file(&$renderer) {
2892 2892
     // Configuration for "preupload presentation" feature.
2893
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2893
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2894 2894
         if (extension_loaded('curl')) {
2895 2895
             // This feature only works if curl is installed.
2896 2896
             $renderer->render_filemanager_default_file_presentation("presentation_default");
@@ -2907,7 +2907,7 @@  discard block
 block discarded – undo
2907 2907
  */
2908 2908
 function bigbluebuttonbn_settings_userlimit(&$renderer) {
2909 2909
     // Configuration for "user limit" feature.
2910
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_user_limit_shown()) {
2910
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_user_limit_shown()) {
2911 2911
         $renderer->render_group_header('userlimit');
2912 2912
         $renderer->render_group_element(
2913 2913
             'userlimit_default',
@@ -2929,7 +2929,7 @@  discard block
 block discarded – undo
2929 2929
  */
2930 2930
 function bigbluebuttonbn_settings_duration(&$renderer) {
2931 2931
     // Configuration for "scheduled duration" feature.
2932
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_scheduled_duration_shown()) {
2932
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_scheduled_duration_shown()) {
2933 2933
         $renderer->render_group_header('scheduled');
2934 2934
         $renderer->render_group_element(
2935 2935
             'scheduled_duration_enabled',
@@ -2955,7 +2955,7 @@  discard block
 block discarded – undo
2955 2955
  */
2956 2956
 function bigbluebuttonbn_settings_participants(&$renderer) {
2957 2957
     // Configuration for defining the default role/user that will be moderator on new activities.
2958
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_moderator_default_shown()) {
2958
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_moderator_default_shown()) {
2959 2959
         $renderer->render_group_header('participant');
2960 2960
         // UI for 'participants' feature.
2961 2961
         $roles = bigbluebuttonbn_get_roles();
@@ -2980,7 +2980,7 @@  discard block
 block discarded – undo
2980 2980
  */
2981 2981
 function bigbluebuttonbn_settings_notifications(&$renderer) {
2982 2982
     // Configuration for "send notifications" feature.
2983
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_send_notifications_shown()) {
2983
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_send_notifications_shown()) {
2984 2984
         $renderer->render_group_header('sendnotifications');
2985 2985
         $renderer->render_group_element(
2986 2986
             'sendnotifications_enabled',
@@ -2998,14 +2998,14 @@  discard block
 block discarded – undo
2998 2998
  */
2999 2999
 function bigbluebuttonbn_settings_clienttype(&$renderer) {
3000 3000
     // Configuration for "clienttype" feature.
3001
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_clienttype_shown()) {
3001
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_clienttype_shown()) {
3002 3002
         $renderer->render_group_header('clienttype');
3003 3003
         $renderer->render_group_element(
3004 3004
             'clienttype_editable',
3005 3005
             $renderer->render_group_element_checkbox('clienttype_editable', 0)
3006 3006
         );
3007 3007
         // Web Client default.
3008
-        $default = intval((int) \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
3008
+        $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
3009 3009
         $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
3010 3010
             BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
3011 3011
         $renderer->render_group_element(
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
  */
3029 3029
 function bigbluebuttonbn_settings_muteonstart(&$renderer) {
3030 3030
     // Configuration for BigBlueButton.
3031
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_muteonstart_shown()) {
3031
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_muteonstart_shown()) {
3032 3032
         $renderer->render_group_header('muteonstart');
3033 3033
         $renderer->render_group_element(
3034 3034
             'muteonstart_default',
@@ -3050,7 +3050,7 @@  discard block
 block discarded – undo
3050 3050
  */
3051 3051
 function bigbluebuttonbn_settings_extended(&$renderer) {
3052 3052
     // Configuration for 'notify users when recording ready' feature.
3053
-    if (!(boolean) \mod_bigbluebuttonbn\settings\validator::section_settings_extended_shown()) {
3053
+    if (!(boolean)\mod_bigbluebuttonbn\settings\validator::section_settings_extended_shown()) {
3054 3054
         return;
3055 3055
     }
3056 3056
     $renderer->render_group_header('extended_capabilities');
@@ -3078,7 +3078,7 @@  discard block
 block discarded – undo
3078 3078
     global $DB;
3079 3079
     do {
3080 3080
         $encodedseed = sha1(bigbluebuttonbn_random_password(12));
3081
-        $meetingid = (string) $DB->get_field('bigbluebuttonbn', 'meetingid', array('meetingid' => $encodedseed));
3081
+        $meetingid = (string)$DB->get_field('bigbluebuttonbn', 'meetingid', array('meetingid' => $encodedseed));
3082 3082
     } while ($meetingid == $encodedseed);
3083 3083
     return $encodedseed;
3084 3084
 }
@@ -3291,7 +3291,7 @@  discard block
 block discarded – undo
3291 3291
 function bigbluebuttonbn_instance_ownerid($bigbluebuttonbn) {
3292 3292
     global $DB;
3293 3293
     $filters = array('bigbluebuttonbnid' => $bigbluebuttonbn->id, 'log' => 'Add');
3294
-    $ownerid = (integer) $DB->get_field('bigbluebuttonbn_logs', 'userid', $filters);
3294
+    $ownerid = (integer)$DB->get_field('bigbluebuttonbn_logs', 'userid', $filters);
3295 3295
     return $ownerid;
3296 3296
 }
3297 3297
 
@@ -3334,8 +3334,8 @@  discard block
 block discarded – undo
3334 3334
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
3335 3335
     $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro;
3336 3336
     // Extra data for setting up the Meeting.
3337
-    $bbbsession['userlimit'] = intval((int) \mod_bigbluebuttonbn\locallib\config::get('userlimit_default'));
3338
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('userlimit_editable')) {
3337
+    $bbbsession['userlimit'] = intval((int)\mod_bigbluebuttonbn\locallib\config::get('userlimit_default'));
3338
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('userlimit_editable')) {
3339 3339
         $bbbsession['userlimit'] = intval($bbbsession['bigbluebuttonbn']->userlimit);
3340 3340
     }
3341 3341
     $bbbsession['voicebridge'] = $bbbsession['bigbluebuttonbn']->voicebridge;
@@ -3485,7 +3485,7 @@  discard block
 block discarded – undo
3485 3485
         'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
3486 3486
     ];
3487 3487
     // Special metadata for recording processing.
3488
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
3488
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
3489 3489
         $metadata["bn-recording-status"] = json_encode(
3490 3490
             array(
3491 3491
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
@@ -3493,10 +3493,10 @@  discard block
 block discarded – undo
3493 3493
             )
3494 3494
         );
3495 3495
     }
3496
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3496
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3497 3497
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
3498 3498
     }
3499
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('meetingevents_enabled')) {
3499
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('meetingevents_enabled')) {
3500 3500
         $metadata['analytics-callback-url'] = $bbbsession['meetingEventsURL'];
3501 3501
     }
3502 3502
     return $metadata;
Please login to merge, or discard this patch.