Completed
Pull Request — v2.2-stable (#330)
by Jesus
02:19
created
classes/privacy/provider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@
 block discarded – undo
212 212
             function($instanceid, $data) use ($user, $instanceidstocmids) {
213 213
                 $context = \context_module::instance($instanceidstocmids[$instanceid]);
214 214
                 $contextdata = helper::get_context_data($context, $user);
215
-                $finaldata = (object) array_merge((array) $contextdata, ['logs' => $data]);
215
+                $finaldata = (object)array_merge((array)$contextdata, ['logs' => $data]);
216 216
                 helper::export_context_files($context, $user);
217 217
                 writer::with_context($context)->export_data([], $finaldata);
218 218
             }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public static function _get_metadata(collection $collection) {
63 63
 
64
-         // The table bigbluebuttonbn stores only the room properties.
65
-         // However, there is a chance that some personal information is stored as metadata.
66
-         // This would be done in the column 'participants' where rules can be set to define BBB roles.
67
-         // It is fair to say that only the userid is stored, which is useless if user is removed.
68
-         // But if this is a concern a refactoring on the way the rules are stored will be required.
64
+            // The table bigbluebuttonbn stores only the room properties.
65
+            // However, there is a chance that some personal information is stored as metadata.
66
+            // This would be done in the column 'participants' where rules can be set to define BBB roles.
67
+            // It is fair to say that only the userid is stored, which is useless if user is removed.
68
+            // But if this is a concern a refactoring on the way the rules are stored will be required.
69 69
         $collection->add_database_table('bigbluebuttonbn', [
70 70
             'participants' => 'privacy:metadata:bigbluebuttonbn:participants',
71 71
         ], 'privacy:metadata:bigbluebuttonbn');
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                     'meetingid' => $record->meetingid,
209 209
                     'log' => $record->log,
210 210
                     'meta' => $record->meta,
211
-                  ];
211
+                    ];
212 212
                 return $carry;
213 213
             },
214 214
             function($instanceid, $data) use ($user, $instanceidstocmids) {
Please login to merge, or discard this patch.
bbb_broker.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -440,26 +440,26 @@  discard block
 block discarded – undo
440 440
             return array(
441 441
                 'status' => false,
442 442
                 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn')
443
-              );
443
+                );
444 444
         }
445 445
         if ($realrecordings[$params['id']]['published'] !== 'true') {
446 446
             return array(
447 447
                 'status' => false,
448 448
                 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn')
449
-              );
449
+                );
450 450
         }
451 451
         return array(
452 452
             'status' => bigbluebuttonbn_publish_recording_imported(
453 453
                 $recordings[$params['id']]['imported'], true
454 454
             )
455
-          );
455
+            );
456 456
     }
457 457
     // As the recordingid was not identified as imported recording link, execute actual publish.
458 458
     return array(
459 459
         'status' => bigbluebuttonbn_publish_recordings(
460 460
             $params['id'], 'true'
461 461
         )
462
-      );
462
+        );
463 463
 }
464 464
 
465 465
 /**
@@ -480,26 +480,26 @@  discard block
 block discarded – undo
480 480
             return array(
481 481
                 'status' => false,
482 482
                 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn')
483
-              );
483
+                );
484 484
         }
485 485
         if ($realrecordings[$params['id']]['protected'] === 'true') {
486 486
             return array(
487 487
                 'status' => false,
488 488
                 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn')
489
-              );
489
+                );
490 490
         }
491 491
         return array(
492 492
             'status' => bigbluebuttonbn_protect_recording_imported(
493 493
                 $recordings[$params['id']]['imported'], false
494 494
             )
495
-          );
495
+            );
496 496
     }
497 497
     // As the recordingid was not identified as imported recording link, execute actual uprotect.
498 498
     return array(
499 499
         'status' => bigbluebuttonbn_update_recordings(
500 500
             $params['id'], array('protect' => 'false')
501 501
         )
502
-      );
502
+        );
503 503
 }
504 504
 
505 505
 /**
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
             'status' => bigbluebuttonbn_publish_recording_imported(
519 519
                 $recordings[$params['id']]['imported'], false
520 520
             )
521
-          );
521
+            );
522 522
     }
523 523
     // As the recordingid was not identified as imported recording link, execute unpublish on a real recording.
524 524
     // First: Unpublish imported links associated to the recording.
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
         'status' => bigbluebuttonbn_publish_recordings(
537 537
             $params['id'], 'false'
538 538
         )
539
-      );
539
+        );
540 540
 }
541 541
 
542 542
 /**
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
             'status' => bigbluebuttonbn_protect_recording_imported(
556 556
                 $recordings[$params['id']]['imported'], true
557 557
             )
558
-          );
558
+            );
559 559
     }
560 560
     // As the recordingid was not identified as imported recording link, execute protect on a real recording.
561 561
     // First: Protect imported links associated to the recording.
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         'status' => bigbluebuttonbn_update_recordings(
574 574
             $params['id'], array('protect' => 'true')
575 575
         )
576
-      );
576
+        );
577 577
 }
578 578
 
579 579
 /**
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
             'status' => bigbluebuttonbn_delete_recording_imported(
593 593
                 $recordings[$params['id']]['imported']
594 594
             )
595
-          );
595
+            );
596 596
     }
597 597
     // As the recordingid was not identified as imported recording link, execute delete on a real recording.
598 598
     // First: Delete imported links associated to the recording.
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
     // Second: Execute the actual delete.
607 607
     return array(
608 608
         'status' => bigbluebuttonbn_delete_recordings($params['id'])
609
-      );
609
+        );
610 610
 }
611 611
 
612 612
 /**
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
             'status' => bigbluebuttonbn_update_recording_imported(
625 625
                 $recordings[$params['id']]['imported'], json_decode($params['meta'], true)
626 626
             )
627
-          );
627
+            );
628 628
     }
629 629
 
630 630
     // As the recordingid was not identified as imported recording link, execute update on a real recording.
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
         'status' => bigbluebuttonbn_update_recordings(
635 635
             $params['id'], json_decode($params['meta'])
636 636
         )
637
-      );
637
+        );
638 638
 }
639 639
 
640 640
 /**
@@ -800,11 +800,11 @@  discard block
 block discarded – undo
800 800
     $params['recording_ready'] = [
801 801
             'bigbluebuttonbn' => 'An id for the bigbluebuttonbn instance should be included.',
802 802
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
803
-          ];
803
+            ];
804 804
     $params['live_session_events'] = [
805 805
             'bigbluebuttonbn' => 'An id for the bigbluebuttonbn instance should be included.',
806 806
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
807
-          ];
807
+            ];
808 808
     return $params;
809 809
 }
810 810
 
@@ -815,9 +815,9 @@  discard block
 block discarded – undo
815 815
  */
