Completed
Push — master ( f36481...8b2244 )
by Jesus
02:21
created
locallib.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
  */
124 124
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
125 125
     $data = ['meetingID' => $meetingid,
126
-              'fullName' => $username,
127
-              'password' => $pw,
128
-              'logoutURL' => $logouturl,
126
+                'fullName' => $username,
127
+                'password' => $pw,
128
+                'logoutURL' => $logouturl,
129 129
             ];
130 130
     if (!is_null($configtoken)) {
131 131
         $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.
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 function bigbluebuttonbn_get_default_config_xml() {
330 330
     $xml = bigbluebuttonbn_wrap_xml_load_file(
331 331
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
332
-      );
332
+        );
333 333
     return $xml;
334 334
 }
335 335
 
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
     foreach ($ids as $id) {
431 431
         $xml = bigbluebuttonbn_wrap_xml_load_file(
432 432
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
433
-          );
433
+            );
434 434
         if ($xml && $xml->returncode != 'SUCCESS') {
435 435
             return false;
436 436
         }
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
     foreach ($ids as $id) {
450 450
         $xml = bigbluebuttonbn_wrap_xml_load_file(
451 451
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
452
-          );
452
+            );
453 453
         if ($xml && $xml->returncode != 'SUCCESS') {
454 454
             return false;
455 455
         }
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
     foreach ($ids as $id) {
469 469
         $xml = bigbluebuttonbn_wrap_xml_load_file(
470 470
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
471
-          );
471
+            );
472 472
         if ($xml && $xml->returncode != 'SUCCESS') {
473 473
             return false;
474 474
         }
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
486 486
     $xml = bigbluebuttonbn_wrap_xml_load_file(
487 487
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
488
-      );
488
+        );
489 489
     if ($xml) {
490 490
         // If the xml packet returned failure it displays the message to the user.
491 491
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
      */
506 506
     $xml = bigbluebuttonbn_wrap_xml_load_file(
507 507
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
508
-      );
508
+        );
509 509
     return ($xml && $xml->returncode == 'SUCCESS');
510 510
 }
511 511
 
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 function bigbluebuttonbn_get_server_version() {
518 518
     $xml = bigbluebuttonbn_wrap_xml_load_file(
519 519
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
520
-      );
520
+        );
521 521
     if ($xml && $xml->returncode == 'SUCCESS') {
522 522
         return $xml->version;
523 523
     }
@@ -585,10 +585,10 @@  discard block
 block discarded – undo
585 585
 
586 586
         $options = array();
587 587
         $options['CURLOPT_HTTPHEADER'] = array(
588
-                 'Content-Type: '.$contenttype,
589
-                 'Content-Length: '.strlen($data),
590
-                 'Content-Language: en-US',
591
-               );
588
+                    'Content-Type: '.$contenttype,
589
+                    'Content-Length: '.strlen($data),
590
+                    'Content-Language: en-US',
591
+                );
592 592
 
593 593
         return $c->post($url, $data, $options);
594 594
     }
@@ -731,16 +731,16 @@  discard block
 block discarded – undo
731 731
         'all' => array(
732 732
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
733 733
             'children' => []
734
-          )
735
-      );
734
+            )
735
+        );
736 736
     $data['role'] = array(
737 737
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
738 738
         'children' => bigbluebuttonbn_get_roles_select($context)
739
-      );
739
+        );
740 740
     $data['user'] = array(
741 741
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
742 742
         'children' => bigbluebuttonbn_get_users_select($context)
743
-      );
743
+        );
744 744
     return $data;
745 745
 }
746 746
 
@@ -785,9 +785,9 @@  discard block
 block discarded – undo
785 785
             continue;
786 786
         }
787 787
         $participantlistarray[] = array(
788
-              'selectiontype' => 'role',
789
-              'selectionid' => $moderatordefault,
790
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
788
+                'selectiontype' => 'role',
789
+                'selectionid' => $moderatordefault,
790
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
791 791
     }
792 792
     return $participantlistarray;
793 793
 }
@@ -830,11 +830,11 @@  discard block
 block discarded – undo
830 830
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
831 831
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
832 832
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
833
-          ],
833
+            ],
834 834
         'type_selected' => 'all',
835 835
         'options' => ['all' => '---------------'],
836 836
         'selected' => 'all',
837
-      ];
837
+        ];
838 838
 }
839 839
 
