Completed
Push — master ( 570efc...69989d )
by Jesus
02:17
created
locallib.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function bigbluebuttonbn_get_join_url($meetingid, $username, $pw, $logouturl, $configtoken = null, $userid = null) {
121 121
     $data = ['meetingID' => $meetingid,
122
-              'fullName' => $username,
123
-              'password' => $pw,
124
-              'logoutURL' => $logouturl,
122
+                'fullName' => $username,
123
+                'password' => $pw,
124
+                'logoutURL' => $logouturl,
125 125
             ];
126 126
     if (!is_null($configtoken)) {
127 127
         $data['configToken'] = $configtoken;
@@ -173,23 +173,23 @@  discard block
 block discarded – undo
173 173
 function bigbluebuttonbn_get_meeting_info_array($meetingid) {
174 174
     $xml = bigbluebuttonbn_wrap_xml_load_file(
175 175
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
176
-      );
176
+        );
177 177
     if ($xml && $xml->returncode == 'SUCCESS' && empty($xml->messageKey)) {
178 178
         // Meeting info was returned.
179 179
         return array('returncode' => $xml->returncode,
180
-                     'meetingID' => $xml->meetingID,
181
-                     'moderatorPW' => $xml->moderatorPW,
182
-                     'attendeePW' => $xml->attendeePW,
183
-                     'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
184
-                     'running' => $xml->running,
185
-                     'recording' => $xml->recording,
186
-                     'startTime' => $xml->startTime,
187
-                     'endTime' => $xml->endTime,
188
-                     'participantCount' => $xml->participantCount,
189
-                     'moderatorCount' => $xml->moderatorCount,
190
-                     'attendees' => $xml->attendees,
191
-                     'metadata' => $xml->metadata,
192
-                   );
180
+                        'meetingID' => $xml->meetingID,
181
+                        'moderatorPW' => $xml->moderatorPW,
182
+                        'attendeePW' => $xml->attendeePW,
183
+                        'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded,
184
+                        'running' => $xml->running,
185
+                        'recording' => $xml->recording,
186
+                        'startTime' => $xml->startTime,
187
+                        'endTime' => $xml->endTime,
188
+                        'participantCount' => $xml->participantCount,
189
+                        'moderatorCount' => $xml->moderatorCount,
190
+                        'attendees' => $xml->attendees,
191
+                        'metadata' => $xml->metadata,
192
+                    );
193 193
     }
194 194
     if ($xml) {
195 195
         // Either failure or success without meeting info.
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 function bigbluebuttonbn_get_default_config_xml() {
326 326
     $xml = bigbluebuttonbn_wrap_xml_load_file(
327 327
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getDefaultConfigXML')
328
-      );
328
+        );
329 329
     return $xml;
330 330
 }
331 331
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
     foreach ($ids as $id) {
416 416
         $xml = bigbluebuttonbn_wrap_xml_load_file(
417 417
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
418
-          );
418
+            );
419 419
         if ($xml && $xml->returncode != 'SUCCESS') {
420 420
             return false;
421 421
         }
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
     foreach ($ids as $id) {
435 435
         $xml = bigbluebuttonbn_wrap_xml_load_file(
436 436
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
437
-          );
437
+            );
438 438
         if ($xml && $xml->returncode != 'SUCCESS') {
439 439
             return false;
440 440
         }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
     foreach ($ids as $id) {
454 454
         $xml = bigbluebuttonbn_wrap_xml_load_file(
455 455
             \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
456
-          );
456
+            );
457 457
         if ($xml && $xml->returncode != 'SUCCESS') {
458 458
             return false;
459 459
         }
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 function bigbluebuttonbn_end_meeting($meetingid, $modpw) {
471 471
     $xml = bigbluebuttonbn_wrap_xml_load_file(
472 472
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
473
-      );
473
+        );
474 474
     if ($xml) {
475 475
         // If the xml packet returned failure it displays the message to the user.
476 476
         return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
      */
491 491
     $xml = bigbluebuttonbn_wrap_xml_load_file(
492 492
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
493
-      );
493
+        );
494 494
     return ($xml && $xml->returncode == 'SUCCESS');
495 495
 }
496 496
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 function bigbluebuttonbn_get_server_version() {
503 503
     $xml = bigbluebuttonbn_wrap_xml_load_file(
504 504
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url()
505
-      );
505
+        );
506 506
     if ($xml && $xml->returncode == 'SUCCESS') {
507 507
         return $xml->version;
508 508
     }
