Completed
Branch master (f92a9e)
by Jesus
02:18
created
classes/event/bigbluebuttonbn_meeting_joined.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
      * @return string
53 53
      */
54 54
     public function get_description() {
55
-        $a = (object) array('userid' => $this->userid,
55
+        $a = (object)array('userid' => $this->userid,
56 56
                             'bigbluebuttonbnid' => $this->objectid,
57 57
                             'courseid' => $this->contextinstanceid);
58 58
 
59
-        return "The user with id '$a->userid' has joined a bigbluebutton meeting for ".
60
-        "the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for the course id ".
59
+        return "The user with id '$a->userid' has joined a bigbluebutton meeting for " .
60
+        "the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for the course id " .
61 61
         "'$a->courseid'.";
62 62
     }
63 63
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function get_legacy_logdata() {
70 70
         return array($this->courseid, 'bigbluebuttonbn', 'meeting joined',
71
-                'view.php?pageid='.$this->objectid, 'BigBlueButtonBN meeting joined',
71
+                'view.php?pageid=' . $this->objectid, 'BigBlueButtonBN meeting joined',
72 72
                 $this->contextinstanceid);
73 73
     }
74 74
 
Please login to merge, or discard this patch.
backup/moodle2/backup_bigbluebuttonbn_activity_task.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 defined('MOODLE_INTERNAL') || die;
25 25
 
26
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php');
26
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php');
27 27
 
28 28
 /**
29 29
  * bigbluebuttonbn backup task that provides all the settings and steps to perform one
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
     public static function encode_content_links($content) {
54 54
         global $CFG;
55 55
 
56
-        $base = preg_quote($CFG->wwwroot.'/mod/bigbluebuttonbn', '#');
56
+        $base = preg_quote($CFG->wwwroot . '/mod/bigbluebuttonbn', '#');
57 57
 
58 58
         // Link to the list of bigbluebuttonbns.
59
-        $pattern = '#('.$base."\/index.php\?id\=)([0-9]+)#";
59
+        $pattern = '#(' . $base . "\/index.php\?id\=)([0-9]+)#";
60 60
         $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNINDEX*$2@$', $content);
61 61
 
62 62
         // Link to bigbluebuttonbn view by moduleid.
63
-        $pattern = '#('.$base."\/view.php\?id\=)([0-9]+)#";
63
+        $pattern = '#(' . $base . "\/view.php\?id\=)([0-9]+)#";
64 64
         $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNVIEWBYID*$2@$', $content);
65 65
 
66 66
         return $content;
Please login to merge, or discard this patch.
backup/moodle2/restore_bigbluebuttonbn_stepslib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     protected function process_bigbluebuttonbn($data) {
46 46
         global $DB;
47 47
 
48
-        $data = (object) $data;
48
+        $data = (object)$data;
49 49
         $data->course = $this->get_courseid();
50 50
 
51 51
         $data->timemodified = $this->apply_date_offset($data->timemodified);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     protected function process_bigbluebuttonbn_logs($data) {
60 60
         global $DB;
61 61
 
62
-        $data = (object) $data;
62
+        $data = (object)$data;
63 63
         // Apply modifications.
64 64
         $data->courseid = $this->get_mappingid('course', $data->courseid);
65 65
         $data->bigbluebuttonbnid = $this->get_new_parentid('bigbluebuttonbn');
Please login to merge, or discard this patch.
backup/moodle2/restore_bigbluebuttonbn_activity_task.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 defined('MOODLE_INTERNAL') || die();
25 25
 
26
-require_once($CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php');
26
+require_once($CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php');
27 27
 
28 28
 /**
29 29
  * bigbluebuttonbn restore task that provides all the settings and steps to perform one
Please login to merge, or discard this patch.
backup/moodle2/backup_bigbluebuttonbn_stepslib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,12 +40,12 @@
 block discarded – undo
40 40
                             'moderatorpass', 'viewerpass', 'wait', 'record', 'tagging',
41 41
                             'welcome', 'voicebridge', 'openingtime', 'closingtime',
42 42
                             'timecreated', 'timemodified', 'presentation', 'participants',
43
-                            'userlimit', ));
43
+                            'userlimit',));
44 44
 
45 45
         $logs = new backup_nested_element('logs');
46 46
 
47 47
         $log = new backup_nested_element('log', array('id'), array(
48
-                'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', ));
48
+                'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',));
49 49
 
50 50
         // Build the tree.
51 51
         $bigbluebuttonbn->add_child($logs);
Please login to merge, or discard this patch.
settings.php 1 patch
Spacing   +3 added lines, -3 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__).'/locallib.php');
30
+require_once(dirname(__FILE__) . '/locallib.php');
31 31
 
32 32
 if ($ADMIN->fulltree) {
33 33
     if (!isset($CFG->bigbluebuttonbn['server_url']) ||
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
         } else {
259 259
             $settings->add(new admin_setting_heading('bigbluebuttonbn_feature_preuploadpresentation',
260 260
                 get_string('config_feature_preuploadpresentation', 'bigbluebuttonbn'),
261
-                get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn').'<br><br>'.
262
-                '<div class="form-defaultinfo">'.get_string('config_warning_curl_not_installed', 'bigbluebuttonbn').'</div><br>'
261
+                get_string('config_feature_preuploadpresentation_description', 'bigbluebuttonbn') . '<br><br>' .
262
+                '<div class="form-defaultinfo">' . get_string('config_warning_curl_not_installed', 'bigbluebuttonbn') . '</div><br>'
263 263
                 ));
264 264
         }
265 265
     }
Please login to merge, or discard this patch.
bbb_broker.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -175,6 +175,9 @@  discard block
 block discarded – undo
175 175
     return "{$params['callback']}({$callbackresponsedata});";
176 176
 }
177 177
 
178
+/**
179
+ * @param boolean $running
180
+ */
178 181
 function bigbluebuttonbn_broker_meeting_info_can_join($bbbsession, $running, $participantcount) {
179 182
     $status = array("can_join" => false);
180 183
     if ($running) {
@@ -195,6 +198,9 @@  discard block
 block discarded – undo
195 198
     return $status;
196 199
 }
197 200
 
201
+/**
202
+ * @param boolean $running
203
+ */
198 204
 function bigbluebuttonbn_broker_meeting_info_can_end($bbbsession, $running) {
199 205
     $status = array("can_end" => false);
200 206
     if ($running && ($bbbsession['administrator'] || $bbbsession['moderator'])) {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -554,11 +554,11 @@
 block discarded – undo
554 554
         'recording_import' => ['id' => 'The recordingID must be specified.'],
555 555
         'recording_ready' => [
556 556
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
557
-          ],
557
+            ],
558 558
         'live_session_events' => [
559 559
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
560
-          ]
561
-      ];
560
+            ]
561
+        ];
562 562
 
