Completed
Push — v2.3-stable ( 263346...6d8017 )
by Jesus
01:52
created
classes/settings/renderer.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 defined('MOODLE_INTERNAL') || die();
29 29
 
30
-require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
30
+require_once($CFG->dirroot.'/mod/bigbluebuttonbn/locallib.php');
31 31
 require_once($CFG->libdir.'/adminlib.php');
32 32
 
33 33
 /**
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function render_group_header($name, $itemname = null, $itemdescription = null) {
65 65
         if ($itemname === null) {
66
-            $itemname = get_string('config_' . $name, 'bigbluebuttonbn');
66
+            $itemname = get_string('config_'.$name, 'bigbluebuttonbn');
67 67
         }
68 68
         if ($itemdescription === null) {
69
-            $itemdescription = get_string('config_' .$name . '_description', 'bigbluebuttonbn');
69
+            $itemdescription = get_string('config_'.$name.'_description', 'bigbluebuttonbn');
70 70
         }
71
-        $item = new \admin_setting_heading('bigbluebuttonbn_config_' . $name, $itemname, $itemdescription);
71
+        $item = new \admin_setting_heading('bigbluebuttonbn_config_'.$name, $itemname, $itemdescription);
72 72
         $this->settings->add($item);
73 73
     }
74 74
 
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
      * @return Object
98 98
      */