840 840
 /**
@@ -1120,7 +1120,7 @@  discard block
 block discarded – undo
1120 1120
         $eventproperties['other'] = $options['other'];
1121 1121
     }
1122 1122
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1123
-      array($eventproperties));
1123
+        array($eventproperties));
1124 1124
     $event->trigger();
1125 1125
 }
1126 1126
 
@@ -1164,7 +1164,7 @@  discard block
 block discarded – undo
1164 1164
     // Ping again and refresh the cache.
1165 1165
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1166 1166
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1167
-      );
1167
+        );
1168 1168
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1169 1169
     return $meetinginfo;
1170 1170
 }
@@ -1534,8 +1534,8 @@  discard block
 block discarded – undo
1534 1534
     }
1535 1535
     $id = 'playbacks-'.$recording['recordID'];
1536 1536
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1537
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1538
-          'title' => $title, $visibility => $visibility));
1537
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1538
+            'title' => $title, $visibility => $visibility));
1539 1539
     foreach ($recording['playbacks'] as $playback) {
1540 1540
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bbbsession, $playback);
1541 1541
     }
@@ -1560,7 +1560,7 @@  discard block
 block discarded – undo
1560 1560
     $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1561 1561
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);';
1562 1562
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1563
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1563
+        '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1564 1564
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1565 1565
         $href .= '&href='.urlencode(trim($playback['url']));
1566 1566
     }
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
         'data-target' => $playback['type'],
1573 1573
         'data-href' => $href,
1574 1574
         'class' => 'btn btn-sm btn-default'
1575
-      );
1575
+        );
1576 1576
     return $OUTPUT->action_link('#', $title, null, $linkattributes) . ' ';
1577 1577
 }
1578 1578
 
@@ -1686,10 +1686,10 @@  discard block
 block discarded – undo
1686 1686
             'id' => $id,
1687 1687
             'onclick' => $onclick,
1688 1688
             'data-action' => $data['action']
1689
-          );
1689
+            );
1690 1690
         if (!isset($recording['imported'])) {
1691 1691
             $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(
1692
-              $recording['recordID']);
1692
+                $recording['recordID']);
1693 1693
         }
1694 1694
         if (isset($data['disabled'])) {
1695 1695
             $iconattributes['class'] .= ' fa-' . $data['disabled'];
@@ -2234,8 +2234,8 @@  discard block
 block discarded – undo
2234 2234
     $activitytime = '';
2235 2235
     if ($time) {
2236 2236
         $activitytime = calendar_day_representation($time).' '.
2237
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2238
-          calendar_time_representation($time);
2237
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2238
+            calendar_time_representation($time);
2239 2239
     }
2240 2240
     return $activitytime;
2241 2241
 }
@@ -2535,7 +2535,7 @@  discard block
 block discarded – undo
2535 2535
         $renderer->render_group_element('participant_moderator_default',
2536 2536
             $renderer->render_group_element_configmultiselect('participant_moderator_default',
2537 2537
                 array_keys($owner), array_merge($owner, $roles))
2538
-          );
2538
+            );
2539 2539
     }
2540 2540
 }
2541 2541
 
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
         return $output;
2636 2636
     }
2637 2637
     $output .= $OUTPUT->box_start('box boxalignleft adminerror alert alert-' . $type . ' alert-block fade in',
2638
-      'bigbluebuttonbn_view_general_warning') . "\n";
2638
+        'bigbluebuttonbn_view_general_warning') . "\n";
2639 2639
     $output .= '    ' . $message . "\n";
2640 2640
     $output .= '  <div class="singlebutton pull-right">' . "\n";
2641 2641
     if (!empty($href)) {
Please login to merge, or discard this patch.
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once(dirname(__FILE__).'/lib.php');
31
+require_once(dirname(__FILE__) . '/lib.php');
32 32
 
33 33
 /** @var BIGBLUEBUTTONBN_UPDATE_CACHE boolean set to true indicates that cache has to be updated */
34 34
 const BIGBLUEBUTTONBN_UPDATE_CACHE = true;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     if (isset($meta)) {
105 105
         $log->meta = $meta;
106 106
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
107
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
107
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
108 108
     }
109 109
     $DB->insert_record('bigbluebuttonbn_logs', $log);
110 110
 }
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
     $data = null;
153 153
     if (!is_null($pname) && !is_null($purl)) {
154 154
         $method = 'POST';
155
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
156
-            $purl."' /></module></modules>";
155
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
156
+            $purl . "' /></module></modules>";
157 157
     }
158 158
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
159 159
     if ($xml) {
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
         // Override imported flag with actual ID.
315 315
         $recording['imported'] = $recordimported->id;
316 316
         if (isset($recordimported->protected)) {
317
-            $recording['protected'] = (string) $recordimported->protected;
317
+            $recording['protected'] = (string)$recordimported->protected;
318 318
         }
319 319
         $recordsimportedarray[$recording['recordID']] = $recording;
320 320
     }
@@ -344,21 +344,21 @@  discard block
 block discarded – undo
344 344
     // Add formats.
345 345
     $playbackarray = array();
346 346
     foreach ($recording->playback->format as $format) {
347
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
348
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
347
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
348
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
349 349
         // Add preview per format when existing.
350 350
         if ($format->preview) {
351
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
351
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
352 352
         }
353 353
     }
354 354
     // Add the metadata to the recordings array.
355 355
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
356
-    $recordingarray = array('recordID' => (string) $recording->recordID,
357
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
358
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
359
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
356
+    $recordingarray = array('recordID' => (string)$recording->recordID,
357
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
358
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
359
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
360 360
     if (isset($recording->protected)) {
361
-        $recordingarray['protected'] = (string) $recording->protected;
361
+        $recordingarray['protected'] = (string)$recording->protected;
362 362
     }
363 363
     return $recordingarray + $metadataarray;
364 364
 }
@@ -373,9 +373,9 @@  discard block
 block discarded – undo
373 373
 function bigbluebuttonbn_get_recording_preview_images($preview) {
374 374
     $imagesarray = array();
375 375
     foreach ($preview->images->image as $image) {
376
-        $imagearray = array('url' => trim((string) $image));
376
+        $imagearray = array('url' => trim((string)$image));
377 377
         foreach ($image->attributes() as $attkey => $attvalue) {
378
-            $imagearray[$attkey] = (string) $attvalue;
378
+            $imagearray[$attkey] = (string)$attvalue;
379 379
         }
380 380
         array_push($imagesarray, $imagearray);
381 381
     }
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
         if (is_object($value)) {
396 396
             $value = '';
397 397
         }
398
-        $metadataarray['meta_'.$key] = $value;
398
+        $metadataarray['meta_' . $key] = $value;
399 399
     }
400 400
     return $metadataarray;
401 401
 }
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
     $ids = explode(',', $recordids);