@@ -570,10 +570,10 @@  discard block
 block discarded – undo
570 570
 
571 571
         $options = array();
572 572
         $options['CURLOPT_HTTPHEADER'] = array(
573
-                 'Content-Type: '.$contenttype,
574
-                 'Content-Length: '.strlen($data),
575
-                 'Content-Language: en-US',
576
-               );
573
+                    'Content-Type: '.$contenttype,
574
+                    'Content-Length: '.strlen($data),
575
+                    'Content-Language: en-US',
576
+                );
577 577
 
578 578
         return $c->post($url, $data, $options);
579 579
     }
@@ -716,16 +716,16 @@  discard block
 block discarded – undo
716 716
         'all' => array(
717 717
             'name' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
718 718
             'children' => []
719
-          )
720
-      );
719
+            )
720
+        );
721 721
     $data['role'] = array(
722 722
         'name' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
723 723
         'children' => bigbluebuttonbn_get_roles_select($context)
724
-      );
724
+        );
725 725
     $data['user'] = array(
726 726
         'name' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
727 727
         'children' => bigbluebuttonbn_get_users_select($context)
728
-      );
728
+        );
729 729
     return $data;
730 730
 }
731 731
 
@@ -770,9 +770,9 @@  discard block
 block discarded – undo
770 770
             continue;
771 771
         }
772 772
         $participantlistarray[] = array(
773
-              'selectiontype' => 'role',
774
-              'selectionid' => $moderatordefault,
775
-              'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
773
+                'selectiontype' => 'role',
774
+                'selectionid' => $moderatordefault,
775
+                'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
776 776
     }
777 777
     return $participantlistarray;
778 778
 }
@@ -815,11 +815,11 @@  discard block
 block discarded – undo
815 815
             'all' => get_string('mod_form_field_participant_list_type_all', 'bigbluebuttonbn'),
816 816
             'role' => get_string('mod_form_field_participant_list_type_role', 'bigbluebuttonbn'),
817 817
             'user' => get_string('mod_form_field_participant_list_type_user', 'bigbluebuttonbn'),
818
-          ],
818
+            ],
819 819
         'type_selected' => 'all',
820 820
         'options' => ['all' => '---------------'],
821 821
         'selected' => 'all',
822
-      ];
822
+        ];
823 823
 }
824 824
 
