Completed
Push — master ( 770f64...44031d )
by Jesus
02:14
created
mod_form.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 'alt' => $contents,
94 94
                 'title' => $contents,
95 95
                 'src' => $jsvars['pix_icon_delete']
96
-              );
96
+                );
97 97
             $jsvars['pix_icon_delete'] = html_writer::tag('img', '', $options);
98 98
         }
99 99
         $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-modform',
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
181 181
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6],
182 182
                 ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'),
183
-                 'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
184
-              );
183
+                    'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
184
+                );
185 185
         } else {
186 186
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
187 187
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
     private function bigbluebuttonbn_mform_add_block_room_recordings($mform, $cfg) {
214 214
         $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT,
215
-                  'description_key' => null];
215
+                    'description_key' => null];
216 216
         if ($cfg['recordings_html_editable']) {
217 217
             $field['type'] = 'checkbox';
218 218
             $field['description_key'] = 'mod_form_field_recordings_html';
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $field['description_key'], $cfg['recordings_html_default']);
222 222
 
223 223
         $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT,
224
-                  'description_key' => null];
224
+                    'description_key' => null];
225 225
         if ($cfg['recordings_deleted_editable']) {
226 226
             $field['type'] = 'checkbox';
227 227
             $field['description_key'] = 'mod_form_field_recordings_deleted';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             $field['description_key'], $cfg['recordings_deleted_default']);
231 231
 
232 232
         $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT,
233
-                  'description_key' => null];
233
+                    'description_key' => null];
234 234
         if ($cfg['recordings_imported_editable']) {
235 235
             $field['type'] = 'checkbox';
236 236
             $field['description_key'] = 'mod_form_field_recordings_imported';
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
         $htmlselectiontype = html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type',
279 279
             $participantselection['type_selected'], array(),
280 280
             array('id' => 'bigbluebuttonbn_participant_selection_type',
281
-                  'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;'));
281
+                    'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;'));
282 282
         $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
283 283
             $participantselection['selected'], array(),
284 284
             array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled'));
285 285
         $htmlselectioninput = html_writer::tag('input', '', array('id' => 'id_addselectionid', 'type' => 'button', 'class' => 'btn btn-secondary',
286 286
             'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'),
287 287
             'onclick' => 'M.mod_bigbluebuttonbn.modform.participant_add(); return 0;'
288
-          ));
288
+            ));
289 289
         $htmladdparticipant = html_writer::tag('div', $htmlselectiontype . '  ' . $htmlselectionoptions . '  ' . $htmlselectioninput, null);
290 290
         $mform->addElement('html', "\n\n");
291 291
         $mform->addElement('static', 'static_add_participant', get_string('mod_form_field_participant_add', 'bigbluebuttonbn'), $htmladdparticipant);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
 defined('MOODLE_INTERNAL') || die();
28 28
 
29
-require_once(dirname(__FILE__).'/locallib.php');
30
-require_once($CFG->dirroot.'/course/moodleform_mod.php');
29
+require_once(dirname(__FILE__) . '/locallib.php');
30
+require_once($CFG->dirroot . '/course/moodleform_mod.php');
31 31
 
32 32
 class mod_bigbluebuttonbn_mod_form extends moodleform_mod {
33 33
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $serverversion = bigbluebuttonbn_get_server_version();
38 38
         if (is_null($serverversion)) {
39 39
             print_error('general_error_unable_connect', 'bigbluebuttonbn',
40
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
40
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
41 41
             return;
42 42
         }
43 43
         // Context.
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 );
111 111
                 $defaultvalues['presentation'] = $draftitemid;
112 112
             } catch (Exception $e) {
113
-                debugging('Presentation could not be loaded: '.$e->getMessage(), DEBUG_DEVELOPER);
113
+                debugging('Presentation could not be loaded: ' . $e->getMessage(), DEBUG_DEVELOPER);
114 114
                 return null;
115 115
             }
116 116
         }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
             return;
326 326
         }
327 327
         $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options);
328
-        if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) {
328
+        if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) {
329 329
             $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn');
330 330
         }
