Completed
Pull Request — master (#334)
by
unknown
01:40
created
lib.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
         $CFG->bigbluebuttonbn = array();
36 36
     }
37 37
 
38
-    if (file_exists(dirname(__FILE__).'/config.php')) {
39
-        require_once(dirname(__FILE__).'/config.php');
38
+    if (file_exists(dirname(__FILE__) . '/config.php')) {
39
+        require_once(dirname(__FILE__) . '/config.php');
40 40
     }
41 41
 
42 42
     /*
@@ -94,19 +94,19 @@  discard block
 block discarded – undo
94 94
         return null;
95 95
     }
96 96
     $features = array(
97
-        (string) FEATURE_IDNUMBER => true,
98
-        (string) FEATURE_GROUPS => true,
99
-        (string) FEATURE_GROUPINGS => true,
100
-        (string) FEATURE_GROUPMEMBERSONLY => true,
101
-        (string) FEATURE_MOD_INTRO => true,
102
-        (string) FEATURE_BACKUP_MOODLE2 => true,
103
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
104
-        (string) FEATURE_COMPLETION_HAS_RULES => true,
105
-        (string) FEATURE_GRADE_HAS_GRADE => false,
106
-        (string) FEATURE_GRADE_OUTCOMES => false,
107
-        (string) FEATURE_SHOW_DESCRIPTION => true,
97
+        (string)FEATURE_IDNUMBER => true,
98
+        (string)FEATURE_GROUPS => true,
99
+        (string)FEATURE_GROUPINGS => true,
100
+        (string)FEATURE_GROUPMEMBERSONLY => true,
101
+        (string)FEATURE_MOD_INTRO => true,
102
+        (string)FEATURE_BACKUP_MOODLE2 => true,
103
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
104
+        (string)FEATURE_COMPLETION_HAS_RULES => true,
105
+        (string)FEATURE_GRADE_HAS_GRADE => false,
106
+        (string)FEATURE_GRADE_OUTCOMES => false,
107
+        (string)FEATURE_SHOW_DESCRIPTION => true,
108 108
     );
109
-    if (isset($features[(string) $feature])) {
109
+    if (isset($features[(string)$feature])) {
110 110
         return $features[$feature];
111 111
     }
112 112
     return null;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) {
300 300
     global $DB;
301 301
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
302
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
302
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
303 303
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
304 304
     $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}";
305 305
     bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta);
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
321 321
     if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) {
322 322
         return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
323
-            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string) $completed . ' ' .
323
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
324 324
             get_string('view_message_times', 'bigbluebuttonbn');
325 325
     }
326 326
     return '';
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
  * @return array status array
513 513
  */
514 514
 function bigbluebuttonbn_reset_recordings($courseid) {
515
-    require_once(__DIR__.'/locallib.php');
515
+    require_once(__DIR__ . '/locallib.php');
516 516
     // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true].
517 517
     $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true);
518 518
     // Remove all the recordings.
@@ -581,18 +581,18 @@  discard block
 block discarded – undo
581 581
     if ($bigbluebuttonbn->visible) {
582 582
         $classes = 'class="dimmed" ';
583 583
     }
584
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
585
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
586
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
587
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
588
-    $str .= '  </div>'."\n";
589
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
590
-        '</div>'."\n";
584
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
585
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
586
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
587
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
588
+    $str .= '  </div>' . "\n";
589
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
590
+        '</div>' . "\n";
591 591
     if (!empty($bigbluebuttonbn->closingtime)) {
592
-        $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
593
-                .'</div>'."\n";
592
+        $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
593
+                .'</div>' . "\n";
594 594
     }
595
-    $str .= '</div>'."\n";
595
+    $str .= '</div>' . "\n";
596 596
     return $str;
597 597
 }
598 598
 
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
  * @return void
681 681
  **/