816 816
 function bigbluebuttonbn_broker_required_parameters_default($id) {
817 817
     return [
818
-              'id' => "The {$id} must be specified.",
819
-              'callback' => 'This call must include a javascript callback.'
820
-           ];
818
+                'id' => "The {$id} must be specified.",
819
+                'callback' => 'This call must include a javascript callback.'
820
+            ];
821 821
 }
822 822
 
823 823
 /**
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
  */
25 25
 
26 26
 
27
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
28
-require_once(dirname(__FILE__).'/locallib.php');
27
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
28
+require_once(dirname(__FILE__) . '/locallib.php');
29 29
 
30 30
 use \Firebase\JWT\JWT;
31 31
 
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 $params['meta'] = optional_param('meta', '', PARAM_TEXT);
42 42
 
43 43
 if (empty($params['action'])) {
44
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
44
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
45 45
     return;
46 46
 }
47 47
 
48 48
 $error = bigbluebuttonbn_broker_validate_parameters($params);
49 49
 if (!empty($error)) {
50
-    header('HTTP/1.0 400 Bad Request. '.$error);
50
+    header('HTTP/1.0 400 Bad Request. ' . $error);
51 51
     return;
52 52
 }
53 53
 
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
         bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm);
133 133
         return;
134 134
     }
135
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
135
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
136 136
     return;
137 137
 
138 138
 } catch (Exception $e) {
139
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
139
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
140 140
     return;
141 141
 }
142 142
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
323 323
     $callbackresponse['status'] = true;
324 324
     $callbackresponse['found'] = true;
325
-    $callbackresponse['published'] = (string) $recording['published'];
325
+    $callbackresponse['published'] = (string)$recording['published'];
326 326
     if (!isset($params['meta']) || empty($params['meta'])) {
327 327
         return $callbackresponse;
328 328
     }
@@ -651,8 +651,8 @@  discard block
 block discarded – undo
651 651
         $decodedparameters = JWT::decode($params['signed_parameters'],
652 652
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
653 653
     } catch (Exception $e) {
654
-        $error = 'Caught exception: '.$e->getMessage();
655
-        header('HTTP/1.0 400 Bad Request. '.$error);
654
+        $error = 'Caught exception: ' . $e->getMessage();
655
+        header('HTTP/1.0 400 Bad Request. ' . $error);
656 656
         return;
657 657
     }
658 658
 
@@ -678,12 +678,12 @@  discard block
 block discarded – undo
678 678
             bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
679 679
         }
680 680
         $overrides = array('meetingid' => $decodedparameters->meeting_id);
681
-        $meta = '{"recordid":"'.$decodedparameters->record_id.'"}';
681
+        $meta = '{"recordid":"' . $decodedparameters->record_id . '"}';
682 682
         bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
683 683
         header('HTTP/1.0 202 Accepted');
684 684
     } catch (Exception $e) {
685
-        $error = 'Caught exception: '.$e->getMessage();
686
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
685
+        $error = 'Caught exception: ' . $e->getMessage();
686
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
687 687
     }
688 688
 }
689 689
 
@@ -704,13 +704,13 @@  discard block
 block discarded – undo
704 704
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
705 705
     if (!isset($importrecordings[$params['id']])) {
706 706
         $error = "Recording {$params['id']} could not be found. It can not be imported";
707
-        header('HTTP/1.0 404 Not found. '.$error);
707
+        header('HTTP/1.0 404 Not found. ' . $error);
708 708
         return;
709 709
     }
710 710
     $callbackresponse = array('status' => true);
711 711
     $importrecordings[$params['id']]['imported'] = true;
712 712
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
713
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
713
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
714 714
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
715 715
     // Moodle event logger: Create an event for recording imported.
716 716
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -736,8 +736,8 @@  discard block
 block discarded – undo
736 736
         $decodedparameters = JWT::decode($params['signed_parameters'],
737 737
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
738 738
     } catch (Exception $e) {
739
-        $error = 'Caught exception: '.$e->getMessage();
740
-        header('HTTP/1.0 400 Bad Request. '.$error);
739
+        $error = 'Caught exception: ' . $e->getMessage();
740
+        header('HTTP/1.0 400 Bad Request. ' . $error);
741 741
         return;
742 742
     }
743 743
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
     $requiredparams = bigbluebuttonbn_broker_required_parameters();
773 773
     $action = strtolower($params['action']);
774 774
     if (!array_key_exists($action, $requiredparams)) {
775
-        return 'Action '.$params['action'].' can not be performed.';
775
+        return 'Action ' . $params['action'] . ' can not be performed.';
776 776
     }
777 777
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
778 778
 }
Please login to merge, or discard this patch.
locallib.php 3 patches
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once(dirname(__FILE__).'/lib.php');
31
+require_once(dirname(__FILE__) . '/lib.php');
32 32
 
33 33
 /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */
34 34
 const BIGBLUEBUTTONBN_UPDATE_CACHE = true;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
               'logoutURL' => $logouturl,
100 100
             ];
101 101
     // Choose between Adobe Flash or HTML5 Client.