99 99
     public function render_group_element_text($name, $default = null, $type = PARAM_RAW) {
100
-        $item = new \admin_setting_configtext('bigbluebuttonbn_' . $name,
101
-                get_string('config_' . $name, 'bigbluebuttonbn'),
102
-                get_string('config_' . $name . '_description', 'bigbluebuttonbn'),
100
+        $item = new \admin_setting_configtext('bigbluebuttonbn_'.$name,
101
+                get_string('config_'.$name, 'bigbluebuttonbn'),
102
+                get_string('config_'.$name.'_description', 'bigbluebuttonbn'),
103 103
                 $default, $type);
104 104
         return $item;
105 105
     }
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
      * @return Object
114 114
      */
115 115
     public function render_group_element_checkbox($name, $default = null) {
116
-        $item = new \admin_setting_configcheckbox('bigbluebuttonbn_' . $name,
117
-                get_string('config_' . $name, 'bigbluebuttonbn'),
118
-                get_string('config_' . $name . '_description', 'bigbluebuttonbn'),
116
+        $item = new \admin_setting_configcheckbox('bigbluebuttonbn_'.$name,
117
+                get_string('config_'.$name, 'bigbluebuttonbn'),
118
+                get_string('config_'.$name.'_description', 'bigbluebuttonbn'),
119 119
                 $default);
120 120
         return $item;
121 121
     }
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
      * @return Object
131 131
      */
132 132
     public function render_group_element_configmultiselect($name, $defaultsetting, $choices) {
133
-        $item = new \admin_setting_configmultiselect('bigbluebuttonbn_' . $name,
134
-                get_string('config_' . $name, 'bigbluebuttonbn'),
135
-                get_string('config_' . $name . '_description', 'bigbluebuttonbn'),
133
+        $item = new \admin_setting_configmultiselect('bigbluebuttonbn_'.$name,
134
+                get_string('config_'.$name, 'bigbluebuttonbn'),
135
+                get_string('config_'.$name.'_description', 'bigbluebuttonbn'),
136 136
                 $defaultsetting, $choices);
137 137
         return $item;
138 138
     }
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
      * @return Object
148 148
      */
149 149
     public function render_group_element_configselect($name, $defaultsetting, $choices) {
150
-        $item = new \admin_setting_configselect('bigbluebuttonbn_' . $name,
151
-                get_string('config_' . $name, 'bigbluebuttonbn'),
152
-                get_string('config_' . $name . '_description', 'bigbluebuttonbn'),
150
+        $item = new \admin_setting_configselect('bigbluebuttonbn_'.$name,
151
+                get_string('config_'.$name, 'bigbluebuttonbn'),
152
+                get_string('config_'.$name.'_description', 'bigbluebuttonbn'),
153 153
                 $defaultsetting, $choices);
154 154
         return $item;
155 155
     }
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
      * @return Object
166 166
      */
167 167
     public function render_warning_message($name, $message, $type = 'warning', $closable = true) {
168
-        $output = $this->output->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in',
169
-            'bigbluebuttonbn_' . $name)."\n";
168
+        $output = $this->output->box_start('box boxalignleft adminerror alert alert-'.$type.' alert-block fade in',
169
+            'bigbluebuttonbn_'.$name)."\n";
170 170
         if ($closable) {
171
-            $output .= '  <button type="button" class="close" data-dismiss="alert">&times;</button>' . "\n";
171
+            $output .= '  <button type="button" class="close" data-dismiss="alert">&times;</button>'."\n";
172 172
         }
173
-        $output .= '  ' . $message . "\n";
174
-        $output .= $this->output->box_end() . "\n";
175
-        $item = new \admin_setting_heading('bigbluebuttonbn_' . $name, '', $output);
173
+        $output .= '  '.$message."\n";
174
+        $output .= $this->output->box_end()."\n";
175
+        $item = new \admin_setting_heading('bigbluebuttonbn_'.$name, '', $output);
176 176
         $this->settings->add($item);
177 177
         return $item;
178 178
     }
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
         $filemanageroptions['mainfile'] = true;
195 195
 
196 196
         $filemanager = new \admin_setting_configstoredfile('mod_bigbluebuttonbn/presentationdefault',
197
-            get_string('config_' . $name, 'bigbluebuttonbn'),
198
-            get_string('config_' . $name . '_description', 'bigbluebuttonbn'),
197
+            get_string('config_'.$name, 'bigbluebuttonbn'),
198
+            get_string('config_'.$name.'_description', 'bigbluebuttonbn'),
199 199
             'presentationdefault',
200 200
             0,
201 201
             $filemanageroptions);
Please login to merge, or discard this patch.
locallib.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null,
104 104
         $userid = null, $clienttype = BIGBLUEBUTTON_CLIENTTYPE_FLASH) {
105 105
     $data = ['meetingID' => $meetingid,
106
-              'fullName' => $username,
107
-              'password' => $pw,
108
-              'logoutURL' => $logouturl,
106
+                'fullName' => $username,
107
+                'password' => $pw,
108
+                'logoutURL' => $logouturl,
109 109
             ];
110 110
     // Choose between Adobe Flash or HTML5 Client.
111 111
     if ( $clienttype == BIGBLUEBUTTON_CLIENTTYPE_HTML5 ) {
@@ -161,23 +161,23 @@  discard block
 block discarded – undo
161 161
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
162 162
     $xml = bigbluebuttonbn_wrap_xml_load_file(
163 163
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
164
-      );
164
+        );
165 165
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
166 166
         // Meeting info was returned.
167 167
         return array('returncode' => $xml->returncode,
168
-                     'meetingID' => $xml->meetingID,
169
-                     'moderatorPW' => $xml->moderatorPW,
170
-                     'attendeePW' => $xml->attendeePW,
171
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
172
-                     'running' => $xml->running,
173
-                     'recording' => $xml->recording,
174
-                     'startTime' => $xml->startTime,
175
-                     'endTime' => $xml->endTime,
176
-                     'participantCount' => $xml->participantCount,
177
-                     'moderatorCount' => $xml->moderatorCount,
178
-                     'attendees' => $xml->attendees,
179
-                     'metadata' => $xml->metadata,
180
-                   );
168
+                        'meetingID' => $xml->meetingID,
169
+                        'moderatorPW' => $xml->moderatorPW,
170
+                        'attendeePW' => $xml->attendeePW,
171
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
172
+                        'running' => $xml->running,
173
+                        'recording' => $xml->recording,
174
+                        'startTime' => $xml->startTime,
175
+                        'endTime' => $xml->endTime,
176
+                        'participantCount' => $xml->participantCount,
177
+                        'moderatorCount' => $xml->moderatorCount,
178
+                        'attendees' => $xml->attendees,
179
+                        'metadata' => $xml->metadata,
180
+                    );
181 181
     }
182 182
     if ($xml) {
183 183
         // Either failure or success without meeting info.
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 function bigbluebuttonbn_get_default_config_xml() {
334 334
     $xml = bigbluebuttonbn_wrap_xml_load_file(
335 335
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
336
-      );
336
+        );
337 337
     return $xml;
338 338
 }
339 339
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
     foreach ($ids as $id) {
438 438
         $xml = bigbluebuttonbn_wrap_xml_load_file(
439 439
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
440
-          );
440
+            );
441 441
         if ($xml && $xml->returncode != 'SUCCESS') {
442 442
             return false;
443 443
         }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
     foreach ($ids as $id) {
457 457
         $xml = bigbluebuttonbn_wrap_xml_load_file(
458 458
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
459
-          );
459
+            );
460 460
         if ($xml && $xml->returncode != 'SUCCESS') {
461 461
             return false;
462 462
         }
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
     foreach ($ids as $id) {
476 476
         $xml = bigbluebuttonbn_wrap_xml_load_file(
477 477
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
478
-          );
478
+            );
479 479
         if ($xml && $xml->returncode != 'SUCCESS') {
480 480
             return false;
481 481
         }
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
493 493
     $xml = bigbluebuttonbn_wrap_xml_load_file(
494 494
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
495
-      );
495
+        );
496 496
     if ($xml) {
497 497
         // If the xml packet returned failure it displays the message to the user.
498 498
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 function bigbluebuttonbn_get_server_version() {
510 510
     $xml = bigbluebuttonbn_wrap_xml_load_file(
511 511
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
512
-      );
512
+        );
513 513
     if ($xml && $xml->returncode == 'SUCCESS') {
514 514
         return $xml->version;
515 515
     }
@@ -578,10 +578,10 @@  discard block
 block discarded – undo
578 578
         }
