Completed
Pull Request — v2.2-stable (#65)
by Jesus
48:44 queued 06:56
created
classes/event/bigbluebuttonbn_meeting_joined.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@
 block discarded – undo
40 40
      */
41 41
     protected function init() {
42 42
         parent::init();
43
-        $this->description = "The user with id '##userid' has joined a bigbluebutton meeting for ".
44
-            "the bigbluebuttonbn activity with id '##objectid' for the course id ".
43
+        $this->description = "The user with id '##userid' has joined a bigbluebutton meeting for " .
44
+            "the bigbluebuttonbn activity with id '##objectid' for the course id " .
45 45
             "'##contextinstanceid'.";
46 46
     }
47 47
 
Please login to merge, or discard this patch.
db/upgrade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
 defined('MOODLE_INTERNAL') || die();
28 28
 
29
-require_once(dirname(dirname(__FILE__)).'/locallib.php');
29
+require_once(dirname(dirname(__FILE__)) . '/locallib.php');
30 30
 
31 31
 /**
32 32
  * Performs data migrations and updates on upgrade.
Please login to merge, or discard this patch.
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.
classes/locallib/config.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -152,33 +152,33 @@
 block discarded – undo
152 152
      */
153 153
     public static function get_options() {
154 154
         return array(
155
-               'version_major' => self::get_moodle_version_major(),
156
-               'voicebridge_editable' => self::get('voicebridge_editable'),
157
-               'importrecordings_enabled' => self::get('importrecordings_enabled'),
158
-               'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'),
159
-               'waitformoderator_default' => self::get('waitformoderator_default'),
160
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
161
-               'userlimit_default' => self::get('userlimit_default'),
162
-               'userlimit_editable' => self::get('userlimit_editable'),
163
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
164
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
165
-               'recordings_enabled' => self::get('recordings_enabled'),
166
-               'recordings_html_default' => self::get('recordings_html_default'),
167
-               'recordings_html_editable' => self::get('recordings_html_editable'),
168
-               'recordings_deleted_default' => self::get('recordings_deleted_default'),
169
-               'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
170
-               'recordings_imported_default' => self::get('recordings_imported_default'),
171
-               'recordings_imported_editable' => self::get('recordings_imported_editable'),
172
-               'recordings_preview_default' => self::get('recordings_preview_default'),
173
-               'recordings_preview_editable' => self::get('recordings_preview_editable'),
174
-               'recording_default' => self::get('recording_default'),
175
-               'recording_editable' => self::get('recording_editable'),
176
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
177
-               'general_warning_message' => self::get('general_warning_message'),
178
-               'general_warning_box_type' => self::get('general_warning_box_type'),
179
-               'general_warning_button_text' => self::get('general_warning_button_text'),
180
-               'general_warning_button_href' => self::get('general_warning_button_href'),
181
-               'general_warning_button_class' => self::get('general_warning_button_class'),
182
-          );
155
+                'version_major' => self::get_moodle_version_major(),
156
+                'voicebridge_editable' => self::get('voicebridge_editable'),
157
+                'importrecordings_enabled' => self::get('importrecordings_enabled'),
158
+                'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'),
159
+                'waitformoderator_default' => self::get('waitformoderator_default'),
160
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
161
+                'userlimit_default' => self::get('userlimit_default'),
162
+                'userlimit_editable' => self::get('userlimit_editable'),
163
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
164
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
165
+                'recordings_enabled' => self::get('recordings_enabled'),
166
+                'recordings_html_default' => self::get('recordings_html_default'),
167
+                'recordings_html_editable' => self::get('recordings_html_editable'),
168
+                'recordings_deleted_default' => self::get('recordings_deleted_default'),
169
+                'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
170
+                'recordings_imported_default' => self::get('recordings_imported_default'),
171
+                'recordings_imported_editable' => self::get('recordings_imported_editable'),
172
+                'recordings_preview_default' => self::get('recordings_preview_default'),
173
+                'recordings_preview_editable' => self::get('recordings_preview_editable'),
174
+                'recording_default' => self::get('recording_default'),
175
+                'recording_editable' => self::get('recording_editable'),
176
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
177
+                'general_warning_message' => self::get('general_warning_message'),
178
+                'general_warning_box_type' => self::get('general_warning_box_type'),
179
+                'general_warning_button_text' => self::get('general_warning_button_text'),
180
+                'general_warning_button_href' => self::get('general_warning_button_href'),
181
+                'general_warning_button_class' => self::get('general_warning_button_class'),
182
+            );
183 183
     }