825 825
 /**
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
         $eventproperties['other'] = $options['other'];
1097 1097
     }
1098 1098
     $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1099
-      array($eventproperties));
1099
+        array($eventproperties));
1100 1100
     $event->trigger();
1101 1101
 }
1102 1102
 
@@ -1140,7 +1140,7 @@  discard block
 block discarded – undo
1140 1140
     // Ping again and refresh the cache.
1141 1141
     $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1142 1142
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1143
-      );
1143
+        );
1144 1144
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
1145 1145
     return $meetinginfo;
1146 1146
 }
@@ -1510,8 +1510,8 @@  discard block
 block discarded – undo
1510 1510
     }
1511 1511
     $id = 'playbacks-'.$recording['recordID'];
1512 1512
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1513
-          'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1514
-          'title' => $title, $visibility => $visibility));
1513
+            'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1514
+            'title' => $title, $visibility => $visibility));
1515 1515
     foreach ($recording['playbacks'] as $playback) {
1516 1516
         $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback).' ';
1517 1517
     }
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
     $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1534 1534
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);';
1535 1535
     $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid.
1536
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1536
+        '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1537 1537
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1538 1538
         $href .= '&href='.urlencode(trim($playback['url']));
1539 1539
     }
@@ -1545,7 +1545,7 @@  discard block
 block discarded – undo
1545 1545
         'data-target' => $playback['type'],
1546 1546
         'data-href' => $href,
1547 1547
         'class' => 'btn btn-sm btn-default'
1548
-      );
1548
+        );
1549 1549
     return $OUTPUT->action_link('#', $title, null, $linkattributes);
1550 1550
 }
1551 1551
 
@@ -1659,10 +1659,10 @@  discard block
 block discarded – undo
1659 1659
             'id' => $id,
1660 1660
             'onclick' => $onclick,
1661 1661
             'data-action' => $data['action']
1662
-          );
1662
+            );
1663 1663
         if (!isset($recording['imported'])) {
1664 1664
             $linkattributes['data-links'] = bigbluebuttonbn_count_recording_imported_instances(
1665
-              $recording['recordID']);
1665
+                $recording['recordID']);
1666 1666
         }
1667 1667
         if (isset($data['disabled'])) {
1668 1668
             $iconattributes['class'] .= ' fa-' . $data['disabled'];
@@ -2200,8 +2200,8 @@  discard block
 block discarded – undo
2200 2200
     $activitytime = '';
2201 2201
     if ($time) {
2202 2202
         $activitytime = calendar_day_representation($time).' '.
2203
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2204
-          calendar_time_representation($time);
2203
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2204
+            calendar_time_representation($time);
2205 2205
     }
2206 2206
     return $activitytime;
2207 2207
 }
@@ -2486,7 +2486,7 @@  discard block
 block discarded – undo
2486 2486
         $renderer->render_group_element('participant_moderator_default',
2487 2487
             $renderer->render_group_element_configmultiselect('participant_moderator_default',
2488 2488
                 array_keys($owner), array_merge($owner, $roles))
2489
-          );
2489
+            );
2490 2490
     }
2491 2491
 }
2492 2492
 
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 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;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     if (isset($meta)) {
101 101
         $log->meta = $meta;
102 102
     } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
103
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
103
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
104 104
     }
105 105
     $DB->insert_record('bigbluebuttonbn_logs', $log);
106 106
 }
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
     $data = null;
149 149
     if (!is_null($pname) && !is_null($purl)) {
150 150
         $method = 'POST';
151
-        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".
152
-            $purl."' /></module></modules>";
151
+        $data = "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" .
152
+            $purl . "' /></module></modules>";
153 153
     }
154 154
     $xml = bigbluebuttonbn_wrap_xml_load_file($createmeetingurl, $method, $data);
155 155
     if ($xml) {
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
         // Override imported flag with actual ID.
311 311
         $recording['imported'] = $recordimported->id;
312 312
         if (isset($recordimported->protected)) {
313
-            $recording['protected'] = (string) $recordimported->protected;
313
+            $recording['protected'] = (string)$recordimported->protected;
314 314
         }
315 315
         $recordsimportedarray[$recording['recordID']] = $recording;
316 316
     }
@@ -340,29 +340,29 @@  discard block
 block discarded – undo
340 340
     // Add formats.
341 341
     $playbackarray = array();
342 342
     foreach ($recording->playback->format as $format) {
343
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
344
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
343
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
344
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
345 345
         // Add preview per format when existing.
346 346
         if ($format->preview) {
347 347
             $imagesarray = array();
348 348
             foreach ($format->preview->images->image as $image) {
349
-                $imagearray = array('url' => trim((string) $image));
349
+                $imagearray = array('url' => trim((string)$image));
350 350
                 foreach ($image->attributes() as $attkey => $attvalue) {
351
-                    $imagearray[$attkey] = (string) $attvalue;
351
+                    $imagearray[$attkey] = (string)$attvalue;
352 352
                 }
353 353
                 array_push($imagesarray, $imagearray);
354 354
             }
355
-            $playbackarray[(string) $format->type]['preview'] = $imagesarray;
355
+            $playbackarray[(string)$format->type]['preview'] = $imagesarray;
356 356
         }
357 357
     }
358 358
     // Add the metadata to the recordings array.
359 359
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
360
-    $recordingarray = array('recordID' => (string) $recording->recordID,
361
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
362
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
363
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
360
+    $recordingarray = array('recordID' => (string)$recording->recordID,
361
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
362
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
363
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
364 364
     if (isset($recording->protected)) {
365
-        $recordingarray['protected'] = (string) $recording->protected;
365
+        $recordingarray['protected'] = (string)$recording->protected;
366 366
     }
367 367
     return $recordingarray + $metadataarray;
368 368
 }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         if (is_object($value)) {
381 381
             $value = '';
382 382
         }
383
-        $metadataarray['meta_'.$key] = $value;
383
+        $metadataarray['meta_' . $key] = $value;
384 384
     }
385 385
     return $metadataarray;
386 386
 }
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
     $ids = explode(',', $recordids);
453 453
     foreach ($ids as $id) {
454 454
         $xml = bigbluebuttonbn_wrap_xml_load_file(
455
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
455
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
456 456
           );
457 457
         if ($xml && $xml->returncode != 'SUCCESS') {
458 458
             return false;
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
             return $xml;
533 533
         } catch (Exception $e) {
534 534
             libxml_use_internal_errors($previous);
535
-            $error = 'Caught exception: '.$e->getMessage();
535
+            $error = 'Caught exception: ' . $e->getMessage();
536 536
             debugging($error, DEBUG_DEVELOPER);
537 537
             return null;
538 538
         }
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
         $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
544 544
         return $response;
545 545
     } catch (Exception $e) {
546
-        $error = 'Caught exception: '.$e->getMessage();
546
+        $error = 'Caught exception: ' . $e->getMessage();
547 547
         debugging($error, DEBUG_DEVELOPER);
548 548
         libxml_use_internal_errors($previous);
549 549
         return null;
@@ -570,8 +570,8 @@  discard block
 block discarded – undo
570 570
 
571 571
         $options = array();
572 572
         $options['CURLOPT_HTTPHEADER'] = array(
573
-                 'Content-Type: '.$contenttype,
574
-                 'Content-Length: '.strlen($data),
573
+                 'Content-Type: ' . $contenttype,
574
+                 'Content-Length: ' . strlen($data),
575 575
                  'Content-Language: en-US',
576 576
                );
577 577
 
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
  * @return void
589 589
  */