468 468
     foreach ($ids as $id) {
469 469
         $xml = bigbluebuttonbn_wrap_xml_load_file(
470
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
470
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
471 471
           );
472 472
         if ($xml && $xml->returncode != 'SUCCESS') {
473 473
             return false;
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
             return $xml;
548 548
         } catch (Exception $e) {
549 549
             libxml_use_internal_errors($previous);
550
-            $error = 'Caught exception: '.$e->getMessage();
550
+            $error = 'Caught exception: ' . $e->getMessage();
551 551
             debugging($error, DEBUG_DEVELOPER);
552 552
             return null;
553 553
         }
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
559 559
         return $response;
560 560
     } catch (Exception $e) {
561
-        $error = 'Caught exception: '.$e->getMessage();
561
+        $error = 'Caught exception: ' . $e->getMessage();
562 562
         debugging($error, DEBUG_DEVELOPER);
563 563
         libxml_use_internal_errors($previous);
564 564
         return null;
@@ -585,8 +585,8 @@  discard block
 block discarded – undo
585 585
 
586 586
         $options = array();
587 587
         $options['CURLOPT_HTTPHEADER'] = array(
588
-                 'Content-Type: '.$contenttype,
589
-                 'Content-Length: '.strlen($data),
588
+                 'Content-Type: ' . $contenttype,
589
+                 'Content-Length: ' . strlen($data),
590 590
                  'Content-Language: en-US',
591 591
                );
592 592
 
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
  * @return void
604 604
  */
605 605
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
606
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
606
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
607 607
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
608 608
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
609 609
     }
@@ -623,9 +623,9 @@  discard block
 block discarded – undo
623 623
     if ($userroles) {
624 624
         $where = '';
625 625
         foreach ($userroles as $userrole) {
626
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid;
626
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid;
627 627
         }
628
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
628
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
629 629
     }
630 630
     return $userroles;
631 631
 }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
  * @return array $users
649 649
  */
650 650
 function bigbluebuttonbn_get_users(context $context = null) {
651
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
651
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
652 652
     foreach ($users as $key => $value) {
653 653
         $users[$key] = fullname($value);
654 654
     }
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
  * @return array $users
664 664
  */
665 665
 function bigbluebuttonbn_get_users_select(context $context = null) {
666
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
666
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
667 667
     foreach ($users as $key => $value) {
668 668
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
669 669
     }
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
  * @return array $roles
679 679
  */
680 680
 function bigbluebuttonbn_get_roles(context $context = null) {
681
-    $roles = (array) role_get_names($context);
681
+    $roles = (array)role_get_names($context);
682 682
     foreach ($roles as $key => $value) {
683 683
         $roles[$key] = $value->localname;
684 684
     }
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
  * @return array $users
694 694
  */
695 695
 function bigbluebuttonbn_get_roles_select(context $context = null) {
696
-    $roles = (array) role_get_names($context);
696
+    $roles = (array)role_get_names($context);
697 697
     foreach ($roles as $key => $value) {
698 698
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
699 699
     }
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
  * @return object $role
709 709
  */
710 710
 function bigbluebuttonbn_get_role($id) {
711
-    $roles = (array) role_get_names();
711
+    $roles = (array)role_get_names();
712 712
     if (is_numeric($id)) {
713 713
         return (object)$roles[$id];
714 714
     }
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
     if (!isguestuser()) {
864 864
         $userroles = bigbluebuttonbn_get_user_roles($context, $userid);
865 865
     }
866
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
866
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
867 867
 }
868 868
 
869 869
 /**
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
 function bigbluebuttonbn_generate_nonce() {
1020 1020
     $mt = microtime();
1021 1021
     $rand = mt_rand();
1022
-    return md5($mt.$rand);
1022
+    return md5($mt . $rand);
1023 1023
 }
1024 1024
 
1025 1025
 /**
@@ -1045,23 +1045,23 @@  discard block
 block discarded – undo
1045 1045
  */
1046 1046
 function bigbluebuttonbn_events() {
1047 1047
     return array(
1048
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_CREATED,
1049
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1050
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_UPDATED,
1051
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_DELETED,
1052
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1053
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1054
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1055
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1056
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1057
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1058
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1059
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1060
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1061
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1062
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1063
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED,
1064
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION
1048
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_CREATED,
1049
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1050
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_UPDATED,
1051
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_DELETED,
1052
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1053
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1054
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1055
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1056
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1057
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1058
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1059
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1060
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1061
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1062
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1063
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED,
1064
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION
1065 1065
     );
1066 1066
 }
1067 1067
 
@@ -1072,23 +1072,23 @@  discard block
 block discarded – undo
1072 1072
  */
1073 1073
 function bigbluebuttonbn_events_action() {
1074 1074
     return array(
1075
-        'create' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_CREATED,
1076
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1077
-        'update' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_UPDATED,
1078
-        'delete' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_DELETED,
1079
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1080
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1081
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1082
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1083
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1084
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1085
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1086
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1087
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1088
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1089
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1090
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED,
1091
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION
1075
+        'create' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_CREATED,
1076
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1077
+        'update' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_UPDATED,
1078
+        'delete' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_DELETED,
1079
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1080
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1081
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1082
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1083
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1084
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1085
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1086
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1087
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1088
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1089
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1090
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED,
1091
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION
1092 1092
     );
1093 1093
 }
1094 1094
 
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
     if (array_key_exists('other', $options)) {
1120 1120
         $eventproperties['other'] = $options['other'];
1121 1121
     }
1122
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1122
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
1123 1123
       array($eventproperties));
1124 1124
     $event->trigger();
1125 1125
 }
@@ -1159,10 +1159,10 @@  discard block
 block discarded – undo
1159 1159
     $now = time();
1160 1160
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1161 1161
         // Use the value in the cache.
1162
-        return (array) json_decode($result['meeting_info']);
1162
+        return (array)json_decode($result['meeting_info']);
1163 1163
     }
1164 1164
     // Ping again and refresh the cache.
1165
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1165
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1166 1166
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1167 1167
       );
1168 1168
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
  * @return object
1258 1258
  */
1259 1259
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1260
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1260
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1261 1261
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1262 1262
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST',
1263 1263
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1273,8 +1273,8 @@  discard block
 block discarded – undo
1273 1273
  * @return string