184 184
 }
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',
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
         if (isset($CFG->bigbluebuttonbn[$setting])) {
122 122
             return (string)$CFG->bigbluebuttonbn[$setting];
123 123
         }
124
-        if (isset($CFG->{'bigbluebuttonbn_'.$setting})) {
125
-            return (string)$CFG->{'bigbluebuttonbn_'.$setting};
124
+        if (isset($CFG->{'bigbluebuttonbn_' . $setting})) {
125
+            return (string)$CFG->{'bigbluebuttonbn_' . $setting};
126 126
         }
127 127
         return self::defaultvalue($setting);
128 128
     }
Please login to merge, or discard this patch.
locallib.php 3 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
  */
121 121
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
122 122
     $data = ['meetingID' => $meetingid,
123
-              'fullName' => $username,
124
-              'password' => $pw,
125
-              'logoutURL' => $logouturl,
123
+                'fullName' => $username,
124
+                'password' => $pw,
125
+                'logoutURL' => $logouturl,
126 126
             ];
127 127
     if (!is_null($configtoken)) {
128 128
         $data['configToken'] = $configtoken;
@@ -174,23 +174,23 @@  discard block
 block discarded – undo
174 174
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
175 175
     $xml = bigbluebuttonbn_wrap_xml_load_file(
176 176
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
177
-      );
177
+        );
178 178
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
179 179
         // Meeting info was returned.
180 180
         return array('returncode' => $xml->returncode,
181
-                     'meetingID' => $xml->meetingID,
182
-                     'moderatorPW' => $xml->moderatorPW,
183
-                     'attendeePW' => $xml->attendeePW,
184
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
185
-                     'running' => $xml->running,
186
-                     'recording' => $xml->recording,
187
-                     'startTime' => $xml->startTime,
188
-                     'endTime' => $xml->endTime,
189
-                     'participantCount' => $xml->participantCount,
190
-                     'moderatorCount' => $xml->moderatorCount,
191
-                     'attendees' => $xml->attendees,
192
-                     'metadata' => $xml->metadata,
193
-                   );
181
+                        'meetingID' => $xml->meetingID,
182
+                        'moderatorPW' => $xml->moderatorPW,
183
+                        'attendeePW' => $xml->attendeePW,
184
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
185
+                        'running' => $xml->running,
186
+                        'recording' => $xml->recording,
187
+                        'startTime' => $xml->startTime,
188
+                        'endTime' => $xml->endTime,
189
+                        'participantCount' => $xml->participantCount,
190
+                        'moderatorCount' => $xml->moderatorCount,
191
+                        'attendees' => $xml->attendees,
192
+                        'metadata' => $xml->metadata,
193
+                    );
194 194
     }
195 195
     if ($xml) {
196 196
         // Either failure or success without meeting info.
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 function bigbluebuttonbn_get_default_config_xml() {
327 327
     $xml = bigbluebuttonbn_wrap_xml_load_file(
328 328
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
329
-      );
329
+        );
330 330
     return $xml;
331 331
 }
