Completed
Push — master ( e871cd...770f64 )
by Jesus
02:14
created
locallib.php 1 patch
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.