331 331
         if (!empty($rule)) {
Please login to merge, or discard this patch.
locallib.php 2 patches
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
  */
95 95
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
96 96
     $data = ['meetingID' => $meetingid,
97
-              'fullName' => $username,
98
-              'password' => $pw,
99
-              'logoutURL' => $logouturl,
97
+                'fullName' => $username,
98
+                'password' => $pw,
99
+                'logoutURL' => $logouturl,
100 100
             ];
101 101
     if (!is_null($configtoken)) {
102 102
         $data['configToken'] = $configtoken;
@@ -177,23 +177,23 @@  discard block
 block discarded – undo
177 177
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
178 178
     $xml = bigbluebuttonbn_wrap_xml_load_file(
179 179
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
180
-      );
180
+        );
181 181
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
182 182
         // Meeting info was returned.
183 183
         return array('returncode' => $xml->returncode,
184
-                     'meetingID' => $xml->meetingID,
185
-                     'moderatorPW' => $xml->moderatorPW,
186
-                     'attendeePW' => $xml->attendeePW,
187
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
188
-                     'running' => $xml->running,
189
-                     'recording' => $xml->recording,
190
-                     'startTime' => $xml->startTime,
191
-                     'endTime' => $xml->endTime,
192
-                     'participantCount' => $xml->participantCount,
193
-                     'moderatorCount' => $xml->moderatorCount,
194
-                     'attendees' => $xml->attendees,
195
-                     'metadata' => $xml->metadata,
196
-                   );
184
+                        'meetingID' => $xml->meetingID,
185
+                        'moderatorPW' => $xml->moderatorPW,
186
+                        'attendeePW' => $xml->attendeePW,
187
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
188
+                        'running' => $xml->running,
189
+                        'recording' => $xml->recording,
190
+                        'startTime' => $xml->startTime,
191
+                        'endTime' => $xml->endTime,
192
+                        'participantCount' => $xml->participantCount,
193
+                        'moderatorCount' => $xml->moderatorCount,
194
+                        'attendees' => $xml->attendees,
195
+                        'metadata' => $xml->metadata,
196
+                    );
197 197
     }
198 198
     if ($xml) {
199 199
         // Either failure or success without meeting info.
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 function bigbluebuttonbn_get_default_config_xml() {
316 316
     $xml = bigbluebuttonbn_wrap_xml_load_file(
317 317
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
318
-      );
318
+        );
319 319
     return $xml;
320 320
 }
321 321
 
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
     foreach ($ids as $id) {
385 385
         $xml = bigbluebuttonbn_wrap_xml_load_file(
386 386
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
387
-          );
387
+            );
388 388
         if ($xml && $xml->returncode != 'SUCCESS') {
389 389
             return false;
390 390
         }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
     foreach ($ids as $id) {
402 402
         $xml = bigbluebuttonbn_wrap_xml_load_file(
403 403
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
404
-          );
404
+            );
405 405
         if ($xml && $xml->returncode != 'SUCCESS') {
406 406
             return false;
407 407
         }
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
     foreach ($ids as $id) {
419 419
         $xml = bigbluebuttonbn_wrap_xml_load_file(
420 420
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
421
-          );
421
+            );
422 422
         if ($xml && $xml->returncode != 'SUCCESS') {
423 423
             return false;
424 424
         }
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
434 434
     $xml = bigbluebuttonbn_wrap_xml_load_file(
435 435
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
436
-      );
436
+        );
437 437
     if ($xml) {
438 438
         // If the xml packet returned failure it displays the message to the user.
439 439
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 function bigbluebuttonbn_is_meeting_running($meetingid) {
449 449
     $xml = bigbluebuttonbn_wrap_xml_load_file(
450 450
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('isMeetingRunning', ['meetingID' => $meetingid])
451
-      );
451
+        );
452 452
     if ($xml && $xml->returncode == 'SUCCESS') {
453 453
         return ($xml->running == 'true');
454 454
     }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 function bigbluebuttonbn_get_server_version() {
459 459
     $xml = bigbluebuttonbn_wrap_xml_load_file(
460 460
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
461
-      );
461
+        );
462 462
     if ($xml && $xml->returncode == 'SUCCESS') {
463 463
         return $xml->version;
464 464
     }
@@ -513,10 +513,10 @@  discard block
 block discarded – undo
513 513
 
514 514
         $options = array();
515 515
         $options['CURLOPT_HTTPHEADER'] = array(
516
-                 'Content-Type: '.$contenttype,
517
-                 'Content-Length: '.strlen($data),
518
-                 'Content-Language: en-US',
519
-               );
516
+                    'Content-Type: '.$contenttype,
517
+                    'Content-Length: '.strlen($data),
518
+                    'Content-Language: en-US',
519
+                );
520 520
 
521 521
         return $c->post($url, $data, $options);
522 522
     }
@@ -595,13 +595,13 @@  discard block
 block discarded – undo
595 595
 