332 332
 
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
     foreach ($ids as $id) {
428 428
         $xml = bigbluebuttonbn_wrap_xml_load_file(
429 429
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
430
-          );
430
+            );
431 431
         if ($xml && $xml->returncode != 'SUCCESS') {
432 432
             return false;
433 433
         }
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
     foreach ($ids as $id) {
447 447
         $xml = bigbluebuttonbn_wrap_xml_load_file(
448 448
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
449
-          );
449
+            );
450 450
         if ($xml && $xml->returncode != 'SUCCESS') {
451 451
             return false;
452 452
         }
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
     foreach ($ids as $id) {
466 466
         $xml = bigbluebuttonbn_wrap_xml_load_file(
467 467
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
468
-          );
468
+            );
469 469
         if ($xml && $xml->returncode != 'SUCCESS') {
470 470
             return false;
471 471
         }
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
483 483
     $xml = bigbluebuttonbn_wrap_xml_load_file(
484 484
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
485
-      );
485
+        );
486 486
     if ($xml) {
487 487
         // If the xml packet returned failure it displays the message to the user.
488 488
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 function bigbluebuttonbn_get_server_version() {
500 500
     $xml = bigbluebuttonbn_wrap_xml_load_file(
501 501
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
502
-      );
502
+        );
503 503
     if ($xml && $xml->returncode == 'SUCCESS') {
504 504
         return $xml->version;
505 505
     }
@@ -566,10 +566,10 @@  discard block
 block discarded – undo
566 566
         }
567 567
         $options = array();
568 568
         $options['CURLOPT_HTTPHEADER'] = array(
569
-                 'Content-Type: '.$contenttype,
570
-                 'Content-Length: '.strlen($data),
571
-                 'Content-Language: en-US',
572
-               );
569
+                    'Content-Type: '.$contenttype,
570
+                    'Content-Length: '.strlen($data),
571
+                    'Content-Language: en-US',
572
+                );
573 573
 
574 574
         return $c->post($url, $data, $options);
575 575
     }
@@ -716,16 +716,16 @@  discard block
 block discarded – undo
716 716
         'all' => array(
717 717
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
718 718
             'children' => []
719
-          )
720
-      );
719
+            )
720
+        );
721 721
     $data['role'] = array(
722 722
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
723 723
         'children' => bigbluebuttonbn_get_roles_select($context)
724
-      );
724
+        );
725 725
     $data['user'] = array(
726 726
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
727 727
         'children' => bigbluebuttonbn_get_users_select($context)
728
-      );
728
+        );
729 729
     return $data;
730 730
 }
731 731
 
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
         'selectiontype' => 'all',
767 767
         'selectionid' => 'all',
768 768
         'role' => BIGBLUEBUTTONBN_ROLE_VIEWER
769
-      );
769
+        );
770 770
     $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default'));
771 771
     foreach ($defaultrules as $defaultrule) {
772 772
         if ($defaultrule == '0') {
@@ -779,9 +779,9 @@  discard block
 block discarded – undo
779 779
             continue;
780 780
         }
781 781
         $participantlist[] = array(
782
-              'selectiontype' => 'role',
783
-              'selectionid' => $defaultrule,
784
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
782
+                'selectiontype' => 'role',
783
+                'selectionid' => $defaultrule,
784
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
785 785
     }
786 786
     return $participantlist;
787 787
 }
@@ -820,11 +820,11 @@  discard block
 block discarded – undo
820 820
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
821 821
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
822 822
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
823
-          ],
823
+            ],
824 824
         'type_selected' => 'all',
825 825
         'options' => ['all' => '---------------'],
826 826
         'selected' => 'all',
827
-      ];
827
+        ];
828 828
 }
829 829
 
