Completed
Pull Request — v2.2-stable (#330)
by Jesus
02:19
created
locallib.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null,
96 96
             $userid = null, $clienttype = BIGBLUEBUTTON_CLIENTTYPE_FLASH, $createtime = null) {
97 97
     $data = ['meetingID' => $meetingid,
98
-              'fullName' => $username,
99
-              'password' => $pw,
100
-              'logoutURL' => $logouturl,
98
+                'fullName' => $username,
99
+                'password' => $pw,
100
+                'logoutURL' => $logouturl,
101 101
             ];
102 102
     // Choose between Adobe Flash or HTML5 Client.
103 103
     if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) {
@@ -157,23 +157,23 @@  discard block
 block discarded – undo
157 157
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
158 158
     $xml = bigbluebuttonbn_wrap_xml_load_file(
159 159
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
160
-      );
160
+        );
161 161
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
162 162
         // Meeting info was returned.
163 163
         return array('returncode' => $xml->returncode,
164
-                     'meetingID' => $xml->meetingID,
165
-                     'moderatorPW' => $xml->moderatorPW,
166
-                     'attendeePW' => $xml->attendeePW,
167
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
168
-                     'running' => $xml->running,
169
-                     'recording' => $xml->recording,
170
-                     'startTime' => $xml->startTime,
171
-                     'endTime' => $xml->endTime,
172
-                     'participantCount' => $xml->participantCount,
173
-                     'moderatorCount' => $xml->moderatorCount,
174
-                     'attendees' => $xml->attendees,
175
-                     'metadata' => $xml->metadata,
176
-                   );
164
+                        'meetingID' => $xml->meetingID,
165
+                        'moderatorPW' => $xml->moderatorPW,
166
+                        'attendeePW' => $xml->attendeePW,
167
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
168
+                        'running' => $xml->running,
169
+                        'recording' => $xml->recording,
170
+                        'startTime' => $xml->startTime,
171
+                        'endTime' => $xml->endTime,
172
+                        'participantCount' => $xml->participantCount,
173
+                        'moderatorCount' => $xml->moderatorCount,
174
+                        'attendees' => $xml->attendees,
175
+                        'metadata' => $xml->metadata,
176
+                    );
177 177
     }
178 178
     if ($xml) {
179 179
         // Either failure or success without meeting info.
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 function bigbluebuttonbn_get_default_config_xml() {
310 310
     $xml = bigbluebuttonbn_wrap_xml_load_file(
311 311
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
312
-      );
312
+        );
313 313
     return $xml;
314 314
 }
315 315
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     foreach ($ids as $id) {
411 411
         $xml = bigbluebuttonbn_wrap_xml_load_file(
412 412
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
413
-          );
413
+            );
414 414
         if ($xml && $xml->returncode != 'SUCCESS') {
415 415
             return false;
416 416
         }
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     foreach ($ids as $id) {
430 430
         $xml = bigbluebuttonbn_wrap_xml_load_file(
431 431
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
432
-          );
432
+            );
433 433
         if ($xml && $xml->returncode != 'SUCCESS') {
434 434
             return false;
435 435
         }
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
     foreach ($ids as $id) {
449 449
         $xml = bigbluebuttonbn_wrap_xml_load_file(
450 450
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
451
-          );
451
+            );
452 452
         if ($xml && $xml->returncode != 'SUCCESS') {
453 453
             return false;
454 454
         }
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
466 466
     $xml = bigbluebuttonbn_wrap_xml_load_file(
467 467
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
468
-      );
468
+        );
469 469
     if ($xml) {
470 470
         // If the xml packet returned failure it displays the message to the user.
471 471
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 function bigbluebuttonbn_get_server_version() {
483 483
     $xml = bigbluebuttonbn_wrap_xml_load_file(
484 484
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
485
-      );
485
+        );
486 486
     if ($xml && $xml->returncode == 'SUCCESS') {
487 487
         return $xml->version;
488 488
     }
@@ -549,10 +549,10 @@  discard block
 block discarded – undo
549 549
         }
550 550
         $options = array();
551 551
         $options['CURLOPT_HTTPHEADER'] = array(
552
-                 'Content-Type: '.$contenttype,
553
-                 'Content-Length: '.strlen($data),
554
-                 'Content-Language: en-US',
555
-               );
552
+                    'Content-Type: '.$contenttype,
553
+                    'Content-Length: '.strlen($data),
554
+                    'Content-Language: en-US',
555
+                );
556 556
 
557 557
         return $c->post($url, $data, $options);
558 558
     }
@@ -699,16 +699,16 @@  discard block
 block discarded – undo
699 699
         'all' => array(
700 700
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
701 701
             'children' => []
702
-          )
703
-      );
702
+            )
703
+        );
704 704
     $data['role'] = array(
705 705
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
706 706
         'children' => bigbluebuttonbn_get_roles_select($context)
707
-      );
707
+        );
708 708
     $data['user'] = array(
709 709
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
710 710
         'children' => bigbluebuttonbn_get_users_select($context)
711
-      );
711
+        );
712 712
     return $data;
713 713
 }
714 714
 
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
         'selectiontype' => 'all',
752 752
         'selectionid' => 'all',
753 753
         'role' => BIGBLUEBUTTONBN_ROLE_VIEWER
754
-      );
754
+        );
755 755
     $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default'));