563 563
     if (!isset($params['callback'])) {
564 564
         return 'This call must include a javascript callback.';
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
23 23
  */
24 24
 
25
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
26
-require_once(dirname(__FILE__).'/locallib.php');
25
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
26
+require_once(dirname(__FILE__) . '/locallib.php');
27 27
 
28 28
 use \Firebase\JWT\JWT;
29 29
 
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
 $params['meta'] = optional_param('meta', '', PARAM_TEXT);
40 40
 
41 41
 if (empty($params['action'])) {
42
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
42
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
43 43
     return;
44 44
 }
45 45
 
46 46
 $error = bigbluebuttonbn_broker_validate_parameters($params);
47 47
 if (!empty($error)) {
48
-    header('HTTP/1.0 400 Bad Request. '.$error);
48
+    header('HTTP/1.0 400 Bad Request. ' . $error);
49 49
     return;
50 50
 }
51 51
 
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
         return;
134 134
     }
135 135
 
136
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
136
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
137 137
     return;
138 138
 
139 139
 } catch (Exception $e) {
140
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
140
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
141 141
     return;
142 142
 }
143 143
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
284 284
     $callbackresponse['status'] = true;
285
-    $callbackresponse['published'] = (string) $recording['published'];
285
+    $callbackresponse['published'] = (string)$recording['published'];
286 286
     if (!isset($params['meta'])) {
287 287
         return $callbackresponse;
288 288
     }