596 596
 function bigbluebuttonbn_role_unknown() {
597 597
     return array(
598
-              "id" => "0",
599
-              "name" => "",
600
-              "shortname" => "unknown",
601
-              "description" => "",
602
-              "sortorder" => "0",
603
-              "archetype" => "guest",
604
-              "localname" => "Unknown"
598
+                "id" => "0",
599
+                "name" => "",
600
+                "shortname" => "unknown",
601
+                "description" => "",
602
+                "sortorder" => "0",
603
+                "archetype" => "guest",
604
+                "localname" => "Unknown"
605 605
             );
606 606
 }
607 607
 
@@ -610,16 +610,16 @@  discard block
 block discarded – undo
610 610
         'all' => array(
611 611
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
612 612
             'children' => []
613
-          )
614
-      );
613
+            )
614
+        );
615 615
     $data['role'] = array(
616 616
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
617 617
         'children' => bigbluebuttonbn_get_roles_select($context)
618
-      );
618
+        );
619 619
     $data['user'] = array(
620 620
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
621 621
         'children' => bigbluebuttonbn_get_users_select($context)
622
-      );
622
+        );
623 623
     return $data;
624 624
 }
625 625
 
@@ -649,9 +649,9 @@  discard block
 block discarded – undo
649 649
             continue;
650 650
         }
651 651
         $participantlistarray[] = array(
652
-              'selectiontype' => 'role',
653
-              'selectionid' => $moderatordefault,
654
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
652
+                'selectiontype' => 'role',
653
+                'selectionid' => $moderatordefault,
654
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
655 655
     }
656 656
     return $participantlistarray;
657 657
 }
@@ -682,11 +682,11 @@  discard block
 block discarded – undo
682 682
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
683 683
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
684 684
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
685
-          ],
685
+            ],
686 686
         'type_selected' => 'all',
687 687
         'options' => ['all' => '---------------'],
688 688
         'selected' => 'all',
689
-      ];
689
+        ];
690 690
 }
691 691
 
692 692
 function bigbluebuttonbn_is_moderator($context, $participants, $userid = null, $userroles = null) {
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
         $eventproperties['other'] = $options['other'];
877 877
     }
878 878
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
879
-      array($eventproperties));
879
+        array($eventproperties));
880 880
     $event->trigger();
881 881
 }
882 882
 
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
     // Ping again and refresh the cache.
922 922
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
923 923
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
924
-      );
924
+        );
925 925
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
926 926
     return $meetinginfo;
927 927
 }
@@ -1157,8 +1157,8 @@  discard block
 block discarded – undo
1157 1157
     }
1158 1158
     $id = 'playbacks-'.$recording['recordID'];
1159 1159
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1160
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1161
-          'title' => $title, $visibility => $visibility));
1160
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1161
+            'title' => $title, $visibility => $visibility));
1162 1162
     foreach ($recording['playbacks'] as $playback) {
1163 1163
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid,
1164 1164
             $playback).' ';
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
     $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1173 1173
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1174 1174
     $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid.
1175
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1175
+        '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1176 1176
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1177 1177
         $href .= '&href='.urlencode(trim($playback['url']));
1178 1178
     }
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
         'data-target' => $playback['type'],
1185 1185
         'data-href' => $href,
1186 1186
         'class' => 'btn btn-sm btn-default'
1187
-      );
1187
+        );
1188 1188
     return $OUTPUT->action_link('#', $title, null, $linkattributes);
1189 1189
 }
1190 1190
 
@@ -1268,7 +1268,7 @@  discard block
 block discarded – undo
1268 1268
             'onclick' => $onclick,
1269 1269
             'data-action' => $data['action'],
1270 1270
             'data-links' => bigbluebuttonbn_get_count_recording_imported_instances($recording['recordID'])
1271
-          );
1271
+            );
1272 1272
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
1273 1273
     }
1274 1274
     // With text for $manageaction.
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
         $texthead . $rowdata->activity . $texttail, $texthead . $rowdata->description . $texttail,
1374 1374
         $rowdata->preview, $texthead . $rowdata->date_formatted . $texttail,
1375 1375
         $rowdata->duration_formatted
1376
-      );
1376
+        );
1377 1377
     if ($bbbsession['managerecordings']) {
1378 1378
         $row->cells[] = $rowdata->actionbar;
1379 1379
     }
@@ -1615,8 +1615,8 @@  discard block
 block discarded – undo
1615 1615
     $activitytime = '';
1616 1616
     if ($time) {
1617 1617
         $activitytime = calendar_day_representation($time).' '.
1618
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1619
-          calendar_time_representation($time);
1618
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1619
+            calendar_time_representation($time);
1620 1620
     }
1621 1621
     return $activitytime;
1622 1622
 }
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
         $owner = array('0' => get_string('mod_form_field_participant_list_type_owner', 'bigbluebuttonbn'));