102
-    if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) {
102
+    if ($clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5) {
103 103
         $data['joinViaHtml5'] = 'true';
104 104
     }
105 105
 
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
     $data = null;
129 129
     if (!is_null($pname) && !is_null($purl)) {
130 130
         $method = 'POST';
131
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
132
-            $purl."' /></module></modules>";
131
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
132
+            $purl . "' /></module></modules>";
133 133
     }
134 134
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
135 135
     if ($xml) {
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         // Override imported flag with actual ID.
291 291
         $recording['imported'] = $recordimported->id;
292 292
         if (isset($recordimported->protected)) {
293
-            $recording['protected'] = (string) $recordimported->protected;
293
+            $recording['protected'] = (string)$recordimported->protected;
294 294
         }
295 295
         $recordsimportedarray[$recording['recordID']] = $recording;
296 296
     }
@@ -320,21 +320,21 @@  discard block
 block discarded – undo
320 320
     // Add formats.
321 321
     $playbackarray = array();
322 322
     foreach ($recording->playback->format as $format) {
323
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
324
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
323
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
324
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
325 325
         // Add preview per format when existing.
326 326
         if ($format->preview) {
327
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
327
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
328 328
         }
329 329
     }
330 330
     // Add the metadata to the recordings array.
331 331
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
332
-    $recordingarray = array('recordID' => (string) $recording->recordID,
333
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
334
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
335
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
332
+    $recordingarray = array('recordID' => (string)$recording->recordID,
333
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
334
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
335
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
336 336
     if (isset($recording->protected)) {
337
-        $recordingarray['protected'] = (string) $recording->protected;
337
+        $recordingarray['protected'] = (string)$recording->protected;
338 338
     }
339 339
     return $recordingarray + $metadataarray;
340 340
 }
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 function bigbluebuttonbn_get_recording_preview_images($preview) {
350 350
     $imagesarray = array();
351 351
     foreach ($preview->images->image as $image) {
352
-        $imagearray = array('url' => trim((string) $image));
352
+        $imagearray = array('url' => trim((string)$image));
353 353
         foreach ($image->attributes() as $attkey => $attvalue) {
354
-            $imagearray[$attkey] = (string) $attvalue;
354
+            $imagearray[$attkey] = (string)$attvalue;
355 355
         }
356 356
         array_push($imagesarray, $imagearray);
357 357
     }
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
         if (is_object($value)) {
372 372
             $value = '';
373 373
         }
374
-        $metadataarray['meta_'.$key] = $value;
374
+        $metadataarray['meta_' . $key] = $value;
375 375
     }
376 376
     return $metadataarray;
377 377
 }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     $ids = explode(',', $recordids);
444 444
     foreach ($ids as $id) {
445 445
         $xml = bigbluebuttonbn_wrap_xml_load_file(
446
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
446
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
447 447
           );
448 448
         if ($xml && $xml->returncode != 'SUCCESS') {
449 449
             return false;
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
             return $xml;
509 509
         } catch (Exception $e) {
510 510
             libxml_use_internal_errors($previous);
511
-            $error = 'Caught exception: '.$e->getMessage();
511
+            $error = 'Caught exception: ' . $e->getMessage();
512 512
             debugging($error, DEBUG_DEVELOPER);
513 513
             return null;
514 514
         }
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
520 520
         return $response;
521 521
     } catch (Exception $e) {
522
-        $error = 'Caught exception: '.$e->getMessage();
522
+        $error = 'Caught exception: ' . $e->getMessage();
523 523
         debugging($error, DEBUG_DEVELOPER);
524 524
         libxml_use_internal_errors($previous);
525 525
         return null;
@@ -545,8 +545,8 @@  discard block
 block discarded – undo
545 545
         }
546 546
         $options = array();
547 547
         $options['CURLOPT_HTTPHEADER'] = array(
548
-                 'Content-Type: '.$contenttype,
549
-                 'Content-Length: '.strlen($data),
548
+                 'Content-Type: ' . $contenttype,
549
+                 'Content-Length: ' . strlen($data),
550 550
                  'Content-Language: en-US',
551 551
                );
552 552
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
  * @return void
568 568
  */
569 569
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
570
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
570
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
571 571
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
572 572
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
573 573
     }
@@ -587,9 +587,9 @@  discard block
 block discarded – undo
587 587
     if ($userroles) {
588 588
         $where = '';
589 589
         foreach ($userroles as $userrole) {
590
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid;
590
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid;
591 591
         }
592
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
592
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
593 593
     }
594 594
     return $userroles;
595 595
 }
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
  * @return array $users
613 613
  */
614 614
 function bigbluebuttonbn_get_users(context $context = null) {
615
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
615
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
616 616
     foreach ($users as $key => $value) {
617 617
         $users[$key] = fullname($value);
618 618
     }
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
  * @return array $users
628 628
  */
629 629
 function bigbluebuttonbn_get_users_select(context $context = null) {
630
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
630
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
631 631
     foreach ($users as $key => $value) {
632 632
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
633 633
     }
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
  * @return array $roles
643 643
  */
644 644
 function bigbluebuttonbn_get_roles(context $context = null) {
645
-    $roles = (array) role_get_names($context);
645
+    $roles = (array)role_get_names($context);
646 646
     foreach ($roles as $key => $value) {
647 647
         $roles[$key] = $value->localname;
648 648
     }
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
  * @return array $users
658 658
  */
659 659
 function bigbluebuttonbn_get_roles_select(context $context = null) {
660
-    $roles = (array) role_get_names($context);
660
+    $roles = (array)role_get_names($context);
661 661
     foreach ($roles as $key => $value) {
662 662
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
663 663
     }
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
  * @return object $role
673 673
  */
674 674
 function bigbluebuttonbn_get_role($id) {
675
-    $roles = (array) role_get_names();
675
+    $roles = (array)role_get_names();
676 676
     if (is_numeric($id) && isset($roles[$id])) {
677 677
         return (object)$roles[$id];
678 678
     }
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
     if (!isguestuser()) {
830 830
         $userroles = bigbluebuttonbn_get_user_roles($context, $userid);
831 831
     }
832
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
832
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
833 833
 }
834 834
 
835 835
 /**
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
 function bigbluebuttonbn_generate_nonce() {
986 986
     $mt = microtime();
987 987
     $rand = mt_rand();
988
-    return md5($mt.$rand);
988
+    return md5($mt . $rand);
989 989
 }
990 990
 
991 991
 /**
@@ -1011,21 +1011,21 @@  discard block
 block discarded – undo
1011 1011
  */
1012 1012
 function bigbluebuttonbn_events() {
1013 1013
     return array(
1014
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1015
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1016
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1017
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1018
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1019
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1020
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1021
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1022
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1023
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1024
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1025
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1026
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1027
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1028
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1014
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1015
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1016
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1017
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1018
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1019
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1020
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1021
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1022
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1023
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1024
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1025
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1026
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1027
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1028
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1029 1029
     );
1030 1030
 }
1031 1031
 
@@ -1036,21 +1036,21 @@  discard block
 block discarded – undo
1036 1036
  */
1037 1037
 function bigbluebuttonbn_events_action() {
1038 1038
     return array(
1039
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1040
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1041
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1042
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1043
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1044
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1045
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1046
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1047
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1048
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1049
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1050
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1051
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1052
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1053
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1039
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1040
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1041
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1042
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1043
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1044
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1045
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1046
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1047
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1048
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1049
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1050
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1051
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1052
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1053
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1054 1054
     );
1055 1055
 }
1056 1056
 
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
     if (array_key_exists('other', $options)) {
1082 1082
         $eventproperties['other'] = $options['other'];
1083 1083
     }
1084
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1084
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
1085 1085
       array($eventproperties));
1086 1086
     $event->trigger();
1087 1087
 }
@@ -1121,10 +1121,10 @@  discard block
 block discarded – undo
1121 1121
     $now = time();
1122 1122
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1123 1123
         // Use the value in the cache.
1124
-        return (array) json_decode($result['meeting_info']);
1124
+        return (array)json_decode($result['meeting_info']);
1125 1125
     }
1126 1126
     // Ping again and refresh the cache.
1127
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1127
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1128 1128
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1129 1129
       );
1130 1130
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
  * @return object
1236 1236
  */
1237 1237
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1238
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1238
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1239 1239
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1240 1240
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST',
1241 1241
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1251,8 +1251,8 @@  discard block
 block discarded – undo
1251 1251
  * @return string
1252 1252
  */