@@ -450,8 +450,8 @@  discard block
 block discarded – undo
450 450
         $decodedparameters = JWT::decode($params['signed_parameters'], bigbluebuttonbn_get_cfg_shared_secret(),
451 451
             array('HS256'));
452 452
     } catch (Exception $e) {
453
-        $error = 'Caught exception: '.$e->getMessage();
454
-        header('HTTP/1.0 400 Bad Request. '.$error);
453
+        $error = 'Caught exception: ' . $e->getMessage();
454
+        header('HTTP/1.0 400 Bad Request. ' . $error);
455 455
         return;
456 456
     }
457 457
 
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
470 470
         header('HTTP/1.0 202 Accepted');
471 471
     } catch (Exception $e) {
472
-        $error = 'Caught exception: '.$e->getMessage();
473
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
472
+        $error = 'Caught exception: ' . $e->getMessage();
473
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
474 474
     }
475 475
 }
476 476
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
486 486
     if (!isset($importrecordings[$params['id']])) {
487 487
         $error = "Recording {$params['id']} could not be found. It can not be imported";
488
-        header('HTTP/1.0 404 Not found. '.$error);
488
+        header('HTTP/1.0 404 Not found. ' . $error);
489 489
         return;
490 490
     }
491 491
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 
494 494
     $importrecordings[$params['id']]['imported'] = true;
495 495
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
496
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
496
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
497 497
     bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
498 498
     // Moodle event logger: Create an event for recording imported.
499 499
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -510,8 +510,8 @@  discard block
 block discarded – undo
510 510
         $decodedparameters = JWT::decode($params['signed_parameters'], bigbluebuttonbn_get_cfg_shared_secret(),
511 511
             array('HS256'));
512 512
     } catch (Exception $e) {
513
-        $error = 'Caught exception: '.$e->getMessage();
514
-        header('HTTP/1.0 400 Bad Request. '.$error);
513
+        $error = 'Caught exception: ' . $e->getMessage();
514
+        header('HTTP/1.0 400 Bad Request. ' . $error);
515 515
         return;
516 516
     }
517 517
 
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 
571 571
     $action = strtolower($params['action']);
572 572
     if (!array_key_exists($action, $requiredparams)) {
573
-        return 'Action '.$params['action'].' can not be performed.';
573
+        return 'Action ' . $params['action'] . ' can not be performed.';
574 574
     }
575 575
 
576 576
     foreach ($requiredparams[$action] as $param => $message) {
Please login to merge, or discard this patch.
mod_form.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
204 204
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6],
205 205
                 ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'),
206
-                 'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
207
-              );
206
+                    'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
207
+                );
208 208
         } else {
209 209
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
210 210
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]);
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
             $field['description_key'], $cfg['recordings_html_default']);
247 247
 