1751 1751
         $renderer->render_group_element('participant_moderator_default',
1752 1752
             $renderer->render_group_element_configmultiselect('participant_moderator_default', array_keys($owner), array_merge($owner, $roles))
1753
-          );
1753
+            );
1754 1754
     }
1755 1755
     // Configuration for "send notifications" feature.
1756 1756
     if ((boolean)\mod_bigbluebuttonbn\settings\renderer::section_send_notifications_shown()) {
Please login to merge, or discard this patch.
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 global $CFG;
29 29
 
30
-require_once(dirname(__FILE__).'/lib.php');
30
+require_once(dirname(__FILE__) . '/lib.php');
31 31
 
32 32
 const BIGBLUEBUTTONBN_FORCED = true;
33 33
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     if (isset($meta)) {
80 80
         $log->meta = $meta;
81 81
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
82
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
82
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
83 83
     }
84 84
     $DB->insert_record('bigbluebuttonbn_logs', $log);
85 85
 }
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
     $data = null;
120 120
     if (!is_null($pname) && !is_null($purl)) {
121 121
         $method = BIGBLUEBUTTONBN_METHOD_POST;
122
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
123
-            $purl."' /></module></modules>";
122
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
123
+            $purl . "' /></module></modules>";
124 124
     }
125 125
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
126 126
     if ($xml) {
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         // Override imported flag with actual ID.
269 269
         $recording['imported'] = $recordimported->id;
270 270
         if (isset($recordimported->protected)) {
271
-            $recording['protected'] = (string) $recordimported->protected;
271
+            $recording['protected'] = (string)$recordimported->protected;
272 272
         }
273 273
         $recordsimportedarray[$recording['recordID']] = $recording;
274 274
     }
@@ -284,36 +284,36 @@  discard block
 block discarded – undo
284 284
 
285 285
 function bigbluebuttonbn_get_default_config_xml_array() {
286 286
     $defaultconfigxml = bigbluebuttonbn_getDefaultConfigXML();
287
-    return (array) $defaultconfigxml;
287
+    return (array)$defaultconfigxml;
288 288
 }
289 289
 
290 290
 function bigbluebuttonbn_get_recording_array_value($recording) {
291 291
     // Add formats.
292 292
     $playbackarray = array();
293 293
     foreach ($recording->playback->format as $format) {
294
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
295
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
294
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
295
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
296 296
         // Add preview per format when existing.
297 297
         if ($format->preview) {
298 298
             $imagesarray = array();
299 299
             foreach ($format->preview->images->image as $image) {
300
-                $imagearray = array('url' => trim((string) $image));
300
+                $imagearray = array('url' => trim((string)$image));
301 301
                 foreach ($image->attributes() as $attkey => $attvalue) {
302
-                    $imagearray[$attkey] = (string) $attvalue;
302
+                    $imagearray[$attkey] = (string)$attvalue;
303 303
                 }
304 304
                 array_push($imagesarray, $imagearray);
305 305
             }
306
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
306
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
307 307
         }
308 308
     }
309 309
     // Add the metadata to the recordings array.
310 310
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
311
-    $recordingarray = array('recordID' => (string) $recording->recordID,
312
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
313
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
314
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
311
+    $recordingarray = array('recordID' => (string)$recording->recordID,
312
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
313
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
314
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
315 315
     if (isset($recording->protected)) {
316
-        $recordingarray['protected'] = (string) $recording->protected;
316
+        $recordingarray['protected'] = (string)$recording->protected;
317 317
     }
318 318
     return $recordingarray + $metadataarray;
319 319
 }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         if (is_object($value)) {
325 325
             $value = '';
326 326
         }
327
-        $metadataarray['meta_'.$key] = $value;
327
+        $metadataarray['meta_' . $key] = $value;
328 328
     }
329 329
     return $metadataarray;
330 330
 }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
     $ids = explode(',', $recordids);