1274 1274
  */
1275 1275
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1276
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1277
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1276
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1277
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1278 1278
     return $configxmlparams;
1279 1279
 }
1280 1280
 
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
  */
1289 1289
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1290 1290
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1291
-    $configxmlarray = (array) $configxml;
1291
+    $configxmlarray = (array)$configxml;
1292 1292
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1293 1293
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1294 1294
         return '';
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
     global $USER;
1381 1381
     $starttime = $starttime - ($starttime % 1000);
1382 1382
     // Set formatted date.
1383
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1383
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1384 1384
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1385 1385
 }
1386 1386
 
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
  * @return string
1492 1492
  */
1493 1493
 function bigbluebuttonbn_get_recording_data_row_preview($recording) {
1494
-    $options = array('id' => 'preview-'.$recording['recordID'], 'class' => 'container');
1494
+    $options = array('id' => 'preview-' . $recording['recordID'], 'class' => 'container');
1495 1495
     if ($recording['published'] === 'false') {
1496 1496
         $options['hidden'] = 'hidden';
1497 1497
     }
@@ -1532,7 +1532,7 @@  discard block
 block discarded – undo
1532 1532
     if ($recording['published'] === 'false') {
1533 1533
         $visibility = 'hidden ';
1534 1534
     }
1535
-    $id = 'playbacks-'.$recording['recordID'];
1535
+    $id = 'playbacks-' . $recording['recordID'];
1536 1536
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1537 1537
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1538 1538
           'title' => $title, $visibility => $visibility));
@@ -1557,12 +1557,12 @@  discard block
 block discarded – undo
1557 1557
     if (!bigbluebuttonbn_include_recording_data_row_type($recording, $bbbsession, $playback)) {
1558 1558
         return '';
1559 1559
     }
1560
-    $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1560
+    $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1561 1561
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);';
1562 1562
     $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bbbsession['bigbluebuttonbn']->id .
1563
-      '&mid='.$recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1563
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1564 1564
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1565
-        $href .= '&href='.urlencode(trim($playback['url']));
1565
+        $href .= '&href=' . urlencode(trim($playback['url']));
1566 1566
     }
1567 1567
     $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID'];
1568 1568
     $linkattributes = array(
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
             $linkattributes['class'] = 'disabled';
1697 1697
             unset($linkattributes['onclick']);
1698 1698
         }
1699
-        $icon = new pix_icon('i/'.$data['tag'],
1699
+        $icon = new pix_icon('i/' . $data['tag'],
1700 1700
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1701 1701
             'moodle', $iconattributes);
1702 1702
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
@@ -1813,7 +1813,7 @@  discard block
 block discarded – undo
1813 1813
  */
1814 1814
 function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) {
1815 1815
     $row = new html_table_row();
1816
-    $row->id = 'recording-td-'.$recording['recordID'];
1816
+    $row->id = 'recording-td-' . $recording['recordID'];
1817 1817
     $row->attributes['data-imported'] = 'false';
1818 1818
     $texthead = '';
1819 1819
     $texttail = '';
@@ -1877,9 +1877,9 @@  discard block
 block discarded – undo
1877 1877
 function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) {
1878 1878
     $sender = get_admin();
1879 1879
     // Prepare message.
1880
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
1881
-        ' &quot;' . $bigbluebuttonbn->name . '&quot; '.
1882
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1880
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') .
1881
+        ' &quot;' . $bigbluebuttonbn->name . '&quot; ' .
1882
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1883 1883
     $context = context_course::instance($bigbluebuttonbn->course);
1884 1884
     \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext);
1885 1885
 }
@@ -2101,7 +2101,7 @@  discard block
 block discarded – undo
2101 2101
     }
2102 2102
     // Prepare select for loading records based on existent bigbluebuttonbns.
2103 2103
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
2104
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
2104
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
2105 2105
     // Include only Create events and exclude those with record not true.
2106 2106
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
2107 2107
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -2233,8 +2233,8 @@  discard block
 block discarded – undo
2233 2233
 function bigbluebuttonbn_format_activity_time($time) {
2234 2234
     $activitytime = '';
2235 2235
     if ($time) {
2236
-        $activitytime = calendar_day_representation($time).' '.
2237
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2236
+        $activitytime = calendar_day_representation($time) . ' ' .
2237
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2238 2238
           calendar_time_representation($time);
2239 2239
     }
2240 2240
     return $activitytime;
@@ -2627,7 +2627,7 @@  discard block
 block discarded – undo
2627 2627
  *
2628 2628
  * @return string
2629 2629
  */
2630
-function bigbluebuttonbn_render_warning($message, $type='info', $href='', $text='', $class='') {
2630
+function bigbluebuttonbn_render_warning($message, $type = 'info', $href = '', $text = '', $class = '') {
2631 2631
     global $OUTPUT;
2632 2632
     $output = "\n";
2633 2633
     // Evaluates if config_warning is enabled.
@@ -2666,10 +2666,10 @@  discard block
 block discarded – undo
2666 2666
     if ($class == '') {
2667 2667
         $class = 'btn btn-secondary';
2668 2668
     }
2669
-    $output  = '  <form method="post" action="' . $href . '" class="form-inline">'."\n";
2670
-    $output .= '      <button type="submit" class="' . $class . '"'."\n";
2671
-    $output .= '          title="' . $title . '"'."\n";
2672
-    $output .= '          >' . $text . '</button>'."\n";
2673
-    $output .= '  </form>'."\n";
2669
+    $output  = '  <form method="post" action="' . $href . '" class="form-inline">' . "\n";
2670
+    $output .= '      <button type="submit" class="' . $class . '"' . "\n";
2671
+    $output .= '          title="' . $title . '"' . "\n";
2672
+    $output .= '          >' . $text . '</button>' . "\n";
2673
+    $output .= '  </form>' . "\n";
2674 2674
     return $output;
2675 2675
 }
Please login to merge, or discard this patch.
bbb_broker.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -437,26 +437,26 @@  discard block
 block discarded – undo
437 437
             return array(
438 438
                 'status' => false,
439 439
                 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn')
440
-              );
440
+                );
441 441
         }