1253 1253
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1254
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1255
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1254
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1255
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1256 1256
     return $configxmlparams;
1257 1257
 }
1258 1258
 
@@ -1266,7 +1266,7 @@  discard block
 block discarded – undo
1266 1266
  */
1267 1267
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1268 1268
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1269
-    $configxmlarray = (array) $configxml;
1269
+    $configxmlarray = (array)$configxml;
1270 1270
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1271 1271
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1272 1272
         return '';
@@ -1358,7 +1358,7 @@  discard block
 block discarded – undo
1358 1358
     global $USER;
1359 1359
     $starttime = $starttime - ($starttime % 1000);
1360 1360
     // Set formatted date.
1361
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1361
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1362 1362
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1363 1363
 }
1364 1364
 
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
  * @return string
1475 1475
  */
1476 1476
 function bigbluebuttonbn_get_recording_data_row_preview($recording) {
1477
-    $options = array('id' => 'preview-'.$recording['recordID']);
1477
+    $options = array('id' => 'preview-' . $recording['recordID']);
1478 1478
     if ($recording['published'] === 'false') {
1479 1479
         $options['hidden'] = 'hidden';
1480 1480
     }
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
     if ($recording['published'] === 'false') {
1537 1537
         $visibility = 'hidden ';
1538 1538
     }
1539
-    $id = 'playbacks-'.$recording['recordID'];
1539
+    $id = 'playbacks-' . $recording['recordID'];
1540 1540
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1541 1541
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1542 1542
           'title' => $title, $visibility => $visibility));
@@ -1561,11 +1561,11 @@  discard block
 block discarded – undo
1561 1561
     if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) {
1562 1562
         return '';
1563 1563
     }
1564
-    $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1564
+    $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1565 1565
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1566
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1566
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1567 1567
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1568
-        $href .= '&href='.urlencode(trim($playback['url']));
1568
+        $href .= '&href=' . urlencode(trim($playback['url']));
1569 1569
     }
1570 1570
     $linkattributes = array(
1571 1571
         'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'],
@@ -1734,7 +1734,7 @@  discard block
 block discarded – undo
1734 1734
             $linkattributes['class'] = 'disabled';
1735 1735
             unset($linkattributes['onclick']);
1736 1736
         }
1737
-        $icon = new pix_icon('i/'.$data['tag'],
1737
+        $icon = new pix_icon('i/' . $data['tag'],
1738 1738
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1739 1739
             'moodle', $iconattributes);
1740 1740
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
@@ -1851,7 +1851,7 @@  discard block
 block discarded – undo
1851 1851
  */
1852 1852
 function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) {
1853 1853
     $row = new html_table_row();
1854
-    $row->id = 'recording-tr-'.$recording['recordID'];
1854
+    $row->id = 'recording-tr-' . $recording['recordID'];
1855 1855
     $row->attributes['data-imported'] = 'false';
1856 1856
     $texthead = '';
1857 1857
     $texttail = '';
@@ -1911,9 +1911,9 @@  discard block
 block discarded – undo
1911 1911
 function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) {
1912 1912
     $sender = get_admin();
1913 1913
     // Prepare message.
1914
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
1915
-        ' "' . $bigbluebuttonbn->name . '" '.
1916
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1914
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') .
1915
+        ' "' . $bigbluebuttonbn->name . '" ' .
1916
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1917 1917
     $context = context_course::instance($bigbluebuttonbn->course);
1918 1918
     \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext);
1919 1919
 }
@@ -2135,7 +2135,7 @@  discard block
 block discarded – undo
2135 2135
     }
2136 2136
     // Prepare select for loading records based on existent bigbluebuttonbns.
2137 2137
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
2138
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
2138
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
2139 2139
     // Include only Create events and exclude those with record not true.
2140 2140
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
2141 2141
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -2267,8 +2267,8 @@  discard block
 block discarded – undo
2267 2267
 function bigbluebuttonbn_format_activity_time($time) {
2268 2268
     $activitytime = '';
2269 2269
     if ($time) {
2270
-        $activitytime = calendar_day_representation($time).' '.
2271
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2270
+        $activitytime = calendar_day_representation($time) . ' ' .
2271
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2272 2272
           calendar_time_representation($time);
2273 2273
     }
2274 2274
     return $activitytime;
@@ -2694,7 +2694,7 @@  discard block
 block discarded – undo
2694 2694
  *
2695 2695
  * @return string
2696 2696
  */
2697
-function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') {
2697
+function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') {
2698 2698
     global $OUTPUT;
2699 2699
     $output = "\n";
2700 2700
     // Evaluates if config_warning is enabled.
@@ -2733,11 +2733,11 @@  discard block
 block discarded – undo
2733 2733
     if ($class == '') {
2734 2734
         $class = 'btn btn-secondary';
2735 2735
     }
2736
-    $output  = '  <form method="post" action="' . $href . '" class="form-inline">'."\n";
2737
-    $output .= '      <button type="submit" class="' . $class . '"'."\n";
2738
-    $output .= '          title="' . $title . '"'."\n";
2739
-    $output .= '          >' . $text . '</button>'."\n";
2740
-    $output .= '  </form>'."\n";
2736
+    $output  = '  <form method="post" action="' . $href . '" class="form-inline">' . "\n";
2737
+    $output .= '      <button type="submit" class="' . $class . '"' . "\n";
2738
+    $output .= '          title="' . $title . '"' . "\n";
2739
+    $output .= '          >' . $text . '</button>' . "\n";
2740
+    $output .= '  </form>' . "\n";
2741 2741
     return $output;
2742 2742
 }
2743 2743
 
Please login to merge, or discard this patch.
Doc Comments   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
  * Helper function to retrieve imported recordings from the Moodle database.
277 277
  * The references are stored as events in bigbluebuttonbn_logs.
278 278
  *
279
- * @param string $courseid
279
+ * @param integer $courseid
280 280
  * @param string $bigbluebuttonbnid
281 281
  * @param bool   $subset
282 282
  *
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 /**
305 305
  * Helper function to retrive the default config.xml file.
306 306
  *
307
- * @return string
307
+ * @return null|SimpleXMLElement
308 308
  */