248 248
         $field = ['type' => 'hidden', 'name' => 'recordings_deleted_activities', 'data_type' => PARAM_INT,
249
-                  'description_key' => null];
249
+                    'description_key' => null];
250 250
         if ($cfg['recordings_deleted_activities_editable']) {
251 251
             $field['type'] = 'checkbox';
252 252
             $field['description_key'] = 'mod_form_field_recordings_deleted_activities';
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
             html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type',
302 302
                 $participantselection['type_selected'], array(),
303 303
                 array('id' => 'bigbluebuttonbn_participant_selection_type',
304
-                      'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).'&nbsp;&nbsp;'.
304
+                        'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).'&nbsp;&nbsp;'.
305 305
             html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
306 306
                 $participantselection['selected'], array(),
307 307
                 array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).'&nbsp;&nbsp;'.
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 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
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         $serverversion = bigbluebuttonbn_get_server_version();
39 39
         if (is_null($serverversion)) {
40 40
             print_error('general_error_unable_connect', 'bigbluebuttonbn',
41
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
41
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
42 42
         }
43 43
 
44 44
         $bigbluebuttonbn = null;
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
             html_writer::select($participantselection['type_options'], 'bigbluebuttonbn_participant_selection_type',
302 302
                 $participantselection['type_selected'], array(),
303 303
                 array('id' => 'bigbluebuttonbn_participant_selection_type',
304
-                      'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')).'&nbsp;&nbsp;'.
304
+                      'onchange' => 'M.mod_bigbluebuttonbn.modform.participant_selection_set(); return 0;')) . '&nbsp;&nbsp;' .
305 305
             html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
306 306
                 $participantselection['selected'], array(),
307
-                array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')).'&nbsp;&nbsp;'.
308
-            '<input value="'.get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn').
309
-            '" class="btn btn-secondary" type="button" id="id_addselectionid" '.
307
+                array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled')) . '&nbsp;&nbsp;' .
308
+            '<input value="' . get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn') .
309
+            '" class="btn btn-secondary" type="button" id="id_addselectionid" ' .
310 310
             'onclick="M.mod_bigbluebuttonbn.modform.participant_add(); return 0;" />'
311 311
         );
312 312
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         // Render elements for participant list.
324 324
         $htmllist = html_writer::tag('div',
325 325
             html_writer::label(get_string('mod_form_field_participant_list', 'bigbluebuttonbn'),
326
-                'bigbluebuttonbn_participant_list').
326
+                'bigbluebuttonbn_participant_list') .
327 327
             html_writer::table($table)
328 328
         );
329 329
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         }
357 357
 
358 358
         $mform->addElement($type, $name, get_string($descriptionkey, 'bigbluebuttonbn'), $options);
359
-        if (get_string_manager()->string_exists($descriptionkey.'_help', 'bigbluebuttonbn')) {
359
+        if (get_string_manager()->string_exists($descriptionkey . '_help', 'bigbluebuttonbn')) {
360 360
             $mform->addHelpButton($name, $descriptionkey, 'bigbluebuttonbn');
361 361
         }
362 362
         if (!empty($rule)) {
Please login to merge, or discard this patch.
classes/event/bigbluebuttonbn_live_session_event.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
      * @return string
53 53
      */
54 54
     public function get_description() {
55
-        $a = (object) array('userid' => $this->userid,
55
+        $a = (object)array('userid' => $this->userid,
56 56
                             'bigbluebuttonbnid' => $this->objectid,
57 57
                             'courseid' => $this->contextinstanceid,
58 58
                             'action' => $this->other);
59 59
 
60
-        return "The user with id '$a->userid' triggered action $a->action in a ".
61
-        "bigbluebutton meeting for the bigbluebuttonbn activity with id ".
60
+        return "The user with id '$a->userid' triggered action $a->action in a " .
61
+        "bigbluebutton meeting for the bigbluebuttonbn activity with id " .
62 62
         "'$a->bigbluebuttonbnid' for the course id '$a->courseid'.";
63 63
     }
64 64
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     protected function get_legacy_logdata() {
71 71
         return array($this->courseid, 'bigbluebuttonbn', 'meeting left',
72
-                'view.php?pageid='.$this->objectid, 'BigBlueButtonBN meeting live session event',
72
+                'view.php?pageid=' . $this->objectid, 'BigBlueButtonBN meeting live session event',
73 73
                 $this->contextinstanceid);
74 74
     }
75 75
 
Please login to merge, or discard this patch.