830 830
 /**
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
         $eventproperties['other'] = $options['other'];
1102 1102
     }
1103 1103
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1104
-      array($eventproperties));
1104
+        array($eventproperties));
1105 1105
     $event->trigger();
1106 1106
 }
1107 1107
 
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
     // Ping again and refresh the cache.
1146 1146
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1147 1147
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1148
-      );
1148
+        );
1149 1149
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1150 1150
     return $meetinginfo;
1151 1151
 }
@@ -1557,8 +1557,8 @@  discard block
 block discarded – undo
1557 1557
     }
1558 1558
     $id = 'playbacks-'.$recording['recordID'];
1559 1559
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1560
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1561
-          'title' => $title, $visibility => $visibility));
1560
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1561
+            'title' => $title, $visibility => $visibility));
1562 1562
     foreach ($recording['playbacks'] as $playback) {
1563 1563
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback);
1564 1564
     }
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
     }
1583 1583
     $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1584 1584
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1585
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1585
+        '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1586 1586
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1587 1587
         $href .= '&href='.urlencode(trim($playback['url']));
1588 1588
     }
@@ -1593,7 +1593,7 @@  discard block
 block discarded – undo
1593 1593
         'data-action' => 'play',
1594 1594
         'data-target' => $playback['type'],
1595 1595
         'data-href' => $href,
1596
-      );
1596
+        );
1597 1597
     if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) {
1598 1598
         $linkattributes['class'] = 'btn btn-sm btn-warning';
1599 1599
         $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn');
@@ -1743,10 +1743,10 @@  discard block
 block discarded – undo
1743 1743
             'id' => $id,
1744 1744
             'onclick' => $onclick,
1745 1745
             'data-action' => $data['action']
1746
-          );
1746
+            );
1747 1747
         if (!isset($recording['imported'])) {
1748 1748
             $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(
1749
-              $recording['recordID']);
1749
+                $recording['recordID']);
1750 1750
         }
1751 1751
         if (isset($data['disabled'])) {
1752 1752
             $iconattributes['class'] .= ' fa-' . $data['disabled'];
@@ -2287,8 +2287,8 @@  discard block
 block discarded – undo
2287 2287
     $activitytime = '';
2288 2288
     if ($time) {
2289 2289
         $activitytime = calendar_day_representation($time).' '.
2290
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2291
-          calendar_time_representation($time);
2290
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2291
+            calendar_time_representation($time);
2292 2292
     }
2293 2293
     return $activitytime;
2294 2294
 }
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
     global $BIGBLUEBUTTONBN_CFG;
2385 2385
     if (isset($BIGBLUEBUTTONBN_CFG)) {
2386 2386
         $renderer->render_warning_message('general_warning',
2387
-             get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn'));
2387
+                get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn'));
2388 2388
     }
2389 2389
 }
2390 2390
 
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
         $renderer->render_group_element('participant_moderator_default',
2593 2593
             $renderer->render_group_element_configmultiselect('participant_moderator_default',
2594 2594
                 array_keys($owner), array_merge($owner, $roles))
2595
-          );
2595
+            );
2596 2596
     }
2597 2597
 }
2598 2598
 
@@ -2696,7 +2696,7 @@  discard block
 block discarded – undo
2696 2696
         return $output;
2697 2697
     }
2698 2698
     $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in',
2699
-      'bigbluebuttonbn_view_general_warning') . "\n";
2699
+        'bigbluebuttonbn_view_general_warning') . "\n";
2700 2700
     $output .= '    ' . $message . "\n";
2701 2701
     $output .= '  <div class="singlebutton pull-right">' . "\n";
2702 2702
     if (!empty($href)) {
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 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;
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
     $data = null;
150 150
     if (!is_null($pname) && !is_null($purl)) {
151 151
         $method = 'POST';
152
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
153
-            $purl."' /></module></modules>";
152
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
153
+            $purl . "' /></module></modules>";
154 154
     }
155 155
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
156 156
     if ($xml) {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
         // Override imported flag with actual ID.
312 312
         $recording['imported'] = $recordimported->id;
313 313
         if (isset($recordimported->protected)) {
314
-            $recording['protected'] = (string) $recordimported->protected;
314
+            $recording['protected'] = (string)$recordimported->protected;
315 315
         }
316 316
         $recordsimportedarray[$recording['recordID']] = $recording;
317 317
     }
@@ -341,21 +341,21 @@  discard block
 block discarded – undo
341 341
     // Add formats.
342 342
     $playbackarray = array();
343 343
     foreach ($recording->playback->format as $format) {
344
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
345
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
344
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
345
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
346 346
         // Add preview per format when existing.
347 347
         if ($format->preview) {
348
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
348
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
349 349
         }
350 350
     }
351 351
     // Add the metadata to the recordings array.
352 352
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
353
-    $recordingarray = array('recordID' => (string) $recording->recordID,
354
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
355
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
356
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
353
+    $recordingarray = array('recordID' => (string)$recording->recordID,
354
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
355
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
356
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
357 357
     if (isset($recording->protected)) {
358
-        $recordingarray['protected'] = (string) $recording->protected;
358
+        $recordingarray['protected'] = (string)$recording->protected;
359 359
     }
360 360
     return $recordingarray + $metadataarray;
361 361
 }
@@ -370,9 +370,9 @@  discard block
 block discarded – undo
370 370
 function bigbluebuttonbn_get_recording_preview_images($preview) {
371 371
     $imagesarray = array();
372 372
     foreach ($preview->images->image as $image) {
373
-        $imagearray = array('url' => trim((string) $image));
373
+        $imagearray = array('url' => trim((string)$image));
374 374
         foreach ($image->attributes() as $attkey => $attvalue) {
375
-            $imagearray[$attkey] = (string) $attvalue;
375
+            $imagearray[$attkey] = (string)$attvalue;
376 376
         }
377 377
         array_push($imagesarray, $imagearray);
378 378
     }
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
         if (is_object($value)) {
393 393
             $value = '';
394 394
         }
395
-        $metadataarray['meta_'.$key] = $value;
395
+        $metadataarray['meta_' . $key] = $value;
396 396
     }
397 397
     return $metadataarray;
398 398
 }
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
     $ids = explode(',', $recordids);
465 465
     foreach ($ids as $id) {
466 466
         $xml = bigbluebuttonbn_wrap_xml_load_file(
467
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
467
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
468 468
           );
469 469
         if ($xml && $xml->returncode != 'SUCCESS') {
470 470
             return false;
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
             return $xml;
530 530
         } catch (Exception $e) {
531 531
             libxml_use_internal_errors($previous);
532
-            $error = 'Caught exception: '.$e->getMessage();
532
+            $error = 'Caught exception: ' . $e->getMessage();
533 533
             debugging($error, DEBUG_DEVELOPER);
534 534
             return null;
535 535
         }
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
541 541
         return $response;
542 542
     } catch (Exception $e) {
543
-        $error = 'Caught exception: '.$e->getMessage();
543
+        $error = 'Caught exception: ' . $e->getMessage();
544 544
         debugging($error, DEBUG_DEVELOPER);
545 545
         libxml_use_internal_errors($previous);
546 546
         return null;
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
         }
567 567
         $options = array();
568 568
         $options['CURLOPT_HTTPHEADER'] = array(
569
-                 'Content-Type: '.$contenttype,
570
-                 'Content-Length: '.strlen($data),
569
+                 'Content-Type: ' . $contenttype,
570
+                 'Content-Length: ' . strlen($data),
571 571
                  'Content-Language: en-US',
572 572
                );
573 573
 
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
  * @return void
589 589
  */