381 381
     foreach ($ids as $id) {
382 382
         $xml = bigbluebuttonbn_wrap_xml_load_file(
383
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
383
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
384 384
           );
385 385
         if ($xml && $xml->returncode != 'SUCCESS') {
386 386
             return false;
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
             return $xml;
448 448
         } catch (Exception $e) {
449 449
             libxml_use_internal_errors($previous);
450
-            $error = 'Caught exception: '.$e->getMessage();
450
+            $error = 'Caught exception: ' . $e->getMessage();
451 451
             debugging($error, DEBUG_DEVELOPER);
452 452
             return null;
453 453
         }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
459 459
         return $response;
460 460
     } catch (Exception $e) {
461
-        $error = 'Caught exception: '.$e->getMessage();
461
+        $error = 'Caught exception: ' . $e->getMessage();
462 462
         debugging($error, DEBUG_DEVELOPER);
463 463
         libxml_use_internal_errors($previous);
464 464
         return null;
@@ -476,8 +476,8 @@  discard block
 block discarded – undo
476 476
 
477 477
         $options = array();
478 478
         $options['CURLOPT_HTTPHEADER'] = array(
479
-                 'Content-Type: '.$contenttype,
480
-                 'Content-Length: '.strlen($data),
479
+                 'Content-Type: ' . $contenttype,
480
+                 'Content-Length: ' . strlen($data),
481 481
                  'Content-Language: en-US',
482 482
                );
483 483
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 
489 489
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
490 490
     // End the session associated with this instance (if it's running).
491
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
491
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
492 492
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
493 493
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
494 494
     }
@@ -500,9 +500,9 @@  discard block
 block discarded – undo
500 500
     if ($userroles) {
501 501
         $where = '';
502 502
         foreach ($userroles as $value) {
503
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id='.$value->roleid;
503
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $value->roleid;
504 504
         }
505
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
505
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
506 506
     }
507 507
     return $userroles;
508 508
 }
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 }
514 514
 
515 515
 function bigbluebuttonbn_get_users(context $context = null) {
516
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
516
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
517 517
     foreach ($users as $key => $value) {
518 518
         $users[$key] = fullname($value);
519 519
     }
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 }
522 522
 
523 523
 function bigbluebuttonbn_get_users_select(context $context = null) {
524
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
524
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
525 525
     foreach ($users as $key => $value) {
526 526
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
527 527
     }
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 }
530 530
 
531 531
 function bigbluebuttonbn_get_roles(context $context = null) {
532
-    $roles = (array) role_get_names($context);
532
+    $roles = (array)role_get_names($context);
533 533
     foreach ($roles as $key => $value) {
534 534
         $roles[$key] = $value->localname;
535 535
     }
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 }
538 538
 
539 539
 function bigbluebuttonbn_get_roles_select(context $context = null) {
540
-    $roles = (array) role_get_names($context);
540
+    $roles = (array)role_get_names($context);
541 541
     foreach ($roles as $key => $value) {
542 542
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
543 543
     }
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 }
546 546
 
547 547
 function bigbluebuttonbn_get_role($id) {
548
-    $roles = (array) role_get_names();
548
+    $roles = (array)role_get_names();
549 549
     if (is_numeric($id)) {
550 550
         return (object)$roles[$id];
551 551
     }
@@ -625,11 +625,11 @@  discard block
 block discarded – undo
625 625
         return array();
626 626
     }