756 756
     foreach ($defaultrules as $defaultrule) {
757 757
         if ($defaultrule == '0') {
@@ -764,9 +764,9 @@  discard block
 block discarded – undo
764 764
             continue;
765 765
         }
766 766
         $participantlist[] = array(
767
-              'selectiontype' => 'role',
768
-              'selectionid' => $defaultrule,
769
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
767
+                'selectiontype' => 'role',
768
+                'selectionid' => $defaultrule,
769
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
770 770
     }
771 771
     return $participantlist;
772 772
 }
@@ -805,11 +805,11 @@  discard block
 block discarded – undo
805 805
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
806 806
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
807 807
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
808
-          ],
808
+            ],
809 809
         'type_selected' => 'all',
810 810
         'options' => ['all' => '---------------'],
811 811
         'selected' => 'all',
812
-      ];
812
+        ];
813 813
 }
814 814
 
815 815
 /**
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
         $eventproperties['other'] = $options['other'];
1091 1091
     }
1092 1092
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1093
-      array($eventproperties));
1093
+        array($eventproperties));
1094 1094
     $event->trigger();
1095 1095
 }
1096 1096
 
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
     // Ping again and refresh the cache.
1135 1135
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1136 1136
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1137
-      );
1137
+        );
1138 1138
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1139 1139
     return $meetinginfo;
1140 1140
 }
@@ -1546,8 +1546,8 @@  discard block
 block discarded – undo
1546 1546
     }
1547 1547
     $id = 'playbacks-'.$recording['recordID'];
1548 1548
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1549
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1550
-          'title' => $title, $visibility => $visibility));
1549
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1550
+            'title' => $title, $visibility => $visibility));
1551 1551
     foreach ($recording['playbacks'] as $playback) {
1552 1552
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback);
1553 1553
     }
@@ -1571,7 +1571,7 @@  discard block
 block discarded – undo
1571 1571
     }
1572 1572
     $text = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1573 1573
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1574
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1574
+        '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1575 1575
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1576 1576
         $href .= '&href='.urlencode(trim($playback['url']));
1577 1577
     }
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
         'data-action' => 'play',
1583 1583
         'data-target' => $playback['type'],
1584 1584
         'data-href' => $href,
1585
-      );
1585
+        );
1586 1586
     if (!bigbluebuttonbn_is_bn_server() && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) {
1587 1587
         $linkattributes['class'] = 'btn btn-sm btn-warning';
1588 1588
         $linkattributes['title'] = get_string('view_recording_format_errror_unreachable', 'bigbluebuttonbn');
@@ -1732,10 +1732,10 @@  discard block
 block discarded – undo
1732 1732
             'id' => $id,
1733 1733
             'onclick' => $onclick,
1734 1734
             'data-action' => $data['action']
1735
-          );
1735
+            );
1736 1736
         if (!isset($recording['imported'])) {
1737 1737
             $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(
1738
-              $recording['recordID']);
1738
+                $recording['recordID']);
1739 1739
         }
1740 1740
         if (isset($data['disabled'])) {
1741 1741
             $iconattributes['class'] .= ' fa-' . $data['disabled'];
@@ -2294,8 +2294,8 @@  discard block
 block discarded – undo
2294 2294
     $activitytime = '';
2295 2295
     if ($time) {
2296 2296
         $activitytime = calendar_day_representation($time).' '.
2297
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2298
-          calendar_time_representation($time);
2297
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2298
+            calendar_time_representation($time);
2299 2299
     }
2300 2300
     return $activitytime;
2301 2301
 }
@@ -2391,7 +2391,7 @@  discard block
 block discarded – undo
2391 2391
     global $BIGBLUEBUTTONBN_CFG;
2392 2392
     if (isset($BIGBLUEBUTTONBN_CFG)) {
2393 2393
         $renderer->render_warning_message('general_warning',
2394
-             get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn'));
2394
+                get_string('config_warning_bigbluebuttonbn_cfg_deprecated', 'bigbluebuttonbn'));
2395 2395
     }
2396 2396
 }
2397 2397
 
@@ -2599,7 +2599,7 @@  discard block
 block discarded – undo
2599 2599
         $renderer->render_group_element('participant_moderator_default',
2600 2600
             $renderer->render_group_element_configmultiselect('participant_moderator_default',
2601 2601
                 array_keys($owner), array_merge($owner, $roles))
2602
-          );
2602
+            );
2603 2603
     }
2604 2604
 }
2605 2605
 
@@ -2637,7 +2637,7 @@  discard block
 block discarded – undo
2637 2637
         $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
2638 2638
 
2639 2639
         $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
2640
-                         BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2640
+                            BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2641 2641
         $renderer->render_group_element('clienttype_default',
2642 2642
             $renderer->render_group_element_configselect('clienttype_default',
2643 2643
                 $default, $choices));
@@ -2730,7 +2730,7 @@  discard block
 block discarded – undo
2730 2730
         return $output;
2731 2731
     }
2732 2732
     $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in',
2733
-      'bigbluebuttonbn_view_general_warning') . "\n";
2733
+        'bigbluebuttonbn_view_general_warning') . "\n";
2734 2734
     $output .= '    ' . $message . "\n";
2735 2735
     $output .= '  <div class="singlebutton pull-right">' . "\n";
2736 2736
     if (!empty($href)) {
Please login to merge, or discard this patch.