590 590
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
591
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
591
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
592 592
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
593 593
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
594 594
     }
@@ -608,9 +608,9 @@  discard block
 block discarded – undo
608 608
     if ($userroles) {
609 609
         $where = '';
610 610
         foreach ($userroles as $userrole) {
611
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid;
611
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid;
612 612
         }
613
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
613
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
614 614
     }
615 615
     return $userroles;
616 616
 }
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
  * @return array $users
634 634
  */
635 635
 function bigbluebuttonbn_get_users(context $context = null) {
636
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
636
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
637 637
     foreach ($users as $key => $value) {
638 638
         $users[$key] = fullname($value);
639 639
     }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
  * @return array $users
649 649
  */
650 650
 function bigbluebuttonbn_get_users_select(context $context = null) {
651
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
651
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
652 652
     foreach ($users as $key => $value) {
653 653
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
654 654
     }
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
  * @return array $roles
664 664
  */
665 665
 function bigbluebuttonbn_get_roles(context $context = null) {
666
-    $roles = (array) role_get_names($context);
666
+    $roles = (array)role_get_names($context);
667 667
     foreach ($roles as $key => $value) {
668 668
         $roles[$key] = $value->localname;
669 669
     }
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
  * @return array $users
679 679
  */
680 680
 function bigbluebuttonbn_get_roles_select(context $context = null) {
681
-    $roles = (array) role_get_names($context);
681
+    $roles = (array)role_get_names($context);
682 682
     foreach ($roles as $key => $value) {
683 683
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
684 684
     }
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
  * @return object $role
694 694
  */
695 695
 function bigbluebuttonbn_get_role($id) {
696
-    $roles = (array) role_get_names();
696
+    $roles = (array)role_get_names();
697 697
     if (is_numeric($id) && isset($roles[$id])) {
698 698
         return (object)$roles[$id];
699 699
     }
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
     if (!isguestuser()) {
849 849
         $userroles = bigbluebuttonbn_get_user_roles($context, $userid);
850 850
     }
851
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
851
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
852 852
 }
853 853
 
854 854
 /**
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 function bigbluebuttonbn_generate_nonce() {
1005 1005
     $mt = microtime();
1006 1006
     $rand = mt_rand();
1007
-    return md5($mt.$rand);
1007
+    return md5($mt . $rand);
1008 1008
 }
1009 1009
 
1010 1010
 /**
@@ -1030,21 +1030,21 @@  discard block
 block discarded – undo
1030 1030
  */
1031 1031
 function bigbluebuttonbn_events() {
1032 1032
     return array(
1033
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1034
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1035
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1036
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1037
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1038
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1039
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1040
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1041
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1042
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1043
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1044
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1045
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1046
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1047
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1033
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1034
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1035
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1036
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1037
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1038
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1039
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1040
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1041
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1042
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1043
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1044
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1045
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1046
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1047
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1048 1048
     );
1049 1049
 }
1050 1050
 
@@ -1055,21 +1055,21 @@  discard block
 block discarded – undo
1055 1055
  */
1056 1056
 function bigbluebuttonbn_events_action() {
1057 1057
     return array(
1058
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1059
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1060
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1061
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1062
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1063
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1064
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1065
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1066
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1067
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1068
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1069
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1070
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1071
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1072
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1058
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1059
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1060
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1061
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1062
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1063
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1064
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1065
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1066
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1067
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1068
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1069
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1070
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1071
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1072
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1073 1073
     );
1074 1074
 }
1075 1075
 
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
     if (array_key_exists('other', $options)) {
1101 1101
         $eventproperties['other'] = $options['other'];
1102 1102
     }
1103
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1103
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
1104 1104
       array($eventproperties));
1105 1105
     $event->trigger();
1106 1106
 }
@@ -1140,10 +1140,10 @@  discard block
 block discarded – undo
1140 1140
     $now = time();
1141 1141
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1142 1142
         // Use the value in the cache.
1143
-        return (array) json_decode($result['meeting_info']);
1143
+        return (array)json_decode($result['meeting_info']);
1144 1144
     }
1145 1145
     // Ping again and refresh the cache.
1146
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1146
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1147 1147
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1148 1148
       );