627 627
     foreach ($rules as $key => $rule) {
628
-        if ( $rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid']) ) {
628
+        if ($rule['selectiontype'] !== 'role' || is_numeric($rule['selectionid'])) {
629 629
             continue;
630 630
         }
631 631
         $role = bigbluebuttonbn_get_role($rule['selectionid']);
632
-        if ( $role == null ) {
632
+        if ($role == null) {
633 633
             unset($rules[$key]);
634 634
             continue;
635 635
         }
@@ -668,10 +668,10 @@  discard block
 block discarded – undo
668 668
     if (empty($userroles)) {
669 669
         $userroles = get_user_roles($context, $userid, true);
670 670
     }
671
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
671
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
672 672
 }
673 673
 
674
-function bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles) {
674
+function bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles) {
675 675
     // Iterate participant rules.
676 676
     foreach ($participantlist as $participant) {
677 677
         if (bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $userroles)) {
@@ -716,9 +716,9 @@  discard block
 block discarded – undo
716 716
     $isunique = true;
717 717
     if ($voicebridge != 0) {
718 718
         $table = 'bigbluebuttonbn';
719
-        $select = 'voicebridge = '.$voicebridge;
719
+        $select = 'voicebridge = ' . $voicebridge;
720 720
         if ($id) {
721
-            $select .= ' AND id <> '.$id;
721
+            $select .= ' AND id <> ' . $id;
722 722
         }
723 723
         if ($DB->get_records_select($table, $select)) {
724 724
             $isunique = false;
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 function bigbluebuttonbn_generate_nonce() {
773 773
     $mt = microtime();
774 774
     $rand = mt_rand();
775
-    return md5($mt.$rand);
775
+    return md5($mt . $rand);
776 776
 }
777 777
 
778 778
 function bigbluebuttonbn_random_password($length = 8) {
@@ -783,41 +783,41 @@  discard block
 block discarded – undo
783 783
 
784 784
 function bigbluebuttonbn_events() {
785 785
     return array(
786
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
787
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
788
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
789
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
790
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
791
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
792
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
793
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
794
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
795
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
796
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
797
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
798
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
799
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
800
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
786
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
787
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
788
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
789
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
790
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
791
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
792
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
793
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
794
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
795
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
796
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
797
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
798
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
799
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
800
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
801 801
     );
802 802
 }
803 803
 
804 804
 function bigbluebuttonbn_events_action() {
805 805
     return array(
806
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
807
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
808
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
809
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
810
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
811
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
812
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
813
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
814
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
815
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
816
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
817
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
818
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
819
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
820
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
806
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
807
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
808
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
809
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
810
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
811
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
812
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
813
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
814
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
815
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
816
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
817
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
818
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
819
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
820
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
821 821
     );
822 822
 }
823 823
 
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
     if (array_key_exists('other', $options)) {
839 839
         $eventproperties['other'] = $options['other'];
840 840
     }
841
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
841
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
842 842
       array($eventproperties));
843 843
     $event->trigger();
844 844
 }
@@ -879,10 +879,10 @@  discard block
 block discarded – undo
879 879
     $now = time();
880 880
     if (!$forced && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
881 881
         // Use the value in the cache.
882
-        return (array) json_decode($result['meeting_info']);
882
+        return (array)json_decode($result['meeting_info']);
883 883
     }
884 884
     // Ping again and refresh the cache.
885
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
885
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
886 886
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
887 887
       );
888 888
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -957,8 +957,8 @@  discard block
 block discarded – undo
957 957
  * @param string $configxml
958 958
  */
959 959
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
960
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
961
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
960
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
961
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
962 962
     return $configxmlparams;
963 963
 }
964 964
 
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
  * @param string $configxml
968 968
  */
969 969
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
970
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
970
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
971 971
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
972 972
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, BIGBLUEBUTTONBN_METHOD_POST,
973 973
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
  */
981 981
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
982 982
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
983
-    $configxmlarray = (array) $configxml;
983
+    $configxmlarray = (array)$configxml;
984 984
     if ($configxmlarray['returncode'] != 'SUCCESS') {
985 985
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
986 986
         return '';
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
     global $USER;
1031 1031
     $starttime = $starttime - ($starttime % 1000);
1032 1032
     // Set formatted date.
1033
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1033
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1034 1034
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1035 1035
 }
1036 1036
 
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 function bigbluebuttonbn_get_recording_data_row_actionbar($recording, $tools) {
1047 1047
     $actionbar = '';
1048 1048
     foreach ($tools as $tool) {
1049
-        if ( $tool == 'protect' && !isset($recording['protected']) ) {
1049
+        if ($tool == 'protect' && !isset($recording['protected'])) {
1050 1050
             continue;
1051 1051
         }
1052 1052
         $buttonpayload = bigbluebuttonbn_get_recording_data_row_actionbar_payload($recording, $tool);
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
         $visibility = 'hidden ';
1091 1091
     }
1092 1092
     $recordingpreview = html_writer::start_tag('div',
1093
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1093
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1094 1094
     foreach ($recording['playbacks'] as $playback) {
1095 1095
         if (isset($playback['preview'])) {
1096 1096
             foreach ($playback['preview'] as $image) {
@@ -1118,13 +1118,13 @@  discard block
 block discarded – undo
1118 1118
     if ($recording['published'] === 'false') {
1119 1119
         $visibility = 'hidden ';
1120 1120
     }
1121
-    $id = 'playbacks-'.$recording['recordID'];
1121
+    $id = 'playbacks-' . $recording['recordID'];
1122 1122
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1123 1123
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1124 1124
           'title' => $title, $visibility => $visibility));
1125 1125
     foreach ($recording['playbacks'] as $playback) {
1126 1126
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid,
1127
-            $playback).'&#32;';
1127
+            $playback) . '&#32;';
1128 1128
     }
1129 1129
     $recordingtypes .= html_writer::end_tag('div');
1130 1130
     return $recordingtypes;
@@ -1132,12 +1132,12 @@  discard block
 block discarded – undo
1132 1132
 
1133 1133
 function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) {
1134 1134
     global $CFG, $OUTPUT;
1135
-    $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1135
+    $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1136 1136
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_play(this);';
1137
-    $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid.
1138
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1137
+    $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid .
1138
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1139 1139
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1140
-        $href .= '&href='.urlencode(trim($playback['url']));
1140
+        $href .= '&href=' . urlencode(trim($playback['url']));
1141 1141
     }
1142 1142
     $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID'];
1143 1143
     $linkattributes = array(
@@ -1219,11 +1219,11 @@  discard block
 block discarded – undo
1219 1219
         $target .= '-' . $data['target'];
1220 1220
     }
1221 1221
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1222
-    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_'.$data['action'].'(this);';
1222
+    $onclick = 'M.mod_bigbluebuttonbn.recordings.recording_' . $data['action'] . '(this);';
1223 1223
     if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1224 1224
         // With icon for $manageaction.
1225 1225
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1226
-        $icon = new pix_icon('i/'.$data['tag'],
1226
+        $icon = new pix_icon('i/' . $data['tag'],
1227 1227
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1228 1228
             'moodle', $iconattributes);
1229 1229
         $linkattributes = array(
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
     if (isset($recordings) && !array_key_exists('messageKey', $recordings)) {
1306 1306
         // There are recordings for this meeting.
1307 1307
         foreach ($recordings as $recording) {
1308
-            if ( !bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) ) {
1308
+            if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
1309 1309
                 continue;
1310 1310
             }
1311 1311
             bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $tools, $table);
@@ -1320,7 +1320,7 @@  discard block
 block discarded – undo
1320 1320
         return;
1321 1321
     }
1322 1322
     $row = new html_table_row();
1323
-    $row->id = 'recording-td-'.$recording['recordID'];
1323
+    $row->id = 'recording-td-' . $recording['recordID'];
1324 1324
     $row->attributes['data-imported'] = 'false';
1325 1325
     $texthead = '';
1326 1326
     $texttail = '';
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 }
1345 1345
 
1346 1346
 function bigbluebuttonbn_include_recording_table_row($bbbsession, $recording) {
1347
-    if ( isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid'] ) {
1347
+    if (isset($recording['imported']) || !isset($bbbsession['group']) || $recording['meetingID'] == $bbbsession['meetingid']) {
1348 1348
         return true;
1349 1349
     }
1350 1350
     return false;
@@ -1357,9 +1357,9 @@  discard block
 block discarded – undo
1357 1357
     // Build the message_body.
1358 1358
     $msg->activity_type = '';
1359 1359
     $msg->activity_title = $bigbluebuttonbn->name;
1360
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.
1361
-        $msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.
1362
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1360
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' .
1361
+        $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' .
1362
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1363 1363
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $messagetext);
1364 1364
 }
1365 1365
 
@@ -1449,15 +1449,15 @@  discard block
 block discarded – undo
1449 1449
 
1450 1450
 function bigbluebuttonbn_get_recordings_sql_selectdeleted($courseid, $bigbluebuttonbnid = null, $subset = true) {
1451 1451
     if ($bigbluebuttonbnid === null) {
1452
-        return "courseid = '{$courseid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1452
+        return "courseid = '{$courseid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1453 1453
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1454 1454
     }
1455 1455
     if ($subset) {
1456
-        return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE.
1456
+        return "bigbluebuttonbnid = '{$bigbluebuttonbnid}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE .
1457 1457
             "' AND meta like '%has_recordings%' AND meta like '%true%'";
1458 1458
     }
1459
-    return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '".
1460
-        BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1459
+    return "courseid = '{$courseid}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnid}' AND log = '" .
1460
+        BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1461 1461
 }
1462 1462
 
1463 1463
 function bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid = null, $subset = true,
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
     }
1503 1503
     // Prepare select for loading records based on existent bigbluebuttonbns.
1504 1504
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
1505
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
1505
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
1506 1506
     // Include only Create events and exclude those with record not true.
1507 1507
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
1508 1508
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -1577,8 +1577,8 @@  discard block
 block discarded – undo
1577 1577
 function bigbluebuttonbn_format_activity_time($time) {
1578 1578
     $activitytime = '';
1579 1579
     if ($time) {
1580
-        $activitytime = calendar_day_representation($time).' '.
1581
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
1580
+        $activitytime = calendar_day_representation($time) . ' ' .
1581
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
1582 1582
           calendar_time_representation($time);
1583 1583
     }
1584 1584
     return $activitytime;
@@ -1685,7 +1685,7 @@  discard block
 block discarded – undo
1685 1685
         // This feature only works if curl is installed.
1686 1686
         $preuploaddescripion = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn');
1687 1687
         if (!extension_loaded('curl')) {
1688
-            $preuploaddescripion .= '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>';
1688
+            $preuploaddescripion .= '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>';
1689 1689
         }
1690 1690
         $renderer->render_group_header('preuploadpresentation', null, $preuploaddescripion);
1691 1691
         if (extension_loaded('curl')) {
Please login to merge, or discard this patch.
index.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -188,6 +188,9 @@
 block discarded – undo
188 188
     return $users;
189 189
 }
190 190
 
191
+/**
192
+ * @param string $role
193
+ */
191 194
 function bigbluebuttonbn_index_display_room_users_attendee_list($meetinginfo, $role) {
192 195
     $attendeelist = '';
193 196
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
24 24
  */
25 25
 
26
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
27
-require_once(dirname(__FILE__).'/locallib.php');
26
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
27
+require_once(dirname(__FILE__) . '/locallib.php');
28 28
 
29 29
 $id = required_param('id', PARAM_INT);
30 30
 $a = optional_param('a', 0, PARAM_INT);
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 
93 93
         echo get_string('index_ending', 'bigbluebuttonbn');
94 94
 
95
-        $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
95
+        $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
96 96
         if ($g != '0') {
97
-            $meetingid .= '['.$g.']';
97
+            $meetingid .= '[' . $g . ']';
98 98
         }
99 99
         bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingid));
100
-        redirect('index.php?id='.$id);
100
+        redirect('index.php?id=' . $id);
101 101
     }
102 102
 }