590 590
 function bigbluebuttonbn_end_meeting_if_running($bigbluebuttonbn) {
591
-    $meetingid = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
591
+    $meetingid = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
592 592
     if (bigbluebuttonbn_is_meeting_running($meetingid)) {
593 593
         bigbluebuttonbn_end_meeting($meetingid, $bigbluebuttonbn->moderatorpass);
594 594
     }
@@ -608,9 +608,9 @@  discard block
 block discarded – undo
608 608
     if ($userroles) {
609 609
         $where = '';
610 610
         foreach ($userroles as $userrole) {
611
-            $where .= (empty($where) ? ' WHERE' : ' OR').' id=' . $userrole->roleid;
611
+            $where .= (empty($where) ? ' WHERE' : ' OR') . ' id=' . $userrole->roleid;
612 612
         }
613
-        $userroles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
613
+        $userroles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
614 614
     }
615 615
     return $userroles;
616 616
 }
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
  * @return array $users
634 634
  */
635 635
 function bigbluebuttonbn_get_users(context $context = null) {
636
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
636
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
637 637
     foreach ($users as $key => $value) {
638 638
         $users[$key] = fullname($value);
639 639
     }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
  * @return array $users
649 649
  */
650 650
 function bigbluebuttonbn_get_users_select(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] = array('id' => $value->id, 'name' => fullname($value));
654 654
     }
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
  * @return array $roles
664 664
  */
665 665
 function bigbluebuttonbn_get_roles(context $context = null) {
666
-    $roles = (array) role_get_names($context);
666
+    $roles = (array)role_get_names($context);
667 667
     foreach ($roles as $key => $value) {
668 668
         $roles[$key] = $value->localname;
669 669
     }
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
  * @return array $users
679 679
  */
680 680
 function bigbluebuttonbn_get_roles_select(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] = array('id' => $value->id, 'name' => $value->localname);
684 684
     }
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
  * @return object $role
694 694
  */
695 695
 function bigbluebuttonbn_get_role($id) {
696
-    $roles = (array) role_get_names();
696
+    $roles = (array)role_get_names();
697 697
     if (is_numeric($id)) {
698 698
         return (object)$roles[$id];
699 699
     }
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
     if (empty($userroles)) {
849 849
         $userroles = get_user_roles($context, $userid, true);
850 850
     }
851
-    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid , $userroles);
851
+    return bigbluebuttonbn_is_moderator_validator($participantlist, $userid, $userroles);
852 852
 }
853 853
 
854 854
 /**
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 function bigbluebuttonbn_generate_nonce() {
1000 1000
     $mt = microtime();
1001 1001
     $rand = mt_rand();
1002
-    return md5($mt.$rand);
1002
+    return md5($mt . $rand);
1003 1003
 }
1004 1004
 
1005 1005
 /**
@@ -1025,21 +1025,21 @@  discard block
 block discarded – undo
1025 1025
  */