1149 1149
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
  * @return object
1255 1255
  */
1256 1256
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1257
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1257
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1258 1258
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1259 1259
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST',
1260 1260
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1270,8 +1270,8 @@  discard block
 block discarded – undo
1270 1270
  * @return string
1271 1271
  */
1272 1272
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1273
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1274
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1273
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1274
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1275 1275
     return $configxmlparams;
1276 1276
 }
1277 1277
 
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
  */
1286 1286
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1287 1287
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1288
-    $configxmlarray = (array) $configxml;
1288
+    $configxmlarray = (array)$configxml;
1289 1289
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1290 1290
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1291 1291
         return '';
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
     global $USER;
1378 1378
     $starttime = $starttime - ($starttime % 1000);
1379 1379
     // Set formatted date.
1380
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1380
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1381 1381
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1382 1382
 }
1383 1383
 
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
  * @return string
1494 1494
  */
1495 1495
 function bigbluebuttonbn_get_recording_data_row_preview($recording) {
1496
-    $options = array('id' => 'preview-'.$recording['recordID']);
1496
+    $options = array('id' => 'preview-' . $recording['recordID']);
1497 1497
     if ($recording['published'] === 'false') {
1498 1498
         $options['hidden'] = 'hidden';
1499 1499
     }
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
     if ($recording['published'] === 'false') {
1556 1556
         $visibility = 'hidden ';
1557 1557
     }
1558
-    $id = 'playbacks-'.$recording['recordID'];
1558
+    $id = 'playbacks-' . $recording['recordID'];
1559 1559
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1560 1560
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1561 1561
           'title' => $title, $visibility => $visibility));
@@ -1580,11 +1580,11 @@  discard block
 block discarded – undo