103 103
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         // Add a the data for the bigbluebuttonbn instance.
115 115
         $groupobj = null;
116 116
         if (groups_get_activity_groupmode($cm) > 0) {
117
-            $groupobj = (object) array('id' => 0, 'name' => get_string('allparticipants'));
117
+            $groupobj = (object)array('id' => 0, 'name' => get_string('allparticipants'));
118 118
         }
119 119
         $table->data[] = bigbluebuttonbn_index_display_room($canmoderate, $course, $bigbluebuttonbn, $groupobj);
120 120
 
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 
136 136
 // Functions.
137 137
 function bigbluebuttonbn_index_display_room($moderator, $course, $bigbluebuttonbn, $groupobj = null) {
138
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
138
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
139 139
     $paramgroup = '';
140 140
     $groupname = '';
141 141
 
142 142
     if ($groupobj) {
143
-        $meetingid .= '['.$groupobj->id.']';
144
-        $paramgroup = '&group='.$groupobj->id;
143
+        $meetingid .= '[' . $groupobj->id . ']';
144
+        $paramgroup = '&group=' . $groupobj->id;
145 145
         $groupname = $groupobj->name;
146 146
     }
147 147
     $meetinginfo = bigbluebuttonbn_get_meeting_info_array($meetingid);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     }