442 442
         if ($realrecordings[$params['id']]['published'] !== 'true') {
443 443
             return array(
444 444
                 'status' => false,
445 445
                 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn')
446
-              );
446
+                );
447 447
         }
448 448
         return array(
449 449
             'status' => bigbluebuttonbn_publish_recording_imported(
450 450
                 $recordings[$params['id']]['imported'], true
451 451
             )
452
-          );
452
+            );
453 453
     }
454 454
     // As the recordingid was not identified as imported recording link, execute actual publish.
455 455
     return array(
456 456
         'status' => bigbluebuttonbn_publish_recordings(
457 457
             $params['id'], 'true'
458 458
         )
459
-      );
459
+        );
460 460
 }
461 461
 
462 462
 /**
@@ -477,26 +477,26 @@  discard block
 block discarded – undo
477 477
             return array(
478 478
                 'status' => false,
479 479
                 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn')
480
-              );
480
+                );
481 481
         }
482 482
         if ($realrecordings[$params['id']]['protected'] === 'true') {
483 483
             return array(
484 484
                 'status' => false,
485 485
                 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn')
486
-              );
486
+                );
487 487
         }
488 488
         return array(
489 489
             'status' => bigbluebuttonbn_protect_recording_imported(
490 490
                 $recordings[$params['id']]['imported'], false
491 491
             )
492
-          );
492
+            );
493 493
     }
494 494
     // As the recordingid was not identified as imported recording link, execute actual uprotect.
495 495
     return array(
496 496
         'status' => bigbluebuttonbn_update_recordings(
497 497
             $params['id'], array('protect' => 'false')
498 498
         )
499
-      );
499
+        );
500 500
 }
501 501
 
502 502
 /**
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
             'status' => bigbluebuttonbn_publish_recording_imported(
516 516
                 $recordings[$params['id']]['imported'], false
517 517
             )
518
-          );
518
+            );
519 519
     }
520 520
     // As the recordingid was not identified as imported recording link, execute unpublish on a real recording.
521 521
     // First: Unpublish imported links associated to the recording.
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
         'status' => bigbluebuttonbn_publish_recordings(
534 534
             $params['id'], 'false'
535 535
         )
536
-      );
536
+        );
537 537
 }
538 538
 
539 539
 /**
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
             'status' => bigbluebuttonbn_protect_recording_imported(
553 553
                 $recordings[$params['id']]['imported'], true
554 554
             )
555
-          );
555
+            );
556 556
     }
557 557
     // As the recordingid was not identified as imported recording link, execute protect on a real recording.
558 558
     // First: Protect imported links associated to the recording.
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
         'status' => bigbluebuttonbn_update_recordings(
571 571
             $params['id'], array('protect' => 'true')
572 572
         )
573
-      );
573
+        );
574 574
 }
575 575
 
576 576
 /**
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
             'status' => bigbluebuttonbn_delete_recording_imported(
590 590
                 $recordings[$params['id']]['imported']
591 591
             )
592
-          );
592
+            );
593 593
     }
594 594
     // As the recordingid was not identified as imported recording link, execute delete on a real recording.
595 595
     // First: Delete imported links associated to the recording.
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
     // Second: Execute the actual delete.
604 604
     return array(
605 605
         'status' => bigbluebuttonbn_delete_recordings($params['id'])
606
-      );
606
+        );
607 607
 }
608 608
 
609 609
 /**
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
             'status' => bigbluebuttonbn_update_recording_imported(
622 622
                 $recordings[$params['id']]['imported'], json_decode($params['meta'], true)
623 623
             )
624
-          );
624
+            );
625 625
     }
626 626
 
627 627
     // As the recordingid was not identified as imported recording link, execute update on a real recording.
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
         'status' => bigbluebuttonbn_update_recordings(
632 632
             $params['id'], json_decode($params['meta'])
633 633
         )
634
-      );
634
+        );
635 635
 }
636 636
 
637 637
 /**
@@ -802,10 +802,10 @@  discard block
 block discarded – undo
802 802
     $params['recording_import'] = ['id' => 'The recordingID must be specified.'];
803 803
     $params['recording_ready'] = [
804 804
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
805
-          ];
805
+            ];
806 806
     $params['live_session_events'] = [
807 807
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
808
-          ];
808
+            ];
809 809
     return $params;
810 810
 }
811 811
 
Please login to merge, or discard this patch.
classes/settings/validator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 defined('MOODLE_INTERNAL') || die();
29 29
 
30 30
 require_once($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
31
-require_once($CFG->libdir.'/adminlib.php');
31
+require_once($CFG->libdir . '/adminlib.php');
32 32
 
33 33
 /**
34 34
  * Helper class for validating settings used HTML for settings.php.
Please login to merge, or discard this patch.
view.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -444,12 +444,12 @@  discard block
 block discarded – undo
444 444
     $recordings = bigbluebuttonbn_get_recordings(
445 445
         $bbbsession['course']->id, $bigbluebuttonbnid, $enabledfeatures['showroom'],
446 446
         $bbbsession['bigbluebuttonbn']->recordings_deleted
447
-      );
447
+        );
448 448
     if ($enabledfeatures['importrecordings']) {
449 449
         // Get recording links.
450 450
         $recordingsimported = bigbluebuttonbn_get_recordings_imported_array(
451 451
             $bbbsession['course']->id, $bigbluebuttonbnid, $enabledfeatures['showroom']
452
-          );
452
+            );
453 453
         /* Perform aritmetic addition instead of merge so the imported recordings corresponding to existent
454 454
          * recordings are not included. */
