Completed
Pull Request — master (#164)
by Jesus
02:06
created
lib.php 1 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.
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   +27 added lines, -27 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
     /**
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();
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
  * @param integer $instance
958 958
  * @param integer $voicebridge
959 959
  *
960
- * @return string
960
+ * @return boolean
961 961
  */
962 962
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
963 963
     global $DB;
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
  * @param string $meetingid
1307 1307
  * @param string $configxml
1308 1308
  *
1309
- * @return object
1309
+ * @return null|SimpleXMLElement
1310 1310
  */
1311 1311
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1312 1312
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
  * @param array $recording
1360 1360
  * @param array $tools
1361 1361
  *
1362
- * @return array
1362
+ * @return null|stdClass
1363 1363
  */
1364 1364
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1365 1365
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
  *
1995 1995
  * @param array $bbbsession
1996 1996
  * @param array $recording
1997
- * @param object $rowdata
1997
+ * @param stdClass $rowdata
1998 1998
  *
1999 1999
  * @return object
2000 2000
  */
@@ -2189,7 +2189,7 @@  discard block
 block discarded – undo
2189 2189
  *
2190 2190
  * @param array $bbbsession
2191 2191
  * @param array $recordings
2192
- * @param array $tools
2192
+ * @param string[] $tools
2193 2193
  *
2194 2194
  * @return array
2195 2195
  */ 
@@ -2270,7 +2270,7 @@  discard block
 block discarded – undo
2270 2270
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2271 2271
  * in the getRecordings request considering only those that belong to deleted activities.
2272 2272
  *
2273
- * @param string $courseid
2273
+ * @param integer $courseid
2274 2274
  * @param string $bigbluebuttonbnid
2275 2275
  * @param bool   $subset
2276 2276
  *
@@ -2294,7 +2294,7 @@  discard block
 block discarded – undo
2294 2294
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2295 2295
  * in the getRecordings request considering only those that belong to imported recordings.
2296 2296
  *
2297
- * @param string $courseid
2297
+ * @param integer $courseid
2298 2298
  * @param string $bigbluebuttonbnid
2299 2299
  * @param bool   $subset
2300 2300
  *
@@ -2317,7 +2317,7 @@  discard block
 block discarded – undo
2317 2317
 /**
2318 2318
  * Helper function to get recordings and imported recordings together.
2319 2319
  *
2320
- * @param string $courseid
2320
+ * @param integer $courseid
2321 2321
  * @param string $bigbluebuttonbnid
2322 2322
  * @param bool   $subset
2323 2323
  * @param bool   $includedeleted
@@ -2335,7 +2335,7 @@  discard block
 block discarded – undo
2335 2335
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2336 2336
  * in bigbluebuttonbn_logs.
2337 2337
  *
2338
- * @param string $courseid
2338
+ * @param integer $courseid
2339 2339
  * @param string $bigbluebuttonbnid
2340 2340
  * @param bool   $subset
2341 2341
  * @param bool   $includedeleted
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     }
190 190
     if ($xml) {
191 191
         // Either failure or success without meeting info.
192
-        return (array) $xml;
192
+        return (array)$xml;
193 193
     }
194 194
     // If the server is unreachable, then prompts the user of the necessary action.
195 195
     return array('returncode' => 'FAILED', 'message' => 'unreachable', 'messageKey' => 'Server is unreachable');
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                 foreach ($recordingxml->breakoutRooms->breakoutRoom as $breakoutroom) {
269 269
                     $url = \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url(
270 270
                         'getRecordings',
271
-                        ['recordID' => implode(',', (array) $breakoutroom)]
271
+                        ['recordID' => implode(',', (array)$breakoutroom)]
272 272
                     );
273 273
                     $xml = bigbluebuttonbn_wrap_xml_load_file($url);
274 274
                     if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         // Override imported flag with actual ID.
325 325
         $recording['imported'] = $recordimported->id;
326 326
         if (isset($recordimported->protected)) {
327
-            $recording['protected'] = (string) $recordimported->protected;
327
+            $recording['protected'] = (string)$recordimported->protected;
328 328
         }
329 329
         $recordsimportedarray[$recording['recordID']] = $recording;
330 330
     }
@@ -354,21 +354,21 @@  discard block
 block discarded – undo
354 354
     // Add formats.
355 355
     $playbackarray = array();
356 356
     foreach ($recording->playback->format as $format) {
357
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
358
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
357
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
358
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
359 359
         // Add preview per format when existing.
360 360
         if ($format->preview) {
361
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
361
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
362 362
         }
363 363
     }
364 364
     // Add the metadata to the recordings array.
365 365
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
366
-    $recordingarray = array('recordID' => (string) $recording->recordID,
367
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
368
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
369
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
366
+    $recordingarray = array('recordID' => (string)$recording->recordID,
367
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
368
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
369
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
370 370
     if (isset($recording->protected)) {
371
-        $recordingarray['protected'] = (string) $recording->protected;
371
+        $recordingarray['protected'] = (string)$recording->protected;
372 372
     }
373 373
     return $recordingarray + $metadataarray;
374 374
 }
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
 function bigbluebuttonbn_get_recording_preview_images($preview) {
384 384
     $imagesarray = array();
385 385
     foreach ($preview->images->image as $image) {
386
-        $imagearray = array('url' => trim((string) $image));
386
+        $imagearray = array('url' => trim((string)$image));
387 387
         foreach ($image->attributes() as $attkey => $attvalue) {
388
-            $imagearray[$attkey] = (string) $attvalue;
388
+            $imagearray[$attkey] = (string)$attvalue;
389 389
         }
390 390
         array_push($imagesarray, $imagearray);
391 391
     }
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
     $ids = explode(',', $recordids);
481 481
     foreach ($ids as $id) {
482 482
         $xml = bigbluebuttonbn_wrap_xml_load_file(
483
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
483
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
484 484
         );
485 485
         if ($xml && $xml->returncode != 'SUCCESS') {
486 486
             return false;
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
  */
652 652
 function bigbluebuttonbn_get_users(context $context = null) {
653 653
 
654
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
654
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
655 655
     foreach ($users as $key => $value) {
656 656
         $users[$key] = fullname($value);
657 657
     }
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
  */
668 668
 function bigbluebuttonbn_get_users_select(context $context = null) {
669 669
 
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
     foreach ($users as $key => $value) {
672 672
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
673 673
     }
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
  */
684 684
 function bigbluebuttonbn_get_roles(context $context = null) {
685 685
 
686
-    $roles = (array) role_get_names($context);
686
+    $roles = (array)role_get_names($context);
687 687
     foreach ($roles as $key => $value) {
688 688
         $roles[$key] = $value->localname;
689 689
     }
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
  */
700 700
 function bigbluebuttonbn_get_roles_select(context $context = null) {
701 701
 
702
-    $roles = (array) role_get_names($context);
702
+    $roles = (array)role_get_names($context);
703 703
     foreach ($roles as $key => $value) {
704 704
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
705 705
     }
@@ -715,9 +715,9 @@  discard block
 block discarded – undo
715 715
  */
716 716
 function bigbluebuttonbn_get_role($id) {
717 717
 
718
-    $roles = (array) role_get_names();
718
+    $roles = (array)role_get_names();
719 719
     if (is_numeric($id) && isset($roles[$id])) {
720
-        return (object) $roles[$id];
720
+        return (object)$roles[$id];
721 721
     }
722 722
     foreach ($roles as $role) {
723 723
         if ($role->shortname == $id) {
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
             if (!empty($ownerid) && is_enrolled($context, $ownerid)) {
801 801
                 $participantlist[] = array(
802 802
                     'selectiontype' => 'user',
803
-                    'selectionid' => (string) $ownerid,
803
+                    'selectionid' => (string)$ownerid,
804 804
                     'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
805 805
             }
806 806
             continue;
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
     $now = time();
987 987
     if ($closingtime > 0 && $now < $closingtime) {
988 988
         $duration = ceil(($closingtime - $now) / 60);
989
-        $compensationtime = intval((int) \mod_bigbluebuttonbn\locallib\config::get('scheduled_duration_compensation'));
989
+        $compensationtime = intval((int)\mod_bigbluebuttonbn\locallib\config::get('scheduled_duration_compensation'));
990 990
         $duration = intval($duration) + $compensationtime;
991 991
     }
992 992
     return $duration;
@@ -1189,16 +1189,16 @@  discard block
 block discarded – undo
1189 1189
  * @return array
1190 1190
  */
1191 1191
 function bigbluebuttonbn_get_meeting_info($meetingid, $updatecache = false) {
1192
-    $cachettl = (int) \mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
1192
+    $cachettl = (int)\mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
1193 1193
     $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache');
1194 1194
     $result = $cache->get($meetingid);
1195 1195
     $now = time();
1196 1196
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1197 1197
         // Use the value in the cache.
1198
-        return (array) json_decode($result['meeting_info']);
1198
+        return (array)json_decode($result['meeting_info']);
1199 1199
     }
1200 1200
     // Ping again and refresh the cache.
1201
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1201
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1202 1202
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1203 1203
     );
1204 1204
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
  */
1345 1345
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1346 1346
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1347
-    $configxmlarray = (array) $configxml;
1347
+    $configxmlarray = (array)$configxml;
1348 1348
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1349 1349
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1350 1350
         return '';
@@ -1399,7 +1399,7 @@  discard block
 block discarded – undo
1399 1399
  * @return boolean
1400 1400
  */
1401 1401
 function bigbluebuttonbn_get_recording_data_row_editable($bbbsession) {
1402
-    return ($bbbsession['managerecordings'] && ((double) $bbbsession['serverversion'] >= 1.0 || $bbbsession['bnserver']));
1402
+    return ($bbbsession['managerecordings'] && ((double)$bbbsession['serverversion'] >= 1.0 || $bbbsession['bnserver']));
1403 1403
 }
1404 1404
 
1405 1405
 /**
@@ -1410,7 +1410,7 @@  discard block
 block discarded – undo
1410 1410
  * @return boolean
1411 1411
  */
1412 1412
 function bigbluebuttonbn_get_recording_data_preview_enabled($bbbsession) {
1413
-    return ((double) $bbbsession['serverversion'] >= 1.0 && $bbbsession['bigbluebuttonbn']->recordings_preview == '1');
1413
+    return ((double)$bbbsession['serverversion'] >= 1.0 && $bbbsession['bigbluebuttonbn']->recordings_preview == '1');
1414 1414
 }
1415 1415
 
1416 1416
 /**
@@ -1817,7 +1817,7 @@  discard block
 block discarded – undo
1817 1817
     }
1818 1818
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1819 1819
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording' . ucfirst($data['action']) . '(this);';
1820
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1820
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1821 1821
         // With icon for $manageaction.
1822 1822
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1823 1823
         $linkattributes = array(
@@ -1961,7 +1961,7 @@  discard block
 block discarded – undo
1961 1961
         $groupmode = $DB->get_record_sql($sql, $params, IGNORE_MULTIPLE);
1962 1962
 
1963 1963
         $displayrow = true;
1964
-        if ((isset($groupmode->groupmode) && (int) $groupmode->groupmode != VISIBLEGROUPS)
1964
+        if ((isset($groupmode->groupmode) && (int)$groupmode->groupmode != VISIBLEGROUPS)
1965 1965
             && !$bbbsession['administrator'] && !$bbbsession['moderator']) {
1966 1966
             $groupid = explode('[', $recording['meetingID']);
1967 1967
             if (isset($groupid[1])) {
@@ -2111,7 +2111,7 @@  discard block
 block discarded – undo
2111 2111
         // Enqueue it.
2112 2112
         \core\task\manager::queue_adhoc_task($task);
2113 2113
     } catch (Exception $e) {
2114
-        mtrace("Error while enqueuing completion_update_state task. " . (string) $e);
2114
+        mtrace("Error while enqueuing completion_update_state task. " . (string)$e);
2115 2115
     }
2116 2116
 }
2117 2117
 
@@ -2658,7 +2658,7 @@  discard block
 block discarded – undo
2658 2658
 function bigbluebuttonbn_settings_general(&$renderer) {
2659 2659
 
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',
@@ -2681,7 +2681,7 @@  discard block
 block discarded – undo
2681 2681
 function bigbluebuttonbn_settings_record(&$renderer) {
2682 2682
 
2683 2683
     // Configuration for 'recording' feature.
2684
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_record_meeting_shown()) {
2684
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_record_meeting_shown()) {
2685 2685
         $renderer->render_group_header('recording');
2686 2686
         $renderer->render_group_element(
2687 2687
             'recording_default',
@@ -2726,7 +2726,7 @@  discard block
 block discarded – undo
2726 2726
 function bigbluebuttonbn_settings_importrecordings(&$renderer) {
2727 2727
 
2728 2728
     // Configuration for 'import recordings' feature.
2729
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_import_recordings_shown()) {
2729
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_import_recordings_shown()) {
2730 2730
         $renderer->render_group_header('importrecordings');
2731 2731
         $renderer->render_group_element(
2732 2732
             'importrecordings_enabled',
@@ -2749,7 +2749,7 @@  discard block
 block discarded – undo
2749 2749
 function bigbluebuttonbn_settings_showrecordings(&$renderer) {
2750 2750
 
2751 2751
     // Configuration for 'show recordings' feature.
2752
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_show_recordings_shown()) {
2752
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_show_recordings_shown()) {
2753 2753
         $renderer->render_group_header('recordings');
2754 2754
         $renderer->render_group_element(
2755 2755
             'recordings_html_default',
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
 function bigbluebuttonbn_settings_waitmoderator(&$renderer) {
2801 2801
 
2802 2802
     // Configuration for wait for moderator feature.
2803
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_wait_moderator_shown()) {
2803
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_wait_moderator_shown()) {
2804 2804
         $renderer->render_group_header('waitformoderator');
2805 2805
         $renderer->render_group_element(
2806 2806
             'waitformoderator_default',
@@ -2831,7 +2831,7 @@  discard block
 block discarded – undo
2831 2831
 function bigbluebuttonbn_settings_voicebridge(&$renderer) {
2832 2832
 
2833 2833
     // Configuration for "static voice bridge" feature.
2834
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_static_voice_bridge_shown()) {
2834
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_static_voice_bridge_shown()) {
2835 2835
         $renderer->render_group_header('voicebridge');
2836 2836
         $renderer->render_group_element(
2837 2837
             'voicebridge_editable',
@@ -2850,7 +2850,7 @@  discard block
 block discarded – undo
2850 2850
 function bigbluebuttonbn_settings_preupload(&$renderer) {
2851 2851
 
2852 2852
     // Configuration for "preupload presentation" feature.
2853
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2853
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2854 2854
         // This feature only works if curl is installed.
2855 2855
         $preuploaddescripion = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn');
2856 2856
         if (!extension_loaded('curl')) {
@@ -2879,7 +2879,7 @@  discard block
 block discarded – undo
2879 2879
 function bigbluebuttonbn_settings_preupload_manage_default_file(&$renderer) {
2880 2880
 
2881 2881
     // Configuration for "preupload presentation" feature.
2882
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2882
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2883 2883
         if (extension_loaded('curl')) {
2884 2884
             // This feature only works if curl is installed.
2885 2885
             $renderer->render_filemanager_default_file_presentation("presentation_default");
@@ -2897,7 +2897,7 @@  discard block
 block discarded – undo
2897 2897
 function bigbluebuttonbn_settings_userlimit(&$renderer) {
2898 2898
 
2899 2899
     // Configuration for "user limit" feature.
2900
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_user_limit_shown()) {
2900
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_user_limit_shown()) {
2901 2901
         $renderer->render_group_header('userlimit');
2902 2902
         $renderer->render_group_element(
2903 2903
             'userlimit_default',
@@ -2920,7 +2920,7 @@  discard block
 block discarded – undo
2920 2920
 function bigbluebuttonbn_settings_duration(&$renderer) {
2921 2921
 
2922 2922
     // Configuration for "scheduled duration" feature.
2923
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_scheduled_duration_shown()) {
2923
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_scheduled_duration_shown()) {
2924 2924
         $renderer->render_group_header('scheduled');
2925 2925
         $renderer->render_group_element(
2926 2926
             'scheduled_duration_enabled',
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
 function bigbluebuttonbn_settings_participants(&$renderer) {
2948 2948
 
2949 2949
     // Configuration for defining the default role/user that will be moderator on new activities.
2950
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_moderator_default_shown()) {
2950
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_moderator_default_shown()) {
2951 2951
         $renderer->render_group_header('participant');
2952 2952
         // UI for 'participants' feature.
2953 2953
         $roles = bigbluebuttonbn_get_roles();
@@ -2973,7 +2973,7 @@  discard block
 block discarded – undo
2973 2973
 function bigbluebuttonbn_settings_notifications(&$renderer) {
2974 2974
 
2975 2975
     // Configuration for "send notifications" feature.
2976
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_send_notifications_shown()) {
2976
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_send_notifications_shown()) {
2977 2977
         $renderer->render_group_header('sendnotifications');
2978 2978
         $renderer->render_group_element(
2979 2979
             'sendnotifications_enabled',
@@ -2992,14 +2992,14 @@  discard block
 block discarded – undo
2992 2992
 function bigbluebuttonbn_settings_clienttype(&$renderer) {
2993 2993
 
2994 2994
     // Configuration for "clienttype" feature.
2995
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_clienttype_shown()) {
2995
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_clienttype_shown()) {
2996 2996
         $renderer->render_group_header('clienttype');
2997 2997
         $renderer->render_group_element(
2998 2998
             'clienttype_editable',
2999 2999
             $renderer->render_group_element_checkbox('clienttype_editable', 0)
3000 3000
         );
3001 3001
         // Web Client default.
3002
-        $default = intval((int) \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
3002
+        $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
3003 3003
         $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
3004 3004
             BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
3005 3005
         $renderer->render_group_element(
@@ -3023,7 +3023,7 @@  discard block
 block discarded – undo
3023 3023
 function bigbluebuttonbn_settings_muteonstart(&$renderer) {
3024 3024
 
3025 3025
     // Configuration for BigBlueButton.
3026
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_muteonstart_shown()) {
3026
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_muteonstart_shown()) {
3027 3027
         $renderer->render_group_header('muteonstart');
3028 3028
         $renderer->render_group_element(
3029 3029
             'muteonstart_default',
@@ -3046,7 +3046,7 @@  discard block
 block discarded – undo
3046 3046
 function bigbluebuttonbn_settings_extended(&$renderer) {
3047 3047
 
3048 3048
     // Configuration for 'notify users when recording ready' feature.
3049
-    if (!(boolean) \mod_bigbluebuttonbn\settings\validator::section_settings_extended_shown()) {
3049
+    if (!(boolean)\mod_bigbluebuttonbn\settings\validator::section_settings_extended_shown()) {
3050 3050
         return;
3051 3051
     }
3052 3052
     $renderer->render_group_header('extended_capabilities');
@@ -3075,7 +3075,7 @@  discard block
 block discarded – undo
3075 3075
     global $DB;
3076 3076
     do {
3077 3077
         $encodedseed = sha1(bigbluebuttonbn_random_password(12));
3078
-        $meetingid = (string) $DB->get_field('bigbluebuttonbn', 'meetingid', array('meetingid' => $encodedseed));
3078
+        $meetingid = (string)$DB->get_field('bigbluebuttonbn', 'meetingid', array('meetingid' => $encodedseed));
3079 3079
     } while ($meetingid == $encodedseed);
3080 3080
     return $encodedseed;
3081 3081
 }
@@ -3301,7 +3301,7 @@  discard block
 block discarded – undo
3301 3301
 
3302 3302
     global $DB;
3303 3303
     $filters = array('bigbluebuttonbnid' => $bigbluebuttonbn->id, 'log' => 'Add');
3304
-    $ownerid = (integer) $DB->get_field('bigbluebuttonbn_logs', 'userid', $filters);
3304
+    $ownerid = (integer)$DB->get_field('bigbluebuttonbn_logs', 'userid', $filters);
3305 3305
     return $ownerid;
3306 3306
 }
3307 3307
 
@@ -3346,8 +3346,8 @@  discard block
 block discarded – undo
3346 3346
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
3347 3347
     $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro;
3348 3348
     // Extra data for setting up the Meeting.
3349
-    $bbbsession['userlimit'] = intval((int) \mod_bigbluebuttonbn\locallib\config::get('userlimit_default'));
3350
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('userlimit_editable')) {
3349
+    $bbbsession['userlimit'] = intval((int)\mod_bigbluebuttonbn\locallib\config::get('userlimit_default'));
3350
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('userlimit_editable')) {
3351 3351
         $bbbsession['userlimit'] = intval($bbbsession['bigbluebuttonbn']->userlimit);
3352 3352
     }
3353 3353
     $bbbsession['voicebridge'] = $bbbsession['bigbluebuttonbn']->voicebridge;
@@ -3500,7 +3500,7 @@  discard block
 block discarded – undo
3500 3500
         'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
3501 3501
     ];
3502 3502
     // Special metadata for recording processing.
3503
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
3503
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
3504 3504
         $metadata["bn-recording-status"] = json_encode(
3505 3505
             array(
3506 3506
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
@@ -3508,10 +3508,10 @@  discard block
 block discarded – undo
3508 3508
             )
3509 3509
         );
3510 3510
     }
3511
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3511
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3512 3512
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
3513 3513
     }
3514
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('meetingevents_enabled')) {
3514
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('meetingevents_enabled')) {
3515 3515
         $metadata['analytics-callback-url'] = $bbbsession['meetingEventsURL'];
3516 3516
     }
3517 3517
     return $metadata;
Please login to merge, or discard this patch.