160 160
 
161 161
     // Output Users in the meeting.
162
-    $joinurl = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.$paramgroup.'">'.format_string($bigbluebuttonbn->name).'</a>';
162
+    $joinurl = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . $paramgroup . '">' . format_string($bigbluebuttonbn->name) . '</a>';
163 163
     $group = $groupname;
164 164
     $users = '';
165 165
     $viewerlist = '';
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         $attendeecount = 0;
196 196
         foreach ($meetinginfo['attendees']->attendee as $attendee) {
197 197
             if ($attendee->role == $role) {
198
-                $attendeelist .= ($attendeecount++ > 0 ? ', ' : '').$attendee->fullName;
198
+                $attendeelist .= ($attendeecount++ > 0 ? ', ' : '') . $attendee->fullName;
199 199
             }
200 200
         }
201 201
     }
@@ -218,15 +218,15 @@  discard block
 block discarded – undo
218 218
     $actions = '';
219 219
 
220 220
     if ($moderator) {
221
-        $actions .= '<form name="form1" method="post" action="">'.'/n';
222
-        $actions .= '  <INPUT type="hidden" name="id" value="'.$course->id.'">'.'/n';
223
-        $actions .= '  <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'.'/n';
221
+        $actions .= '<form name="form1" method="post" action="">' . '/n';
222
+        $actions .= '  <INPUT type="hidden" name="id" value="' . $course->id . '">' . '/n';
223
+        $actions .= '  <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . '/n';
224 224
         if ($groupobj != null) {
225
-            $actions .= '  <INPUT type="hidden" name="g" value="'.$groupobj->id.'">'.'/n';
225
+            $actions .= '  <INPUT type="hidden" name="g" value="' . $groupobj->id . '">' . '/n';
226 226
         }
227
-        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\''.
228
-            get_string('index_confirm_end', 'bigbluebuttonbn').'\')">'.'/n';
229
-        $actions .= '</form>'.'/n';
227
+        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' .
228
+            get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . '/n';
229
+        $actions .= '</form>' . '/n';
230 230
     }
231 231
 
232 232
     return $actions;
Please login to merge, or discard this patch.