455 455
         $recordings += $recordingsimported;
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
     // JavaScript variables for recordings.
464 464
     $jsvars += array(
465 465
             'recordings_html' => $bbbsession['bigbluebuttonbn']->recordings_html == '1',
466
-          );
466
+            );
467 467
     // If there are meetings with recordings load the data to the table.
468 468
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
469 469
         // Render a plain html table.
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
     $jsvars += array(
474 474
             'columns' => bigbluebuttonbn_get_recording_columns($bbbsession),
475 475
             'data' => bigbluebuttonbn_get_recording_data($bbbsession, $recordings),
476
-          );
476
+            );
477 477
     // Render a YUI table.
478 478
     return html_writer::div('', '', array('id' => 'bigbluebuttonbn_recordings_table'));
479 479
 }
@@ -493,10 +493,10 @@  discard block
 block discarded – undo
493 493
     }
494 494
     $button = html_writer::tag('input', '',
495 495
         array('type' => 'button',
496
-              'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
497
-              'class' => 'btn btn-secondary',
498
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
499
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
496
+                'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
497
+                'class' => 'btn btn-secondary',
498
+                'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
499
+                    $bbbsession['bigbluebuttonbn']->id.'\''));
500 500
     $output  = html_writer::empty_tag('br');
501 501
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
502 502
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
  * @author    Fred Dixon  (ffdixon [at] blindsidenetworks [dt] com)
25 25
  */
26 26
 
27
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
28
-require_once(dirname(__FILE__).'/locallib.php');
27
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
28
+require_once(dirname(__FILE__) . '/locallib.php');
29 29
 
30 30
 $id = required_param('id', PARAM_INT);
31 31
 $bn = optional_param('n', 0, PARAM_INT);
@@ -60,19 +60,19 @@  discard block
 block discarded – undo