579 579
         $options = array();
580 580
         $options['CURLOPT_HTTPHEADER'] = array(
581
-                 'Content-Type: '.$contenttype,
582
-                 'Content-Length: '.strlen($data),
583
-                 'Content-Language: en-US',
584
-               );
581
+                    'Content-Type: '.$contenttype,
582
+                    'Content-Length: '.strlen($data),
583
+                    'Content-Language: en-US',
584
+                );
585 585
 
586 586
         return $c->post($url, $data, $options);
587 587
     }
@@ -770,12 +770,12 @@  discard block
 block discarded – undo
770 770
         'all' => array(
771 771
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
772 772
             'children' => []
773
-          )
774
-      );
773
+            )
774
+        );
775 775
     $data['role'] = array(
776 776
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
777 777
         'children' => bigbluebuttonbn_get_roles_select($context, true)
778
-      );
778
+        );
779 779
     $data['user'] = array(
780 780
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
781 781
         'children' => bigbluebuttonbn_get_users_select($context, $bbactivity),
@@ -822,7 +822,7 @@  discard block
 block discarded – undo
822 822
         'selectiontype' => 'all',
823 823
         'selectionid' => 'all',
824 824
         'role' => BIGBLUEBUTTONBN_ROLE_VIEWER
825
-      );
825
+        );
826 826
     $defaultrules = explode(',', \mod_bigbluebuttonbn\locallib\config::get('participant_moderator_default'));
827 827
     foreach ($defaultrules as $defaultrule) {
828 828
         if ($defaultrule == '0') {
@@ -835,9 +835,9 @@  discard block
 block discarded – undo
835 835
             continue;
836 836
         }
837 837
         $participantlist[] = array(
838
-              'selectiontype' => 'role',
839
-              'selectionid' => $defaultrule,
840
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
838
+                'selectiontype' => 'role',
839
+                'selectionid' => $defaultrule,
840
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
841 841
     }
842 842
     return $participantlist;
843 843
 }
@@ -876,11 +876,11 @@  discard block
 block discarded – undo
876 876
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
877 877
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
878 878
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
879
-          ],
879
+            ],
880 880
         'type_selected' => 'all',
881 881
         'options' => ['all' => '---------------'],
882 882
         'selected' => 'all',
883
-      ];
883
+        ];
884 884
 }
885 885
 