682 682
 function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) {
683
-    require_once(__DIR__.'/locallib.php');
683
+    require_once(__DIR__ . '/locallib.php');
684 684
     $bigbluebuttonbn->timemodified = time();
685 685
     if ((integer)$bigbluebuttonbn->instance == 0) {
686 686
         $bigbluebuttonbn->meetingid = 0;
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
  **/
814 814
 function bigbluebuttonbn_process_post_save_event(&$bigbluebuttonbn) {
815 815
     global $CFG, $DB;
816
-    require_once($CFG->dirroot.'/calendar/lib.php');
816
+    require_once($CFG->dirroot . '/calendar/lib.php');
817 817
     $eventid = $DB->get_field('event', 'id', array('modulename' => 'bigbluebuttonbn',
818 818
         'instance' => $bigbluebuttonbn->id));
819 819
     // Delete the event from calendar when/if openingtime is NOT set.
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
     if (count($files) == 1) {
901 901
         // Get the first (and only) file.
902 902
         $file = reset($files);
903
-        $filesrc = '/'.$file->get_filename();
903
+        $filesrc = '/' . $file->get_filename();
904 904
     }
905 905
     return $filesrc;
906 906
 }
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
     if (!$filename) {
970 970
         return false;
971 971
     }
972
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
972
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
973 973
     $fs = get_file_storage();
974 974
     $file = $fs->get_file_by_hash(sha1($fullpath));
975 975
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
mod_form.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
314 314
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6],
315 315
                 ['message' => get_string('mod_form_field_voicebridge_format_error', 'bigbluebuttonbn'),
316
-                 'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
317
-              );
316
+                    'type' => 'numeric', 'rule' => '####', 'validator' => 'server']
317
+                );
318 318
         } else {
319 319
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
320 320
                 $field['description_key'], 0, ['maxlength' => 4, 'size' => 6]);
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
     private function bigbluebuttonbn_mform_add_block_room_recordings(&$mform, $cfg) {
487 487
         $recordingsettings = false;
488 488
         $field = ['type' => 'hidden', 'name' => 'recordings_html', 'data_type' => PARAM_INT,
489
-                  'description_key' => null];
489
+                    'description_key' => null];
490 490
         if ($cfg['recordings_html_editable']) {
491 491
             $field['type'] = 'checkbox';
492 492
             $field['description_key'] = 'mod_form_field_recordings_html';
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
         $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
496 496
             $field['description_key'], $cfg['recordings_html_default']);
497 497
         $field = ['type' => 'hidden', 'name' => 'recordings_deleted', 'data_type' => PARAM_INT,
498
-                  'description_key' => null];
498
+                    'description_key' => null];
499 499
         if ($cfg['recordings_deleted_editable']) {
500 500
             $field['type'] = 'checkbox';
501 501
             $field['description_key'] = 'mod_form_field_recordings_deleted';
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
         $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
505 505
             $field['description_key'], $cfg['recordings_deleted_default']);
506 506
         $field = ['type' => 'hidden', 'name' => 'recordings_imported', 'data_type' => PARAM_INT,
507
-                  'description_key' => null];
507
+                    'description_key' => null];
508 508
         if ($cfg['importrecordings_enabled'] && $cfg['recordings_imported_editable']) {
509 509
             $field['type'] = 'checkbox';
510 510
             $field['description_key'] = 'mod_form_field_recordings_imported';
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
         $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
514 514
             $field['description_key'], $cfg['recordings_imported_default']);
515 515
         $field = ['type' => 'hidden', 'name' => 'recordings_preview', 'data_type' => PARAM_INT,
516
-                  'description_key' => null];
516
+                    'description_key' => null];
517 517
         if ($cfg['recordings_preview_editable']) {
518 518
             $field['type'] = 'checkbox';
519 519
             $field['description_key'] = 'mod_form_field_recordings_preview';
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
         $htmlselectiontype = html_writer::select($participantselection['type_options'],
591 591
             'bigbluebuttonbn_participant_selection_type', $participantselection['type_selected'], array(),
592 592
             array('id' => 'bigbluebuttonbn_participant_selection_type',
593
-                  'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;'));
593
+                    'onchange' => 'M.mod_bigbluebuttonbn.modform.participantSelectionSet(); return 0;'));
594 594
         $htmlselectionoptions = html_writer::select($participantselection['options'], 'bigbluebuttonbn_participant_selection',
595 595
             $participantselection['selected'], array(),
596 596
             array('id' => 'bigbluebuttonbn_participant_selection', 'disabled' => 'disabled'));
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
             'type' => 'button', 'class' => 'btn btn-secondary',
599 599
             'value' => get_string('mod_form_field_participant_list_action_add', 'bigbluebuttonbn'),
600 600
             'onclick' => 'M.mod_bigbluebuttonbn.modform.participantAdd(); return 0;'
601
-          ));
601
+            ));
602 602
         $htmladdparticipant = html_writer::tag('div',
603 603
             $htmlselectiontype . '&nbsp;&nbsp;' . $htmlselectionoptions . '&nbsp;&nbsp;' . $htmlselectioninput, null);
604 604
         $mform->addElement('html', "\n\n");
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
             $field['data_type'] = PARAM_TEXT;
642 642
             $field['description_key'] = 'mod_form_field_block_clienttype';
643 643
             $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
644
-                         BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
644
+                            BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
645 645
             $mform->addElement('header', 'clienttypeselection', get_string('mod_form_block_clienttype', 'bigbluebuttonbn'));
646 646
             $this->bigbluebuttonbn_mform_add_element($mform, $field['type'], $field['name'], $field['data_type'],
647 647
                                     $field['description_key'], $cfg['clienttype_default'], $choices);
Please login to merge, or discard this patch.