60 60
 if (is_null($serverversion)) {
61 61
     if ($bbbsession['administrator']) {
62 62
         print_error('view_error_unable_join', 'bigbluebuttonbn',
63
-            $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
63
+            $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
64 64
         exit;
65 65
     }
66 66
     if ($bbbsession['moderator']) {
67 67
         print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
68
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
68
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
69 69
         exit;
70 70
     }
71 71
     print_error('view_error_unable_join_student', 'bigbluebuttonbn',
72
-        $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
72
+        $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
73 73
     exit;
74 74
 }
75
-$bbbsession['serverversion'] = (string) $serverversion;
75
+$bbbsession['serverversion'] = (string)$serverversion;
76 76
 
77 77
 // Mark viewed by user (if required).
78 78
 $completion = new completion_info($course);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 // Print the page header.
82 82
 $PAGE->set_context($context);
83
-$PAGE->set_url($CFG->wwwroot.'/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
83
+$PAGE->set_url($CFG->wwwroot . '/mod/bigbluebuttonbn/view.php', array('id' => $cm->id));
84 84
 $PAGE->set_title(format_string($bigbluebuttonbn->name));
85 85
 $PAGE->set_cacheable(false);
86 86
 $PAGE->set_heading($course->fullname);
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 if (!has_capability('moodle/category:manage', $context) && !has_capability('mod/bigbluebuttonbn:join', $context)) {
91 91
     echo $OUTPUT->header();
92 92
     if (isguestuser()) {
93
-        echo $OUTPUT->confirm('<p>'.get_string('view_noguests', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
94
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
93
+        echo $OUTPUT->confirm('<p>' . get_string('view_noguests', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
94
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
95 95
     } else {
96
-        echo $OUTPUT->confirm('<p>'.get_string('view_nojoin', 'bigbluebuttonbn').'</p>'.get_string('liketologin'),
97
-            get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
96
+        echo $OUTPUT->confirm('<p>' . get_string('view_nojoin', 'bigbluebuttonbn') . '</p>' . get_string('liketologin'),
97
+            get_login_url(), $CFG->wwwroot . '/course/view.php?id=' . $course->id);
98 98
     }
99 99
     echo $OUTPUT->footer();
100 100
     exit;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 // Operation URLs.
104 104
 $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
105
-$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .
105
+$bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
106 106
     '&bn=' . $bbbsession['bigbluebuttonbn']->id;
107 107
 $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
108 108
     'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 echo $OUTPUT->footer();
123 123
 
124 124
 // Shows version as a comment.
125
-echo '<!-- '.$bbbsession['originTag'].' -->'."\n";
125
+echo '<!-- ' . $bbbsession['originTag'] . ' -->' . "\n";
126 126
 
127 127
 // Initialize session variable used across views.
128 128
 $SESSION->bigbluebuttonbn_bbbsession = $bbbsession;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     $bbbsession['modPW'] = $bbbsession['bigbluebuttonbn']->moderatorpass;
152 152
     $bbbsession['viewerPW'] = $bbbsession['bigbluebuttonbn']->viewerpass;
153 153
     // Database info related to the activity.
154
-    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid.'-'.$bbbsession['course']->id.'-'.
154
+    $bbbsession['meetingid'] = $bbbsession['bigbluebuttonbn']->meetingid . '-' . $bbbsession['course']->id . '-' .
155 155
         $bbbsession['bigbluebuttonbn']->id;
156 156
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
157 157
     $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn');
172 172
     }
173 173
     if ($bbbsession['bigbluebuttonbn']->record) {
174
-        $bbbsession['welcome'] .= '<br><br>'.get_string('bbbrecordwarning', 'bigbluebuttonbn');
174
+        $bbbsession['welcome'] .= '<br><br>' . get_string('bbbrecordwarning', 'bigbluebuttonbn');
175 175
     }
176 176
     $bbbsession['openingtime'] = $bbbsession['bigbluebuttonbn']->openingtime;
177 177
     $bbbsession['closingtime'] = $bbbsession['bigbluebuttonbn']->closingtime;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     $bbbsession['originServerName'] = $parsedurl['host'];
185 185
     $bbbsession['originServerUrl'] = $CFG->wwwroot;
186 186
     $bbbsession['originServerCommonName'] = '';
187
-    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn ('.get_config('mod_bigbluebuttonbn', 'version').')';
187
+    $bbbsession['originTag'] = 'moodle-mod_bigbluebuttonbn (' . get_config('mod_bigbluebuttonbn', 'version') . ')';
188 188
     $bbbsession['bnserver'] = bigbluebuttonbn_is_bn_server();
189 189
 }
190 190
 
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
         $groupname = groups_get_group_name($bbbsession['group']);
243 243
     }
244 244
     // Assign group default values.
245
-    $bbbsession['meetingid'] .= '['.$bbbsession['group'].']';
246
-    $bbbsession['meetingname'] .= ' ('.$groupname.')';
245
+    $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']';
246
+    $bbbsession['meetingname'] .= ' (' . $groupname . ')';
247 247
     if (count($groups) == 0) {
248 248
         // Only the All participants group exists.
249 249
         bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_notenrolled_warning', 'bigbluebuttonbn'), 'info');
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         return;
255 255
     }
256 256
     bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'));
257
-    $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id;
257
+    $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
258 258
     groups_print_activity_menu($bbbsession['cm'], $urltoroot);
259 259
     echo '<br><br>';
260 260
 }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
         'locale' => bigbluebuttonbn_get_localcode(), 'profile_features' => $typeprofiles[0]['features']);
302 302
     // Renders general warning when configured.
303 303
     $cfg = \mod_bigbluebuttonbn\locallib\config::get_options();
304
-    $output  = '';
304
+    $output = '';
305 305
     if (bigbluebuttonbn_view_warning_shown($bbbsession)) {
306 306
         $output .= bigbluebuttonbn_render_warning(
307 307
             (string)$cfg['general_warning_message'],
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         $recordingsdisabled = get_string('view_message_recordings_disabled', 'bigbluebuttonbn');
328 328
         $output .= bigbluebuttonbn_render_warning($recordingsdisabled, 'danger');
329 329
     }
330
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
330
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
331 331
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
332 332
 }
333 333
 
@@ -396,12 +396,12 @@  discard block
 block discarded – undo
396 396
     // JavaScript variables for room.
397 397
     $openingtime = '';
398 398
     if ($bbbsession['openingtime']) {
399
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
399
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
400 400
             userdate($bbbsession['openingtime']);
401 401
     }
402 402
     $closingtime = '';
403 403
     if ($bbbsession['closingtime']) {
404
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
404
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
405 405
             userdate($bbbsession['closingtime']);
406 406
     }
407 407
     $jsvars += array(
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
     $output .= $OUTPUT->box_end();
419 419
     // Action button box.
420 420
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
421
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
421
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
422 422
     $output .= $OUTPUT->box_end();
423 423
     if ($activity == 'ended') {
424 424
         $output .= bigbluebuttonbn_view_ended($bbbsession);
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
     // If there are meetings with recordings load the data to the table.
468 468
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
469 469
         // Render a plain html table.
470
-        return bigbluebuttonbn_output_recording_table($bbbsession, $recordings)."\n";
470
+        return bigbluebuttonbn_output_recording_table($bbbsession, $recordings) . "\n";
471 471
     }
472 472
     // JavaScript variables for recordings with YUI.
473 473
     $jsvars += array(
@@ -495,8 +495,8 @@  discard block
 block discarded – undo
495 495
         array('type' => 'button',
496 496
               'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
497 497
               'class' => 'btn btn-secondary',
498
-              'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
499
-                  $bbbsession['bigbluebuttonbn']->id.'\''));
498
+              'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
499
+                  $bbbsession['bigbluebuttonbn']->id . '\''));
500 500
     $output  = html_writer::empty_tag('br');
501 501
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
502 502
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -515,10 +515,10 @@  discard block
 block discarded – undo
515 515
     if (!is_null($bbbsession['presentation']['url'])) {
516 516
         $attributes = array('title' => $bbbsession['presentation']['name']);
517 517
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
518
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
519
-                $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).
518
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
519
+                $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) .
520 520
                 $OUTPUT->action_link($bbbsession['presentation']['url'],
521
-                $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
521
+                $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
522 522
     }
523 523
     return '';
524 524
 }
Please login to merge, or discard this patch.
lib.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  * Remove this block when restored
62 62
  */
63 63
 
64
- /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */
64
+    /** @var BIGBLUEBUTTONBN_DEFAULT_SERVER_URL string of default bigbluebutton server url */
65 65
 const BIGBLUEBUTTONBN_DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/';
66 66
 /** @var BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET string of default bigbluebutton server shared secret */
67 67
 const BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6';
@@ -338,12 +338,12 @@  discard block
 block discarded – undo
338 338
     $str  = '<div class="bigbluebuttonbn overview">'."\n";
339 339
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
340 340
     $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
341
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
341
+        '">'.$bigbluebuttonbn->name.'</a>'."\n";
342 342
     $str .= '  </div>'."\n";
343 343
     $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
344 344
         '</div>'."\n";
345 345
     $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
346
-      .'</div>'."\n";
346
+        .'</div>'."\n";
347 347
     $str .= '</div>'."\n";
348 348
     return $str;
349 349
 }
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
  * @return \core_calendar\local\event\entities\action_interface|null
727 727
  */