1580 1580
     if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) {
1581 1581
         return '';
1582 1582
     }
1583
-    $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1583
+    $text = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1584 1584
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1585
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1585
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1586 1586
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1587
-        $href .= '&href='.urlencode(trim($playback['url']));
1587
+        $href .= '&href=' . urlencode(trim($playback['url']));
1588 1588
     }
1589 1589
     $linkattributes = array(
1590 1590
         'id' => 'recording-play-' . $playback['type'] . '-' . $recording['recordID'],
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
             $linkattributes['class'] = 'disabled';
1754 1754
             unset($linkattributes['onclick']);
1755 1755
         }
1756
-        $icon = new pix_icon('i/'.$data['tag'],
1756
+        $icon = new pix_icon('i/' . $data['tag'],
1757 1757
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1758 1758
             'moodle', $iconattributes);
1759 1759
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
  */
1871 1871
 function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) {
1872 1872
     $row = new html_table_row();
1873
-    $row->id = 'recording-tr-'.$recording['recordID'];
1873
+    $row->id = 'recording-tr-' . $recording['recordID'];
1874 1874
     $row->attributes['data-imported'] = 'false';
1875 1875
     $texthead = '';
1876 1876
     $texttail = '';
@@ -1930,9 +1930,9 @@  discard block
 block discarded – undo
1930 1930
 function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) {
1931 1931
     $sender = get_admin();
1932 1932
     // Prepare message.
1933
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
1934
-        ' &quot;' . $bigbluebuttonbn->name . '&quot; '.
1935
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1933
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') .
1934
+        ' &quot;' . $bigbluebuttonbn->name . '&quot; ' .
1935
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1936 1936
     $context = context_course::instance($bigbluebuttonbn->course);
1937 1937
     \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext);
1938 1938
 }
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
     }
2155 2155
     // Prepare select for loading records based on existent bigbluebuttonbns.
2156 2156
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
2157
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
2157
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
2158 2158
     // Include only Create events and exclude those with record not true.
2159 2159
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
2160 2160
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -2286,8 +2286,8 @@  discard block
 block discarded – undo
2286 2286
 function bigbluebuttonbn_format_activity_time($time) {
2287 2287
     $activitytime = '';
2288 2288
     if ($time) {
2289
-        $activitytime = calendar_day_representation($time).' '.
2290
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2289
+        $activitytime = calendar_day_representation($time) . ' ' .
2290
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2291 2291
           calendar_time_representation($time);
2292 2292
     }
2293 2293
     return $activitytime;
@@ -2688,7 +2688,7 @@  discard block
 block discarded – undo
2688 2688
  *
2689 2689
  * @return string
2690 2690
  */
2691
-function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') {
2691
+function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') {
2692 2692
     global $OUTPUT;
2693 2693
     $output = "\n";
2694 2694
     // Evaluates if config_warning is enabled.
@@ -2727,11 +2727,11 @@  discard block
 block discarded – undo
2727 2727
     if ($class == '') {
2728 2728
         $class = 'btn btn-secondary';
2729 2729
     }
2730
-    $output  = '  <form method="post" action="' . $href . '" class="form-inline">'."\n";
2731
-    $output .= '      <button type="submit" class="' . $class . '"'."\n";
2732
-    $output .= '          title="' . $title . '"'."\n";
2733
-    $output .= '          >' . $text . '</button>'."\n";
2734
-    $output .= '  </form>'."\n";
2730
+    $output  = '  <form method="post" action="' . $href . '" class="form-inline">' . "\n";
2731
+    $output .= '      <button type="submit" class="' . $class . '"' . "\n";
2732
+    $output .= '          title="' . $title . '"' . "\n";
2733
+    $output .= '          >' . $text . '</button>' . "\n";
2734
+    $output .= '  </form>' . "\n";
2735 2735
     return $output;
2736 2736
 }
2737 2737
 
Please login to merge, or discard this patch.
Doc Comments   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
  * Helper function to retrieve imported recordings from the Moodle database.
263 263
  * The references are stored as events in bigbluebuttonbn_logs.
264 264
  *
265
- * @param string $courseid
265
+ * @param integer $courseid
266 266
  * @param string $bigbluebuttonbnid