1026 1026
 function bigbluebuttonbn_events() {
1027 1027
     return array(
1028
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1029
-        (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1030
-        (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1031
-        (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1032
-        (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1033
-        (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1034
-        (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1035
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1036
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1037
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1038
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1039
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1040
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1041
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1042
-        (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1028
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1029
+        (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1030
+        (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1031
+        (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1032
+        (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1033
+        (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1034
+        (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1035
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1036
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1037
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1038
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1039
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1040
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1041
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1042
+        (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1043 1043
     );
1044 1044
 }
1045 1045
 
@@ -1050,21 +1050,21 @@  discard block
 block discarded – undo
1050 1050
  */
1051 1051
 function bigbluebuttonbn_events_action() {
1052 1052
     return array(
1053
-        'view' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1054
-        'view_management' => (string) BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1055
-        'live_action' => (string) BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1056
-        'meeting_create' => (string) BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1057
-        'meeting_end' => (string) BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1058
-        'meeting_join' => (string) BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1059
-        'meeting_left' => (string) BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1060
-        'recording_delete' => (string) BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1061
-        'recording_import' => (string) BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1062
-        'recording_protect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1063
-        'recording_publish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1064
-        'recording_unprotect' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1065
-        'recording_unpublish' => (string) BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1066
-        'recording_edit' => (string) BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1067
-        'recording_play' => (string) BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1053
+        'view' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED,
1054
+        'view_management' => (string)BIGBLUEBUTTON_EVENT_ACTIVITY_MANAGEMENT_VIEWED,
1055
+        'live_action' => (string)BIGBLUEBUTTON_EVENT_LIVE_SESSION,
1056
+        'meeting_create' => (string)BIGBLUEBUTTON_EVENT_MEETING_CREATED,
1057
+        'meeting_end' => (string)BIGBLUEBUTTON_EVENT_MEETING_ENDED,
1058
+        'meeting_join' => (string)BIGBLUEBUTTON_EVENT_MEETING_JOINED,
1059
+        'meeting_left' => (string)BIGBLUEBUTTON_EVENT_MEETING_LEFT,
1060
+        'recording_delete' => (string)BIGBLUEBUTTON_EVENT_RECORDING_DELETED,
1061
+        'recording_import' => (string)BIGBLUEBUTTON_EVENT_RECORDING_IMPORTED,
1062
+        'recording_protect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PROTECTED,
1063
+        'recording_publish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED,
1064
+        'recording_unprotect' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPROTECTED,
1065
+        'recording_unpublish' => (string)BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED,
1066
+        'recording_edit' => (string)BIGBLUEBUTTON_EVENT_RECORDING_EDITED,
1067
+        'recording_play' => (string)BIGBLUEBUTTON_EVENT_RECORDING_VIEWED
1068 1068
     );
1069 1069
 }
1070 1070
 
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
     if (array_key_exists('other', $options)) {
1096 1096
         $eventproperties['other'] = $options['other'];
1097 1097
     }
1098
-    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_'.$eventtype.'::create',
1098
+    $event = call_user_func_array('\mod_bigbluebuttonbn\event\bigbluebuttonbn_' . $eventtype . '::create',
1099 1099
       array($eventproperties));
1100 1100
     $event->trigger();
1101 1101
 }
@@ -1135,10 +1135,10 @@  discard block
 block discarded – undo
1135 1135
     $now = time();
1136 1136
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1137 1137
         // Use the value in the cache.
1138
-        return (array) json_decode($result['meeting_info']);
1138
+        return (array)json_decode($result['meeting_info']);
1139 1139
     }
1140 1140
     // Ping again and refresh the cache.
1141
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1141
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1142 1142
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1143 1143
       );
1144 1144
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1233,7 +1233,7 @@  discard block
 block discarded – undo
1233 1233
  * @return object
1234 1234
  */
1235 1235
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1236
-    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
1236
+    $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
1237 1237
     $configxmlparams = bigbluebuttonbn_set_config_xml_params($meetingid, $configxml);
1238 1238
     $xml = bigbluebuttonbn_wrap_xml_load_file($urldefaultconfig, 'POST',
1239 1239
         $configxmlparams, 'application/x-www-form-urlencoded');
@@ -1249,8 +1249,8 @@  discard block
 block discarded – undo
1249 1249
  * @return string
1250 1250
  */
1251 1251
 function bigbluebuttonbn_set_config_xml_params($meetingid, $configxml) {
1252
-    $params = 'configXML='.urlencode($configxml).'&meetingID='.urlencode($meetingid);
1253
-    $configxmlparams = $params.'&checksum='.sha1('setConfigXML'.$params.\mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1252
+    $params = 'configXML=' . urlencode($configxml) . '&meetingID=' . urlencode($meetingid);
1253
+    $configxmlparams = $params . '&checksum=' . sha1('setConfigXML' . $params . \mod_bigbluebuttonbn\locallib\config::get('shared_secret'));
1254 1254
     return $configxmlparams;
1255 1255
 }
1256 1256
 
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
  */
1265 1265
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1266 1266
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1267
-    $configxmlarray = (array) $configxml;
1267
+    $configxmlarray = (array)$configxml;
1268 1268
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1269 1269
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1270 1270
         return '';
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
     global $USER;
1357 1357
     $starttime = $starttime - ($starttime % 1000);
1358 1358
     // Set formatted date.
1359
-    $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1359
+    $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1360 1360
     return userdate($starttime / 1000, $dateformat, usertimezone($USER->timezone));
1361 1361
 }
1362 1362
 
@@ -1472,7 +1472,7 @@  discard block
 block discarded – undo
1472 1472
         $visibility = 'hidden ';
1473 1473
     }
1474 1474
     $recordingpreview = html_writer::start_tag('div',
1475
-        array('id' => 'preview-'.$recording['recordID'], $visibility => $visibility));
1475
+        array('id' => 'preview-' . $recording['recordID'], $visibility => $visibility));
1476 1476
     foreach ($recording['playbacks'] as $playback) {
1477 1477
         if (isset($playback['preview'])) {
1478 1478
             foreach ($playback['preview'] as $image) {
@@ -1508,12 +1508,12 @@  discard block
 block discarded – undo
1508 1508
     if ($recording['published'] === 'false') {
1509 1509
         $visibility = 'hidden ';
1510 1510
     }
1511
-    $id = 'playbacks-'.$recording['recordID'];
1511
+    $id = 'playbacks-' . $recording['recordID'];
1512 1512
     $recordingtypes = html_writer::start_tag('div', array('id' => $id, 'data-imported' => $dataimported,
1513 1513
           'data-meetingid' => $recording['meetingID'], 'data-recordingid' => $recording['recordID'],
1514 1514
           'title' => $title, $visibility => $visibility));
1515 1515
     foreach ($recording['playbacks'] as $playback) {
1516
-        $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback).'&#32;';
1516
+        $recordingtypes .= bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) . '&#32;';
1517 1517
     }
1518 1518
     $recordingtypes .= html_writer::end_tag('div');
1519 1519
     return $recordingtypes;
@@ -1530,12 +1530,12 @@  discard block
 block discarded – undo
1530 1530
  */
1531 1531
 function bigbluebuttonbn_get_recording_data_row_type($recording, $bigbluebuttonbnid, $playback) {
1532 1532
     global $CFG, $OUTPUT;
1533
-    $title = get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn');
1533
+    $title = get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn');
1534 1534
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recordingPlay(this);';
1535
-    $href = $CFG->wwwroot.'/mod/bigbluebuttonbn/bbb_view.php?action=play&bn='.$bigbluebuttonbnid.
1536
-      '&mid='.$recording['meetingID'].'&rid='.$recording['recordID'].'&rtype='.$playback['type'];
1535
+    $href = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=play&bn=' . $bigbluebuttonbnid .
1536
+      '&mid=' . $recording['meetingID'] . '&rid=' . $recording['recordID'] . '&rtype=' . $playback['type'];
1537 1537
     if (!isset($recording['imported']) || !isset($recording['protected']) || $recording['protected'] === 'false') {
1538
-        $href .= '&href='.urlencode(trim($playback['url']));
1538
+        $href .= '&href=' . urlencode(trim($playback['url']));
1539 1539
     }
1540 1540
     $id = 'recording-play-' . $playback['type'] . '-' . $recording['recordID'];
1541 1541
     $linkattributes = array(
@@ -1669,7 +1669,7 @@  discard block
 block discarded – undo
1669 1669
             $linkattributes['class'] = 'disabled';
1670 1670
             unset($linkattributes['onclick']);
1671 1671
         }
1672
-        $icon = new pix_icon('i/'.$data['tag'],
1672
+        $icon = new pix_icon('i/' . $data['tag'],
1673 1673
             get_string('view_recording_list_actionbar_' . $data['action'], 'bigbluebuttonbn'),
1674 1674
             'moodle', $iconattributes);
1675 1675
         return $OUTPUT->action_icon('#', $icon, null, $linkattributes, false);
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
  */
1787 1787
 function bigbluebuttonbn_get_recording_table_row($bbbsession, $recording, $rowdata) {
1788 1788
     $row = new html_table_row();
1789
-    $row->id = 'recording-td-'.$recording['recordID'];
1789
+    $row->id = 'recording-td-' . $recording['recordID'];
1790 1790
     $row->attributes['data-imported'] = 'false';
1791 1791
     $texthead = '';
1792 1792
     $texttail = '';
@@ -1845,9 +1845,9 @@  discard block
 block discarded – undo
1845 1845
 function bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn) {
1846 1846
     $sender = get_admin();
1847 1847
     // Prepare message.
1848
-    $messagetext = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
1849
-        ' &quot;' . $bigbluebuttonbn->name . '&quot; '.
1850
-        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1848
+    $messagetext = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') .
1849
+        ' &quot;' . $bigbluebuttonbn->name . '&quot; ' .
1850
+        get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1851 1851
     $context = context_course::instance($bigbluebuttonbn->course);
1852 1852
     \mod_bigbluebuttonbn\locallib\notifier::notification_send($context, $sender, $bigbluebuttonbn, $messagetext);
1853 1853
 }
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
     }
2068 2068
     // Prepare select for loading records based on existent bigbluebuttonbns.
2069 2069
     $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
2070
-    $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
2070
+    $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
2071 2071
     // Include only Create events and exclude those with record not true.
2072 2072
     $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
2073 2073
     // Execute select for loading records based on existent bigbluebuttonbns.
@@ -2199,8 +2199,8 @@  discard block
 block discarded – undo
2199 2199
 function bigbluebuttonbn_format_activity_time($time) {
2200 2200
     $activitytime = '';
2201 2201
     if ($time) {
2202
-        $activitytime = calendar_day_representation($time).' '.
2203
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2202
+        $activitytime = calendar_day_representation($time) . ' ' .
2203
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2204 2204
           calendar_time_representation($time);
2205 2205
     }
2206 2206
     return $activitytime;
Please login to merge, or discard this patch.
config-dist.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
  * recordings from a different activity even from a different course.
99 99
  **/
100 100
 
101
- /*
101
+    /*
102 102
  * When the value is set to 1 (checked) the bigbluebuttonbn rooms or
103 103
  * activities will have the 'import recordings' capability enabled.
104 104
  * $CFG->bigbluebuttonbn['importrecordings_enabled'] = 0;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
  * 'Join session' button enabled
120 120
  **/
121 121
 
122
- /*
122
+    /*
123 123
  * When the value is set to 1 (checked) the bigbluebuttonbn rooms or
124 124
  * activities will have the 'wait for moderator' capability enabled by
125 125
  * default.
@@ -298,27 +298,27 @@  discard block
 block discarded – undo
298 298
  * $CFG->bigbluebuttonbn['general_warning_message'] = "Would you like to record your BigBlueButton sessions for later viewing? ";
299 299
  */
300 300
 
301
- /*
301
+    /*
302 302
  * The warning box is always shown to administrators, but it is also possible to define other roles
303 303
  * to whom the it will be shown. The roles are based on the shortnames defined by Moodle:
304 304
  *     'manager,coursecreator,editingteacher,teacher,student,guest,user,frontpage'
305 305
  * $CFG->bigbluebuttonbn['general_warning_roles'] = 'editingteacher,teacher';
306 306
  */
307 307
 
308
- /*
308
+    /*
309 309
  * As the general_warning_message is shown in a box, its type can be defined with general_warning_type
310 310
  * The default type is 'info' which is normaly rendered in blue when using a bootstrap theme.
311 311
  * All the modifiers for boxed in bootstrap can be used [info|success|warning|danger].
312 312
  * $CFG->bigbluebuttonbn['general_warning_box_type'] = 'info';
313 313
  */
314 314
 
315
- /*
315
+    /*
316 316
  * Additionally, when general_warning_button_href value is different than "", a button
317 317
  * can also be shown right after the message.
318 318
  * $CFG->bigbluebuttonbn['general_warning_button_href'] = "http://blindsidenetworks.com/";
319 319
  */
320 320
 
321
- /*
321
+    /*
322 322
  * Finally, the text and class for the button can be modified
323 323
  * $CFG->bigbluebuttonbn['general_warning_button_text'] = "Upgrade your site";
324 324
  * $CFG->bigbluebuttonbn['general_warning_button_class'] = "btn btn-primary";
Please login to merge, or discard this patch.