728 728
 function mod_bigbluebuttonbn_core_calendar_provide_event_action(calendar_event $event,
729
-                                                       \core_calendar\action_factory $factory) {
729
+                                                        \core_calendar\action_factory $factory) {
730 730
     $cm = get_fast_modinfo($event->courseid)->instances['bigbluebuttonbn'][$event->instance];
731 731
 
732 732
     $completion = new \completion_info($cm->get_course());
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -28,29 +28,29 @@  discard block
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once($CFG->dirroot.'/calendar/lib.php');
32
-require_once($CFG->dirroot.'/message/lib.php');
33
-require_once($CFG->dirroot.'/mod/lti/OAuth.php');
34
-require_once($CFG->dirroot.'/tag/lib.php');
35
-require_once($CFG->libdir.'/accesslib.php');
36
-require_once($CFG->libdir.'/completionlib.php');
37
-require_once($CFG->libdir.'/datalib.php');
38
-require_once($CFG->libdir.'/coursecatlib.php');
39
-require_once($CFG->libdir.'/enrollib.php');
40
-require_once($CFG->libdir.'/filelib.php');
41
-require_once($CFG->libdir.'/formslib.php');
31
+require_once($CFG->dirroot . '/calendar/lib.php');
32
+require_once($CFG->dirroot . '/message/lib.php');
33
+require_once($CFG->dirroot . '/mod/lti/OAuth.php');
34
+require_once($CFG->dirroot . '/tag/lib.php');
35
+require_once($CFG->libdir . '/accesslib.php');
36
+require_once($CFG->libdir . '/completionlib.php');
37
+require_once($CFG->libdir . '/datalib.php');
38
+require_once($CFG->libdir . '/coursecatlib.php');
39
+require_once($CFG->libdir . '/enrollib.php');
40
+require_once($CFG->libdir . '/filelib.php');
41
+require_once($CFG->libdir . '/formslib.php');
42 42
 
43 43
 
44
-if (file_exists(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php')) {
45
-    require_once(dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php');
44
+if (file_exists(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php')) {
45
+    require_once(dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php');
46 46
 }
47 47
 
48 48
 if (!isset($CFG->bigbluebuttonbn)) {
49 49
     $CFG->bigbluebuttonbn = array();
50 50
 }
51 51
 
52
-if (file_exists(dirname(__FILE__).'/config.php')) {
53
-    require_once(dirname(__FILE__).'/config.php');
52
+if (file_exists(dirname(__FILE__) . '/config.php')) {
53
+    require_once(dirname(__FILE__) . '/config.php');
54 54
 }
55 55
 
56 56
 /*
@@ -97,18 +97,18 @@  discard block
 block discarded – undo
97 97
         return null;
98 98
     }
99 99
     $features = array(
100
-        (string) FEATURE_IDNUMBER => true,
101
-        (string) FEATURE_GROUPS => true,
102
-        (string) FEATURE_GROUPINGS => true,
103
-        (string) FEATURE_GROUPMEMBERSONLY => true,
104
-        (string) FEATURE_MOD_INTRO => true,
105
-        (string) FEATURE_BACKUP_MOODLE2 => true,
106
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
107
-        (string) FEATURE_GRADE_HAS_GRADE => false,
108
-        (string) FEATURE_GRADE_OUTCOMES => false,
109
-        (string) FEATURE_SHOW_DESCRIPTION => true,
100
+        (string)FEATURE_IDNUMBER => true,
101
+        (string)FEATURE_GROUPS => true,
102
+        (string)FEATURE_GROUPINGS => true,
103
+        (string)FEATURE_GROUPMEMBERSONLY => true,
104
+        (string)FEATURE_MOD_INTRO => true,
105
+        (string)FEATURE_BACKUP_MOODLE2 => true,
106
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
107
+        (string)FEATURE_GRADE_HAS_GRADE => false,
108
+        (string)FEATURE_GRADE_OUTCOMES => false,
109
+        (string)FEATURE_SHOW_DESCRIPTION => true,
110 110
     );
111
-    if (isset($features[(string) $feature])) {
111
+    if (isset($features[(string)$feature])) {
112 112
         return $features[$feature];
113 113
     }
114 114
     return null;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     $log->timecreated = time();
209 209
     $log->log = BIGBLUEBUTTONBN_LOG_EVENT_DELETE;
210 210
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
211
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
211
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
212 212
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
213 213
     $log->meta = "{\"has_recordings\":false}";
214 214
     if (!empty($logs)) {
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
238 238
     global $DB;
239 239
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
240
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*');
240
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*');
241 241
     if ($completed > 0) {
242
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
243
-            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
242
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
243
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
244 244
             get_string('view_message_times', 'bigbluebuttonbn');
245 245
     }
246 246
     return '';
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) {
261 261
     global $DB;
262 262
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
263
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ),
263
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',),
264 264
         '*', IGNORE_MULTIPLE);
265 265
     return $completed > 0;
266 266
 }
@@ -335,16 +335,16 @@  discard block
 block discarded – undo
335 335
     if ($bigbluebuttonbn->visible) {
336 336
         $classes = 'class="dimmed" ';
337 337
     }
338
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
339
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
340
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
341
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
342
-    $str .= '  </div>'."\n";
343
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
344
-        '</div>'."\n";
345
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
346
-      .'</div>'."\n";
347
-    $str .= '</div>'."\n";
338
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
339
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
340
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
341
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
342
+    $str .= '  </div>' . "\n";
343
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
344
+        '</div>' . "\n";
345
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
346
+      .'</div>' . "\n";
347
+    $str .= '</div>' . "\n";
348 348
     return $str;
349 349
 }
350 350
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
     if (count($files) == 1) {
545 545
         // Get the first (and only) file.
546 546
         $file = reset($files);
547
-        $filesrc = '/'.$file->get_filename();
547
+        $filesrc = '/' . $file->get_filename();
548 548
     }
549 549
     return $filesrc;
550 550
 }
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
     if (!$filename) {
613 613
         return false;
614 614
     }
615
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
615
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
616 616
     $fs = get_file_storage();
617 617
     $file = $fs->get_file_by_hash(sha1($fullpath));
618 618
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.