267 267
  * @param bool   $subset
268 268
  *
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 /**
291 291
  * Helper function to retrive the default config.xml file.
292 292
  *
293
- * @return string
293
+ * @return null|SimpleXMLElement
294 294
  */
295 295
 function bigbluebuttonbn_get_default_config_xml() {
296 296
     $xml = bigbluebuttonbn_wrap_xml_load_file(
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
  * @param object $a
373 373
  * @param object $b
374 374
  *
375
- * @return array
375
+ * @return integer
376 376
  */
377 377
 function bigbluebuttonbn_recording_build_sorter($a, $b) {
378 378
     if ($a['startTime'] < $b['startTime']) {
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
  * @param string $data
484 484
  * @param string $contenttype
485 485
  *
486
- * @return object
486
+ * @return null|SimpleXMLElement
487 487
  */
488 488
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
489 489
     if (extension_loaded('curl')) {
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
  * @param string $data
525 525
  * @param string $contenttype
526 526
  *
527
- * @return object
527
+ * @return string
528 528
  */
529 529
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
530 530
     $c = new curl();
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
  * Evaluate if a user in a context is moderator based on roles and participation rules.
801 801
  *
802 802
  * @param context $context
803
- * @param array $participants
803
+ * @param array $participantlist
804 804
  * @param integer $userid
805 805
  *
806 806
  * @return boolean
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
  * @param integer $instance
893 893
  * @param integer $voicebridge
894 894
  *
895
- * @return string
895
+ * @return boolean
896 896
  */
897 897
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
898 898
     global $DB;
@@ -995,7 +995,7 @@  discard block
 block discarded – undo
995 995
 /**
996 996
  * Helper returns an array with all possible bigbluebuttonbn events.
997 997
  *
998
- * @return array
998
+ * @return string[]
999 999
  */
1000 1000
 function bigbluebuttonbn_events() {
1001 1001
     return array(
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
  * @param string $meetingid
1221 1221
  * @param string $configxml
1222 1222
  *
1223
- * @return object
1223
+ * @return null|SimpleXMLElement
1224 1224
  */
1225 1225
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1226 1226
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
  * @param array $recording
1270 1270
  * @param array $tools
1271 1271
  *
1272
- * @return array
1272
+ * @return null|stdClass
1273 1273
  */
1274 1274
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1275 1275
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
  *
1834 1834
  * @param array $bbbsession
1835 1835
  * @param array $recording
1836
- * @param object $rowdata
1836
+ * @param stdClass $rowdata
1837 1837
  *
1838 1838
  * @return object
1839 1839
  */
@@ -2028,7 +2028,7 @@  discard block
 block discarded – undo
2028 2028
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2029 2029
  * in the getRecordings request considering only those that belong to deleted activities.
2030 2030
  *
2031
- * @param string $courseid
2031
+ * @param integer $courseid
2032 2032
  * @param string $bigbluebuttonbnid
2033 2033
  * @param bool   $subset
2034 2034
  *
@@ -2052,7 +2052,7 @@  discard block
 block discarded – undo
2052 2052
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2053 2053
  * in the getRecordings request considering only those that belong to imported recordings.
2054 2054
  *
2055
- * @param string $courseid
2055
+ * @param integer $courseid
2056 2056
  * @param string $bigbluebuttonbnid
2057 2057
  * @param bool   $subset
2058 2058
  *
@@ -2075,7 +2075,7 @@  discard block
 block discarded – undo
2075 2075
 /**
2076 2076
  * Helper function to get recordings  and imported recordings together.
2077 2077
  *
2078
- * @param string $courseid
2078
+ * @param integer $courseid
2079 2079
  * @param string $bigbluebuttonbnid
2080 2080
  * @param bool   $subset
2081 2081
  * @param bool   $includedeleted
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2094 2094
  * in bigbluebuttonbn_logs.
2095 2095
  *
2096
- * @param string $courseid
2096
+ * @param integer $courseid
2097 2097
  * @param string $bigbluebuttonbnid
2098 2098
  * @param bool   $subset
2099 2099
  * @param bool   $includedeleted
Please login to merge, or discard this patch.