309 309
 function bigbluebuttonbn_get_default_config_xml() {
310 310
     $xml = bigbluebuttonbn_wrap_xml_load_file(
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
  * @param object $a
387 387
  * @param object $b
388 388
  *
389
- * @return array
389
+ * @return integer
390 390
  */
391 391
 function bigbluebuttonbn_recording_build_sorter($a, $b) {
392 392
     if ($a['startTime'] < $b['startTime']) {
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
  * @param string $data
498 498
  * @param string $contenttype
499 499
  *
500
- * @return object
500
+ * @return null|SimpleXMLElement
501 501
  */
502 502
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
503 503
     if (extension_loaded('curl')) {
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
  * @param string $data
539 539
  * @param string $contenttype
540 540
  *
541
- * @return object
541
+ * @return string
542 542
  */
543 543
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
544 544
     $c = new curl();
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
  * @param integer $instance
912 912
  * @param integer $voicebridge
913 913
  *
914
- * @return string
914
+ * @return boolean
915 915
  */
916 916
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
917 917
     global $DB;
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
 /**
1015 1015
  * Helper returns an array with all possible bigbluebuttonbn events.
1016 1016
  *
1017
- * @return array
1017
+ * @return string[]
1018 1018
  */
1019 1019
 function bigbluebuttonbn_events() {
1020 1020
     return array(
@@ -1120,7 +1120,7 @@  discard block
 block discarded – undo
1120 1120
  * @param string $meetingid
1121 1121
  * @param boolean $updatecache
1122 1122
  *
1123
- * @return array
1123
+ * @return string
1124 1124
  */
1125 1125
 function bigbluebuttonbn_get_meeting_info($meetingid, $updatecache = false) {
1126 1126
     $cachettl = (int)\mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
  * @param string $meetingid
1241 1241
  * @param string $configxml
1242 1242
  *
1243
- * @return object
1243
+ * @return null|SimpleXMLElement
1244 1244
  */
1245 1245
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1246 1246
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
  * @param array $recording
1290 1290
  * @param array $tools
1291 1291
  *
1292
- * @return array
1292
+ * @return null|stdClass
1293 1293
  */
1294 1294
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1295 1295
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -1853,7 +1853,7 @@  discard block
 block discarded – undo
1853 1853
  *
1854 1854
  * @param array $bbbsession
1855 1855
  * @param array $recording
1856
- * @param object $rowdata
1856
+ * @param stdClass $rowdata
1857 1857
  *
1858 1858
  * @return object
1859 1859
  */
@@ -2048,7 +2048,7 @@  discard block
 block discarded – undo
2048 2048
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2049 2049
  * in the getRecordings request considering only those that belong to deleted activities.
2050 2050
  *
2051
- * @param string $courseid
2051
+ * @param integer $courseid
2052 2052
  * @param string $bigbluebuttonbnid
2053 2053
  * @param bool   $subset
2054 2054
  *
@@ -2072,7 +2072,7 @@  discard block
 block discarded – undo
2072 2072
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2073 2073
  * in the getRecordings request considering only those that belong to imported recordings.
2074 2074
  *
2075
- * @param string $courseid
2075
+ * @param integer $courseid
2076 2076
  * @param string $bigbluebuttonbnid
2077 2077
  * @param bool   $subset
2078 2078
  *
@@ -2095,7 +2095,7 @@  discard block
 block discarded – undo
2095 2095
 /**
2096 2096
  * Helper function to get recordings  and imported recordings together.
2097 2097
  *
2098
- * @param string $courseid
2098
+ * @param integer $courseid
2099 2099
  * @param string $bigbluebuttonbnid
2100 2100
  * @param bool   $subset
2101 2101
  * @param bool   $includedeleted
@@ -2113,7 +2113,7 @@  discard block
 block discarded – undo
2113 2113
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2114 2114
  * in bigbluebuttonbn_logs.
2115 2115
  *
2116
- * @param string $courseid
2116
+ * @param integer $courseid
2117 2117
  * @param string $bigbluebuttonbnid
2118 2118
  * @param bool   $subset
2119 2119
  * @param bool   $includedeleted
Please login to merge, or discard this patch.
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null,
96 96
             $userid = null, $clienttype = BIGBLUEBUTTON_CLIENTTYPE_FLASH, $createtime = null) {
97 97
     $data = ['meetingID' => $meetingid,
98
-              'fullName' => $username,
99
-              'password' => $pw,
100
-              'logoutURL' => $logouturl,
98
+                'fullName' => $username,
99
+                'password' => $pw,
100
+                'logoutURL' => $logouturl,
101 101
             ];
102 102
     // Choose between Adobe Flash or HTML5 Client.
103 103
     if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) {
@@ -157,23 +157,23 @@  discard block
 block discarded – undo
157 157
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
158 158
     $xml = bigbluebuttonbn_wrap_xml_load_file(
159 159
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
160
-      );
160
+        );
161 161
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
162 162
         // Meeting info was returned.
163 163
         return array('returncode' => $xml->returncode,
164
-                     'meetingID' => $xml->meetingID,
165
-                     'moderatorPW' => $xml->moderatorPW,
166
-                     'attendeePW' => $xml->attendeePW,
167
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
168
-                     'running' => $xml->running,
169
-                     'recording' => $xml->recording,
170
-                     'startTime' => $xml->startTime,
171
-                     'endTime' => $xml->endTime,
172
-                     'participantCount' => $xml->participantCount,
173
-                     'moderatorCount' => $xml->moderatorCount,
174
-                     'attendees' => $xml->attendees,
175
-                     'metadata' => $xml->metadata,
176
-                   );
164
+                        'meetingID' => $xml->meetingID,
165
+                        'moderatorPW' => $xml->moderatorPW,
166
+                        'attendeePW' => $xml->attendeePW,
167
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
168
+                        'running' => $xml->running,
169
+                        'recording' => $xml->recording,
170
+                        'startTime' => $xml->startTime,
171
+                        'endTime' => $xml->endTime,
172
+                        'participantCount' => $xml->participantCount,
173
+                        'moderatorCount' => $xml->moderatorCount,
174
+                        'attendees' => $xml->attendees,
175
+                        'metadata' => $xml->metadata,
176
+                    );
177 177
     }
178 178
     if ($xml) {
179 179
         // Either failure or success without meeting info.
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 function bigbluebuttonbn_get_default_config_xml() {
310 310
     $xml = bigbluebuttonbn_wrap_xml_load_file(
311 311
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
312
-      );
312
+        );
313 313
     return $xml;
314 314
 }
315 315
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     foreach ($ids as $id) {
411 411
         $xml = bigbluebuttonbn_wrap_xml_load_file(
412 412
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
413
-          );
413
+            );
414 414
         if ($xml && $xml->returncode != 'SUCCESS') {
415 415
             return false;
416 416
         }
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     foreach ($ids as $id) {
430 430
         $xml = bigbluebuttonbn_wrap_xml_load_file(
431 431
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
432
-          );
432
+            );
433 433
         if ($xml && $xml->returncode != 'SUCCESS') {
434 434
             return false;
435 435
         }
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
     foreach ($ids as $id) {
449 449
         $xml = bigbluebuttonbn_wrap_xml_load_file(
450 450
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
451
-          );
451
+            );
452 452
         if ($xml && $xml->returncode != 'SUCCESS') {
453 453
             return false;
454 454
         }
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
466 466
     $xml = bigbluebuttonbn_wrap_xml_load_file(
467 467
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
468
-      );
468
+        );
469 469
     if ($xml) {
470 470
         // If the xml packet returned failure it displays the message to the user.
471 471
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 function bigbluebuttonbn_get_server_version() {
483 483
     $xml = bigbluebuttonbn_wrap_xml_load_file(
484 484
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
485
-      );
485
+        );
486 486
     if ($xml && $xml->returncode == 'SUCCESS') {
487 487
         return $xml->version;
488 488
     }
@@ -549,10 +549,10 @@  discard block
 block discarded – undo
549 549
         }
550 550
         $options = array();
551 551
         $options['CURLOPT_HTTPHEADER'] = array(
552
-                 'Content-Type: '.$contenttype,
553
-                 'Content-Length: '.strlen($data),
554
-                 'Content-Language: en-US',
555
-               );
552
+                    'Content-Type: '.$contenttype,
553
+                    'Content-Length: '.strlen($data),
554
+                    'Content-Language: en-US',
555
+                );
556 556
 
557 557
         return $c->post($url, $data, $options);
558 558
     }
@@ -699,16 +699,16 @@  discard block
 block discarded – undo
699 699
         'all' => array(
700 700
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
701 701
             'children' => []
702
-          )
703
-      );
702
+            )
703
+        );
704 704
     $data['role'] = array(
705 705
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
706 706
         'children' => bigbluebuttonbn_get_roles_select($context)
707
-      );
707
+        );
708 708
     $data['user'] = array(
709 709
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
710 710
         'children' => bigbluebuttonbn_get_users_select($context)
711
-      );
711
+        );
712 712
     return $data;
713 713
 }
714 714
 
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
         'selectiontype' => 'all',
752 752
         'selectionid' => 'all',
753 753
         'role' => BIGBLUEBUTTONBN_ROLE_VIEWER
754
-      );
754
+        );
755 755
     $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default'));
756 756
     foreach ($defaultrules as $defaultrule) {
757 757
         if ($defaultrule == '0') {
@@ -764,9 +764,9 @@  discard block
 block discarded – undo
764 764
             continue;
765 765
         }
766 766
         $participantlist[] = array(
767
-              'selectiontype' => 'role',
768
-              'selectionid' => $defaultrule,
769
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
767
+                'selectiontype' => 'role',
768
+                'selectionid' => $defaultrule,
769
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
770 770
     }
771 771
     return $participantlist;
772 772
 }
@@ -805,11 +805,11 @@  discard block
 block discarded – undo
805 805
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
806 806
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
807 807
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
808
-          ],
808
+            ],
809 809
         'type_selected' => 'all',
810 810
         'options' => ['all' => '---------------'],
811 811
         'selected' => 'all',
812
-      ];
812
+        ];
813 813
 }
814 814
 
815 815
 /**
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
         $eventproperties['other'] = $options['other'];
1091 1091
     }
1092 1092
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1093
-      array($eventproperties));
1093
+        array($eventproperties));
1094 1094
     $event->trigger();
1095 1095
 }
1096 1096
 
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
     // Ping again and refresh the cache.
1135 1135
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1136 1136
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1137
-      );
1137
+        );
1138 1138
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1139 1139
     return $meetinginfo;
1140 1140
 }
@@ -1546,8 +1546,8 @@  discard block
 block discarded – undo
1546 1546
     }
1547 1547
     $id = 'playbacks-'.$recording['recordID'];
1548 1548
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1549
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1550
-          'title' => $title, $visibility => $visibility));
1549
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1550
+            'title' => $title, $visibility => $visibility));
1551 1551
     foreach ($recording['playbacks'] as $playback) {
1552 1552
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback);
1553 1553
     }
@@ -1571,7 +1571,7 @@  discard block
 block discarded – undo
1571 1571
     }
1572 1572
     $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1573 1573
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1574
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1574
+        '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1575 1575
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1576 1576
         $href .= '&href='.urlencode(trim($playback['url']));
1577 1577
     }
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
         'data-action' => 'play',
1583 1583
         'data-target' => $playback['type'],
1584 1584
         'data-href' => $href,
1585
-      );
1585
+        );
1586 1586
     if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) {
1587 1587
         $linkattributes['class'] = 'btn btn-sm btn-warning';
1588 1588
         $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn');
@@ -1732,10 +1732,10 @@  discard block
 block discarded – undo
1732 1732
             'id' => $id,
1733 1733
             'onclick' => $onclick,
1734 1734
             'data-action' => $data['action']
1735
-          );
1735
+            );
1736 1736
         if (!isset($recording['imported'])) {
1737 1737
             $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(
1738
-              $recording['recordID']);
1738
+                $recording['recordID']);
1739 1739
         }
1740 1740
         if (isset($data['disabled'])) {
1741 1741
             $iconattributes['class'] .= ' fa-' . $data['disabled'];
@@ -2294,8 +2294,8 @@  discard block
 block discarded – undo
2294 2294
     $activitytime = '';
2295 2295
     if ($time) {
2296 2296
         $activitytime = calendar_day_representation($time).' '.
2297
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2298
-          calendar_time_representation($time);
2297
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2298
+            calendar_time_representation($time);
2299 2299
     }
2300 2300
     return $activitytime;
2301 2301
 }
@@ -2391,7 +2391,7 @@  discard block
 block discarded – undo
2391 2391
     global $BIGBLUEBUTTONBN_CFG;
2392 2392
     if (isset($BIGBLUEBUTTONBN_CFG)) {
2393 2393
         $renderer->render_warning_message('general_warning',
2394
-             get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn'));
2394
+                get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn'));
2395 2395
     }
2396 2396
 }
2397 2397
 
@@ -2599,7 +2599,7 @@  discard block
 block discarded – undo
2599 2599
         $renderer->render_group_element('participant_moderator_default',
2600 2600
             $renderer->render_group_element_configmultiselect('participant_moderator_default',
2601 2601
                 array_keys($owner), array_merge($owner, $roles))
2602
-          );
2602
+            );
2603 2603
     }
2604 2604
 }
2605 2605
 
@@ -2637,7 +2637,7 @@  discard block
 block discarded – undo
2637 2637
         $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
2638 2638
 
2639 2639
         $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
2640
-                         BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2640
+                            BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2641 2641
         $renderer->render_group_element('clienttype_default',
2642 2642
             $renderer->render_group_element_configselect('clienttype_default',
2643 2643
                 $default, $choices));
@@ -2730,7 +2730,7 @@  discard block
 block discarded – undo
2730 2730
         return $output;
2731 2731
     }
2732 2732
     $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in',
2733
-      'bigbluebuttonbn_view_general_warning') . "\n";
2733
+        'bigbluebuttonbn_view_general_warning') . "\n";
2734 2734
     $output .= '    ' . $message . "\n";
2735 2735
     $output .= '  <div class="singlebutton pull-right">' . "\n";
2736 2736
     if (!empty($href)) {
Please login to merge, or discard this patch.
classes/locallib/config.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -165,36 +165,36 @@
 block discarded – undo
165 165
      */
166 166
     public static function get_options() {
167 167
         return array(
168
-               'version_major' => self::get_moodle_version_major(),
169
-               'voicebridge_editable' => self::get('voicebridge_editable'),
170
-               'importrecordings_enabled' => self::get('importrecordings_enabled'),
171
-               'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'),
172
-               'waitformoderator_default' => self::get('waitformoderator_default'),
173
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
174
-               'userlimit_default' => self::get('userlimit_default'),
175
-               'userlimit_editable' => self::get('userlimit_editable'),
176
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
177
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
178
-               'recordings_enabled' => self::get('recordings_enabled'),
179
-               'recordings_html_default' => self::get('recordings_html_default'),
180
-               'recordings_html_editable' => self::get('recordings_html_editable'),
181
-               'recordings_deleted_default' => self::get('recordings_deleted_default'),
182
-               'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
183
-               'recordings_imported_default' => self::get('recordings_imported_default'),
184
-               'recordings_imported_editable' => self::get('recordings_imported_editable'),
185
-               'recordings_preview_default' => self::get('recordings_preview_default'),
186
-               'recordings_preview_editable' => self::get('recordings_preview_editable'),
187
-               'recording_default' => self::get('recording_default'),
188
-               'recording_editable' => self::get('recording_editable'),
189
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
190
-               'general_warning_message' => self::get('general_warning_message'),
191
-               'general_warning_box_type' => self::get('general_warning_box_type'),
192
-               'general_warning_button_text' => self::get('general_warning_button_text'),
193
-               'general_warning_button_href' => self::get('general_warning_button_href'),
194
-               'general_warning_button_class' => self::get('general_warning_button_class'),
195
-               'clienttype_enabled' => self::get('clienttype_enabled'),
196
-               'clienttype_editable' => self::get('clienttype_editable'),
197
-               'clienttype_default' => self::get('clienttype_default'),
198
-          );
168
+                'version_major' => self::get_moodle_version_major(),
169
+                'voicebridge_editable' => self::get('voicebridge_editable'),
170
+                'importrecordings_enabled' => self::get('importrecordings_enabled'),
171
+                'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'),
172
+                'waitformoderator_default' => self::get('waitformoderator_default'),
173
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
174
+                'userlimit_default' => self::get('userlimit_default'),
175
+                'userlimit_editable' => self::get('userlimit_editable'),
176
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
177
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
178
+                'recordings_enabled' => self::get('recordings_enabled'),
179
+                'recordings_html_default' => self::get('recordings_html_default'),
180
+                'recordings_html_editable' => self::get('recordings_html_editable'),
181
+                'recordings_deleted_default' => self::get('recordings_deleted_default'),
182
+                'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
183
+                'recordings_imported_default' => self::get('recordings_imported_default'),
184
+                'recordings_imported_editable' => self::get('recordings_imported_editable'),
185
+                'recordings_preview_default' => self::get('recordings_preview_default'),
186
+                'recordings_preview_editable' => self::get('recordings_preview_editable'),
187
+                'recording_default' => self::get('recording_default'),
188
+                'recording_editable' => self::get('recording_editable'),
189
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
190
+                'general_warning_message' => self::get('general_warning_message'),
191
+                'general_warning_box_type' => self::get('general_warning_box_type'),
192
+                'general_warning_button_text' => self::get('general_warning_button_text'),
193
+                'general_warning_button_href' => self::get('general_warning_button_href'),
194
+                'general_warning_button_class' => self::get('general_warning_button_class'),
195
+                'clienttype_enabled' => self::get('clienttype_enabled'),
196
+                'clienttype_editable' => self::get('clienttype_editable'),
197
+                'clienttype_default' => self::get('clienttype_default'),
198
+            );
199 199
     }
200 200
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public static function defaultvalues() {
57 57
         return array(
58
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
59
-            'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
58
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
59
+            'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
60 60
             'voicebridge_editable' => false,
61 61
             'importrecordings_enabled' => false,
62 62
             'importrecordings_from_deleted_enabled' => false,
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
         if (isset($CFG->bigbluebuttonbn[$setting])) {
125 125
             return (string)$CFG->bigbluebuttonbn[$setting];
126 126
         }
127
-        if (isset($CFG->{'bigbluebuttonbn_'.$setting})) {
128
-            return (string)$CFG->{'bigbluebuttonbn_'.$setting};
127
+        if (isset($CFG->{'bigbluebuttonbn_' . $setting})) {
128
+            return (string)$CFG->{'bigbluebuttonbn_' . $setting};
129 129
         }
130 130
         return self::defaultvalue($setting);
131 131
     }
Please login to merge, or discard this patch.
view.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
  * @author    Fred Dixon  (ffdixon [at] blindsidenetworks [dt] com)
25 25
  */
26 26
 
27
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
28
-require_once(dirname(__FILE__).'/locallib.php');
27
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
28
+require_once(dirname(__FILE__) . '/locallib.php');
29 29
 
30 30
 $id = required_param('id', PARAM_INT);
31 31
 $bn = optional_param('n', 0, PARAM_INT);
@@ -60,19 +60,19 @@  discard block
 block discarded – undo
60 60
 if (is_null($serverversion)) {
61 61
     if ($bbbsession['administrator']) {
62 62
         print_error('view_error_unable_join', 'bigbluebuttonbn',
63
-            $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
63
+            $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
64 64
         exit;
65 65
     }
66 66
     if ($bbbsession['moderator']) {
67 67
         print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
68
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
68
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
69 69
         exit;
70 70
     }
71 71
     print_error('view_error_unable_join_student', 'bigbluebuttonbn',
72
-        $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
72
+        $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
73 73
     exit;
74 74
 }
75
-$bbbsession['serverversion'] = (string) $serverversion;
75
+$bbbsession['serverversion'] = (string)$serverversion;
76 76
 
77 77
 // Mark viewed by user (if required).
78 78
 $completion = new completion_info($course);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 // Print the page header.
82 82
 $PAGE->set_context($context);
83
-$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
83
+$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
84 84
 $PAGE->set_title(format_string($bigbluebuttonbn->name));
85 85
 $PAGE->set_cacheable(false);
86 86
 $PAGE->set_heading($course->fullname);
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) {
91 91
     echo $OUTPUT->header();
92 92
     if (isguestuser()) {
93
-        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
94
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
93
+        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
94
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
95 95
     } else {
96
-        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
97
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
96
+        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
97
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
98 98
     }
99 99
     echo $OUTPUT->footer();
100 100
     exit;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 // Operation URLs.
104 104
 $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
105
-$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .
105
+$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
106 106
     '&bn=' . $bbbsession['bigbluebuttonbn']->id;
107 107
 $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
108 108
     'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 echo $OUTPUT->footer();
123 123
 
124 124
 // Shows version as a comment.
125
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
125
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
126 126
 
127 127
 // Initialize session variable used across views.
128 128
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass;
151 151
     $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass;
152 152
     // Database info related to the activity.
153
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
153
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
154 154
         $bbbsession['bigbluebuttonbn']->id;
155 155
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
156 156
     $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro;
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
171 171
     }
172 172
     if ($bbbsession['bigbluebuttonbn']->record) {
173
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
173
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
174 174
     }
175 175
     $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime;
176 176
     $bbbsession['closingtime'] = $bbbsession['bigbluebuttonbn']->closingtime;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     $bbbsession['originServerName'] = $parsedurl['host'];
184 184
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
185 185
     $bbbsession['originServerCommonName'] = '';
186
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
186
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
187 187
     $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server();
188 188
     // Setting for clienttype, assign flash if not enabled, or default if not editable.
189 189
     $bbbsession['clienttype'] = \mod_bigbluebuttonbn\locallib\config::get('clienttype_default');
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
         $groupname = groups_get_group_name($bbbsession['group']);
247 247
     }
248 248
     // Assign group default values.
249
-    $bbbsession['meetingid'] .= '['.$bbbsession['group'].']';
250
-    $bbbsession['meetingname'] .= ' ('.$groupname.')';
249
+    $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']';
250
+    $bbbsession['meetingname'] .= ' (' . $groupname . ')';
251 251
     if (count($groups) == 0) {
252 252
         // Only the All participants group exists.
253 253
         bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_notenrolled_warning', 'bigbluebuttonbn'), 'info');
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     if (has_capability('moodle/site:accessallgroups', $context)) {
258 258
         bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'));
259 259
     }
260
-    $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id;
260
+    $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
261 261
     groups_print_activity_menu($bbbsession['cm'], $urltoroot);
262 262
     echo '<br><br>';
263 263
 }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         $recordingsdisabled = get_string('view_message_recordings_disabled', 'bigbluebuttonbn');
325 325
         $output .= bigbluebuttonbn_render_warning($recordingsdisabled, 'danger');
326 326
     }
327
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
327
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
328 328
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
329 329
 }
330 330
 
@@ -393,12 +393,12 @@  discard block
 block discarded – undo
393 393
     // JavaScript variables for room.
394 394
     $openingtime = '';
395 395
     if ($bbbsession['openingtime']) {
396
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
396
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
397 397
             userdate($bbbsession['openingtime']);
398 398
     }
399 399
     $closingtime = '';
400 400
     if ($bbbsession['closingtime']) {
401
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
401
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
402 402
             userdate($bbbsession['closingtime']);
403 403
     }
404 404
     $jsvars += array(
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
     $output .= $OUTPUT->box_end();
416 416
     // Action button box.
417 417
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
418
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
418
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
419 419
     $output .= $OUTPUT->box_end();
420 420
     if ($activity == 'ended') {
421 421
         $output .= bigbluebuttonbn_view_ended($bbbsession);
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
     // If there are meetings with recordings load the data to the table.
469 469
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
470 470
         // Render a plain html table.
471
-        return bigbluebuttonbn_output_recording_table($bbbsession, $recordings)."\n";
471
+        return bigbluebuttonbn_output_recording_table($bbbsession, $recordings) . "\n";
472 472
     }
473 473
     // JavaScript variables for recordings with YUI.
474 474
     $jsvars += array(
@@ -496,8 +496,8 @@  discard block
 block discarded – undo
496 496
         array('type' => 'button',
497 497
               'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
498 498
               'class' => 'btn btn-secondary',
499
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
500
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
499
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
500
+                  $bbbsession['bigbluebuttonbn']->id . '\''));
501 501
     $output  = html_writer::empty_tag('br');
502 502
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
503 503
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -516,10 +516,10 @@  discard block
 block discarded – undo
516 516
     if (!is_null($bbbsession['presentation']['url'])) {
517 517
         $attributes = array('title' => $bbbsession['presentation']['name']);
518 518
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
519
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
520
-                $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).
519
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
520
+                $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) .
521 521
                 $OUTPUT->action_link($bbbsession['presentation']['url'],
522
-                $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
522
+                $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
523 523
     }
524 524
     return '';
525 525
 }
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -446,12 +446,12 @@  discard block
 block discarded – undo
446 446
     $recordings = bigbluebuttonbn_get_recordings(
447 447
         $bbbsession['course']->id, $bigbluebuttonbnid, $enabledfeatures['showroom'],
448 448
         $bbbsession['bigbluebuttonbn']->recordings_deleted
449
-      );
449
+        );
450 450
     if ($enabledfeatures['importrecordings']) {
451 451
         // Get recording links.
452 452
         $recordingsimported = bigbluebuttonbn_get_recordings_imported_array(
453 453
             $bbbsession['course']->id, $bbbsession['bigbluebuttonbn']->id
454
-          );
454
+            );
455 455
         /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent
456 456
          * recordings are not included. */
457 457
         if ($bbbsession['bigbluebuttonbn']->recordings_imported) {
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
     // JavaScript variables for recordings.
470 470
     $jsvars += array(
471 471
             'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1',
472
-          );
472
+            );
473 473
     // If there are meetings with recordings load the data to the table.
474 474
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
475 475
         // Render a plain html table.
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
     $jsvars += array(
480 480
             'columns' => bigbluebuttonbn_get_recording_columns($bbbsession),
481 481
             'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings),
482
-          );
482
+            );
483 483
     // Render a YUI table.
484 484
     return html_writer::div('', '', array('id' => 'bigbluebuttonbn_recordings_table'));
485 485
 }
@@ -499,10 +499,10 @@  discard block
 block discarded – undo
499 499
     }
500 500
     $button = html_writer::tag('input', '',
501 501
         array('type' => 'button',
502
-              'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
503
-              'class' => 'btn btn-secondary',
504
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
505
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
502
+                'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
503
+                'class' => 'btn btn-secondary',
504
+                'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
505
+                    $bbbsession['bigbluebuttonbn']->id.'\''));
506 506
     $output  = html_writer::empty_tag('br');
507 507
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
508 508
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -581,5 +581,5 @@  discard block
 block discarded – undo
581 581
         (string)\mod_bigbluebuttonbn\locallib\config::get('general_warning_button_href'),
582 582
         (string)\mod_bigbluebuttonbn\locallib\config::get('general_warning_button_text'),
583 583
         (string)\mod_bigbluebuttonbn\locallib\config::get('general_warning_button_class')
584
-      );
584
+        );
585 585
 }
Please login to merge, or discard this patch.