886 886
 /**
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
     // Ping again and refresh the cache.
1200 1200
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1201 1201
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1202
-      );
1202
+        );
1203 1203
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1204 1204
     return $meetinginfo;
1205 1205
 }
@@ -1612,8 +1612,8 @@  discard block
 block discarded – undo
1612 1612
     }
1613 1613
     $id = 'playbacks-'.$recording['recordID'];
1614 1614
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1615
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1616
-          'title' => $title, $visibility => $visibility));
1615
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1616
+            'title' => $title, $visibility => $visibility));
1617 1617
     foreach ($recording['playbacks'] as $playback) {
1618 1618
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback);
1619 1619
     }
@@ -1648,7 +1648,7 @@  discard block
 block discarded – undo
1648 1648
         'data-action' => 'play',
1649 1649
         'data-target' => $playback['type'],
1650 1650
         'data-href' => $href,
1651
-      );
1651
+        );
1652 1652
     if ($CFG->bigbluebuttonbn_recordings_validate_url && !bigbluebuttonbn_is_bn_server()
1653 1653
             && !bigbluebuttonbn_is_valid_resource(trim($playback['url']))) {
1654 1654
         $linkattributes['class'] = 'btn btn-sm btn-warning';
@@ -1831,10 +1831,10 @@  discard block
 block discarded – undo
1831 1831
             'id' => $id,
1832 1832
             'onclick' => $onclick,
1833 1833
             'data-action' => $data['action']
1834
-          );
1834
+            );
1835 1835
         if (!isset($recording['imported'])) {
1836 1836
             $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(
1837
-              $recording['recordID']);
1837
+                $recording['recordID']);
1838 1838
         }
1839 1839
         if (isset($data['disabled'])) {
1840 1840
             $iconattributes['class'] .= ' fa-' . $data['disabled'];
@@ -2353,17 +2353,17 @@  discard block
 block discarded – undo
2353 2353
 function bigbluebuttonbn_get_instance_type_profiles() {
2354 2354
     $instanceprofiles = array(
2355 2355
         BIGBLUEBUTTONBN_TYPE_ALL => array('id' => BIGBLUEBUTTONBN_TYPE_ALL,
2356
-                  'name' => get_string('instance_type_default', 'bigbluebuttonbn'),
2357
-                  'features' => array('all')),
2356
+                    'name' => get_string('instance_type_default', 'bigbluebuttonbn'),
2357
+                    'features' => array('all')),
2358 2358
         BIGBLUEBUTTONBN_TYPE_ROOM_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_ROOM_ONLY,
2359
-                  'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'),
2360
-                  'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit',
2361
-                      'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups',
2362
-                      'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection',
2363
-                      'clienttype', 'availabilityconditionsheader')),
2359
+                    'name' => get_string('instance_type_room_only', 'bigbluebuttonbn'),
2360
+                    'features' => array('showroom', 'welcomemessage', 'voicebridge', 'waitformoderator', 'userlimit',
2361
+                        'recording', 'sendnotifications', 'preuploadpresentation', 'permissions', 'schedule', 'groups',
2362
+                        'modstandardelshdr', 'availabilityconditionsheader', 'tagshdr', 'competenciessection',
2363
+                        'clienttype', 'availabilityconditionsheader')),
2364 2364
         BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY => array('id' => BIGBLUEBUTTONBN_TYPE_RECORDING_ONLY,
2365
-                  'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'),
2366
-                  'features' => array('showrecordings', 'importrecordings', 'availabilityconditionsheader'))
2365
+                    'name' => get_string('instance_type_recording_only', 'bigbluebuttonbn'),
2366
+                    'features' => array('showrecordings', 'importrecordings', 'availabilityconditionsheader'))
2367 2367
     );
2368 2368
     return $instanceprofiles;
2369 2369
 }
@@ -2452,8 +2452,8 @@  discard block
 block discarded – undo
2452 2452
     $activitytime = '';
2453 2453
     if ($time) {
2454 2454
         $activitytime = calendar_day_representation($time).' '.
2455
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2456
-          calendar_time_representation($time);
2455
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2456
+            calendar_time_representation($time);
2457 2457
     }
2458 2458
     return $activitytime;
2459 2459
 }
@@ -2776,7 +2776,7 @@  discard block
 block discarded – undo
2776 2776
                 'participant_moderator_default',
2777 2777
                 array_keys($owner),
2778 2778
                 $owner + $roles) // CONTRIB-7966: don't use array_merge here so it does not reindex the array.
2779
-          );
2779
+            );
2780 2780
     }
2781 2781
 }
2782 2782
 
@@ -2812,7 +2812,7 @@  discard block
 block discarded – undo
2812 2812
         // Web Client default.
2813 2813
         $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
2814 2814
         $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
2815
-                         BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2815
+                            BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2816 2816
         $renderer->render_group_element('clienttype_default',
2817 2817
             $renderer->render_group_element_configselect('clienttype_default',
2818 2818
                 $default, $choices));
@@ -2923,7 +2923,7 @@  discard block
 block discarded – undo
2923 2923
         return $output;
2924 2924
     }
2925 2925
     $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in',
2926
-      'bigbluebuttonbn_view_general_warning') . "\n";
2926
+        'bigbluebuttonbn_view_general_warning') . "\n";
2927 2927
     $output .= '    ' . $message . "\n";
2928 2928
     $output .= '  <div class="singlebutton pull-right">' . "\n";
2929 2929
     if (!empty($href)) {
Please login to merge, or discard this patch.