Completed
Push — 1.11.x ( 52cc6f...bf3cbb )
by José
80:28 queued 41:29
created
main/inc/lib/social.lib.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1761,7 +1761,9 @@
 block discarded – undo
1761 1761
             $friendHtml.= '<ul class="nav nav-list">';
1762 1762
             $j = 1;
1763 1763
             for ($k=0; $k < $number_friends; $k++) {
1764
-                if ($j > $number_of_images) break;
1764
+                if ($j > $number_of_images) {
1765
+                    break;
1766
+                }
1765 1767
 
1766 1768
                 if (isset($friends[$k])) {
1767 1769
                     $friend = $friends[$k];
Please login to merge, or discard this patch.
main/admin/ldap_form_add_users_group.php 1 patch
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,11 @@
 block discarded – undo
40 40
 	  '</tr>'."\n";
41 41
 while (list ($key, $val) = each($nom_form)) {
42 42
 	$nbre=$nbre+1;
43
-	if($nbre & 1) $ndiv=2; else $ndiv=3;
43
+	if($nbre & 1) {
44
+	    $ndiv=2;
45
+	} else {
46
+	    $ndiv=3;
47
+	}
44 48
 	echo '<tr align="center" id="header'.$ndiv.'">';
45 49
 	echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
46 50
 	echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
Please login to merge, or discard this patch.
main/blog/blog.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -378,9 +378,10 @@
 block discarded – undo
378 378
 	$result = Database::query($sql);
379 379
 	$row = Database::fetch_array($result);
380 380
 
381
-	if ($row['number'] == 1)
382
-		$user_task = true;
383
-}
381
+	if ($row['number'] == 1) {
382
+			$user_task = true;
383
+	}
384
+	}
384 385
 
385 386
 switch ($action) {
386 387
 	case 'new_post':
Please login to merge, or discard this patch.
main/gradebook/lib/fe/userform.class.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@
 block discarded – undo
32 32
         }
33 33
         if ($this->form_type == self :: TYPE_USER_INFO) {
34 34
             $this->build_user_info_form();
35
-        }
36
-        elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) {
35
+        } elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) {
37 36
             $this->build_simple_search();
38 37
         }
39 38
         $this->setDefaults();
Please login to merge, or discard this patch.
main/gradebook/lib/user_data_generator.class.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         // sort users array
96 96
         if ($sorting & self :: UDG_SORT_TYPE) {
97 97
             usort($allitems, array('UserDataGenerator', 'sort_by_type'));
98
-        }elseif ($sorting & self :: UDG_SORT_NAME) {
98
+        } elseif ($sorting & self :: UDG_SORT_NAME) {
99 99
             usort($allitems, array('UserDataGenerator', 'sort_by_name'));
100 100
         } elseif ($sorting & self :: UDG_SORT_COURSE) {
101 101
             usort($allitems, array('UserDataGenerator', 'sort_by_course'));
@@ -148,8 +148,9 @@  discard block
 block discarded – undo
148 148
             $row[] = $this->build_category_name($item);
149 149
             $row[] = $this->build_average_column($item, $ignore_score_color);
150 150
             $row[] = $this->build_result_column($item, $ignore_score_color);
151
-            if ($scoredisplay->is_custom())
152
-                $row[] = $this->build_mask_column($item, $ignore_score_color);
151
+            if ($scoredisplay->is_custom()) {
152
+                            $row[] = $this->build_mask_column($item, $ignore_score_color);
153
+            }
153 154
             $data[] = $row;
154 155
         }
155 156
         return $data;
Please login to merge, or discard this patch.
main/dropbox/dropbox_class.inc.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -496,13 +496,19 @@
 block discarded – undo
496 496
 		$id = intval($id);
497 497
 		$sql = "DELETE FROM ".$dropbox_cnf['tbl_file']."
498 498
 		        WHERE c_id = $course_id AND cat_id = '".$id."' ";
499
-		if (!Database::query($sql)) return false;
499
+		if (!Database::query($sql)) {
500
+		    return false;
501
+		}
500 502
 		$sql = "DELETE FROM ".$dropbox_cnf['tbl_category']."
501 503
 		        WHERE c_id = $course_id AND cat_id = '".$id."' ";
502
-		if (!Database::query($sql)) return false;
504
+		if (!Database::query($sql)) {
505
+		    return false;
506
+		}
503 507
 		$sql = "DELETE FROM ".$dropbox_cnf['tbl_post']."
504 508
 		        WHERE c_id = $course_id AND cat_id = '".$id."' ";
505
-		if (!Database::query($sql)) return false;
509
+		if (!Database::query($sql)) {
510
+		    return false;
511
+		}
506 512
 		return true;
507 513
 	}
508 514
 
Please login to merge, or discard this patch.
main/dropbox/dropbox_functions.inc.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -750,10 +750,15 @@
 block discarded – undo
750 750
             ";
751 751
     $result = Database::query($sql);
752 752
 
753
-    if (!($res = Database::fetch_array($result)))
754
-        die(get_lang('GeneralError').' (code 901)');
755
-    if ($owner == 0) return $res['uploader_id'];
756
-    if ($res['uploader_id'] == $owner) return true;
753
+    if (!($res = Database::fetch_array($result))) {
754
+            die(get_lang('GeneralError').' (code 901)');
755
+    }
756
+    if ($owner == 0) {
757
+        return $res['uploader_id'];
758
+    }
759
+    if ($res['uploader_id'] == $owner) {
760
+        return true;
761
+    }
757 762
     die(get_lang('GeneralError').' (code '.$or_die.')');
758 763
 }
759 764
 
Please login to merge, or discard this patch.
main/lp/learnpath.class.php 1 patch
Braces   +100 added lines, -68 removed lines patch added patch discarded remove patch
@@ -3938,8 +3938,9 @@  discard block
 block discarded – undo
3938 3938
                 WHERE c_id = ".$course_id."
3939 3939
                 ORDER BY display_order";
3940 3940
         $res = Database::query($sql);
3941
-        if ($res === false)
3942
-            return false;
3941
+        if ($res === false) {
3942
+                    return false;
3943
+        }
3943 3944
         $lps = array ();
3944 3945
         $lp_order = array ();
3945 3946
         $num = Database :: num_rows($res);
@@ -4539,8 +4540,9 @@  discard block
 block discarded – undo
4539 4540
         if ($this->debug > 0) {
4540 4541
             error_log('New LP - In learnpath::set_maker()', 0);
4541 4542
         }
4542
-        if (empty ($name))
4543
-            return false;
4543
+        if (empty ($name)) {
4544
+                    return false;
4545
+        }
4544 4546
         $this->maker = $name;
4545 4547
         $lp_table = Database :: get_course_table(TABLE_LP_MAIN);
4546 4548
         $course_id = api_get_course_int_id();
@@ -4605,8 +4607,9 @@  discard block
 block discarded – undo
4605 4607
     public function set_terms_by_prefix($terms_string, $prefix)
4606 4608
     {
4607 4609
         $course_id = api_get_course_int_id();
4608
-        if (api_get_setting('search_enabled') !== 'true')
4609
-            return false;
4610
+        if (api_get_setting('search_enabled') !== 'true') {
4611
+                    return false;
4612
+        }
4610 4613
 
4611 4614
         if (!extension_loaded('xapian')) {
4612 4615
             return false;
@@ -4619,8 +4622,9 @@  discard block
 block discarded – undo
4619 4622
         $stored_terms = $this->get_common_index_terms_by_prefix($prefix);
4620 4623
 
4621 4624
         // Don't do anything if no change, verify only at DB, not the search engine.
4622
-        if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0))
4623
-            return false;
4625
+        if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) {
4626
+                    return false;
4627
+        }
4624 4628
 
4625 4629
         require_once 'xapian.php'; // TODO: Try catch every xapian use or make wrappers on API.
4626 4630
         require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
@@ -4812,8 +4816,9 @@  discard block
 block discarded – undo
4812 4816
         if ($this->debug > 0) {
4813 4817
             error_log('New LP - In learnpath::set_proximity()', 0);
4814 4818
         }
4815
-        if (empty ($name))
4816
-            return false;
4819
+        if (empty ($name)) {
4820
+                    return false;
4821
+        }
4817 4822
 
4818 4823
         $this->proximity = $name;
4819 4824
         $lp_table = Database :: get_course_table(TABLE_LP_MAIN);
@@ -5157,8 +5162,9 @@  discard block
 block discarded – undo
5157 5162
 
5158 5163
         $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." ORDER BY display_order";
5159 5164
         $res = Database::query($sql);
5160
-        if ($res === false)
5161
-            return false;
5165
+        if ($res === false) {
5166
+                    return false;
5167
+        }
5162 5168
 
5163 5169
         $num = Database :: num_rows($res);
5164 5170
         // First check the order is correct, globally (might be wrong because
@@ -5469,8 +5475,9 @@  discard block
 block discarded – undo
5469 5475
             $position[$key] = $row['display_order'];
5470 5476
         }
5471 5477
 
5472
-        if (count($array) > 0)
5473
-            array_multisort($parent, SORT_ASC, $position, SORT_ASC, $array);
5478
+        if (count($array) > 0) {
5479
+                    array_multisort($parent, SORT_ASC, $position, SORT_ASC, $array);
5480
+        }
5474 5481
 
5475 5482
         return $array;
5476 5483
     }
@@ -6242,10 +6249,12 @@  discard block
 block discarded – undo
6242 6249
                     if ($new_comment || $new_title) {
6243 6250
                         $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
6244 6251
                         $ct = '';
6245
-                        if ($new_comment)
6246
-                            $ct .= ", comment='" . Database::escape_string($new_comment). "'";
6247
-                        if ($new_title)
6248
-                            $ct .= ", title='" . Database::escape_string($new_title)."' ";
6252
+                        if ($new_comment) {
6253
+                                                    $ct .= ", comment='" . Database::escape_string($new_comment). "'";
6254
+                        }
6255
+                        if ($new_title) {
6256
+                                                    $ct .= ", title='" . Database::escape_string($new_title)."' ";
6257
+                        }
6249 6258
 
6250 6259
                         $sql = "UPDATE " . $tbl_doc ." SET " . substr($ct, 1)."
6251 6260
                                WHERE c_id = ".$course_id." AND id = " . $document_id;
@@ -6269,17 +6278,21 @@  discard block
 block discarded – undo
6269 6278
         // Please, do not modify this dirname formatting.
6270 6279
         $dir = isset($_GET['dir']) ? $_GET['dir'] : $_POST['dir'];
6271 6280
 
6272
-        if (strstr($dir, '..'))
6273
-            $dir = '/';
6281
+        if (strstr($dir, '..')) {
6282
+                    $dir = '/';
6283
+        }
6274 6284
 
6275
-        if ($dir[0] == '.')
6276
-            $dir = substr($dir, 1);
6285
+        if ($dir[0] == '.') {
6286
+                    $dir = substr($dir, 1);
6287
+        }
6277 6288
 
6278
-        if ($dir[0] != '/')
6279
-            $dir = '/' . $dir;
6289
+        if ($dir[0] != '/') {
6290
+                    $dir = '/' . $dir;
6291
+        }
6280 6292
 
6281
-        if ($dir[strlen($dir) - 1] != '/')
6282
-            $dir .= '/';
6293
+        if ($dir[strlen($dir) - 1] != '/') {
6294
+                    $dir .= '/';
6295
+        }
6283 6296
 
6284 6297
         $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $dir;
6285 6298
 
@@ -6344,8 +6357,9 @@  discard block
 block discarded – undo
6344 6357
                 }
6345 6358
                 $return .= '<div style="padding:10px;">';
6346 6359
 
6347
-                if ($msg != '')
6348
-                    $return .= $msg;
6360
+                if ($msg != '') {
6361
+                                    $return .= $msg;
6362
+                }
6349 6363
 
6350 6364
                 $return .= '<h3>'.$row['title'].'</h3>';
6351 6365
                 switch ($row['item_type']) {
@@ -6606,10 +6620,11 @@  discard block
 block discarded – undo
6606 6620
         $item_title			= Security::remove_XSS($item_title);
6607 6621
         $item_description 	= Security::remove_XSS($item_description);
6608 6622
 
6609
-        if ($id != 0 && is_array($extra_info))
6610
-            $parent = $extra_info['parent_item_id'];
6611
-        else
6612
-            $parent = 0;
6623
+        if ($id != 0 && is_array($extra_info)) {
6624
+                    $parent = $extra_info['parent_item_id'];
6625
+        } else {
6626
+                    $parent = 0;
6627
+        }
6613 6628
 
6614 6629
         $sql = "SELECT * FROM " . $tbl_lp_item . "
6615 6630
                 WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ -6909,8 +6924,9 @@  discard block
 block discarded – undo
6909 6924
                         $arrHide[] = $arrLP[$i]['id'];
6910 6925
                     }
6911 6926
                 } else {
6912
-                    if ($arrLP[$i]['item_type'] == 'dir')
6913
-                        $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>';
6927
+                    if ($arrLP[$i]['item_type'] == 'dir') {
6928
+                                            $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>';
6929
+                    }
6914 6930
                 }
6915 6931
             }
6916 6932
 
@@ -6928,11 +6944,13 @@  discard block
 block discarded – undo
6928 6944
 
6929 6945
         for ($i = 0; $i < count($arrLP); $i++) {
6930 6946
             if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) {
6931
-                if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
6947
+                if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
6948
+                                    $selected = 'selected="selected" ';
6949
+                } elseif ($action == 'add') {
6932 6950
                     $selected = 'selected="selected" ';
6933
-                elseif ($action == 'add') $selected = 'selected="selected" ';
6934
-                else
6935
-                    $selected = '';
6951
+                } else {
6952
+                                    $selected = '';
6953
+                }
6936 6954
 
6937 6955
                 $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>';
6938 6956
             }
@@ -6959,9 +6977,11 @@  discard block
 block discarded – undo
6959 6977
                 $arrHide = array ();
6960 6978
                 for ($i = 0; $i < count($arrLP); $i++) {
6961 6979
                     if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
6962
-                        if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
6963
-                            $s_selected_position = $arrLP[$i]['id'];
6964
-                        elseif ($action == 'add') $s_selected_position = 0;
6980
+                        if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
6981
+                                                    $s_selected_position = $arrLP[$i]['id'];
6982
+                        } elseif ($action == 'add') {
6983
+                            $s_selected_position = 0;
6984
+                        }
6965 6985
                         $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
6966 6986
                     }
6967 6987
                 }
@@ -7153,9 +7173,11 @@  discard block
 block discarded – undo
7153 7173
             $arrHide = array();
7154 7174
             for ($i = 0; $i < count($arrLP); $i++) {
7155 7175
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
7156
-                    if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id'])
7157
-                        $s_selected_position = $arrLP[$i]['id'];
7158
-                    elseif ($action == 'add') $s_selected_position = 0;
7176
+                    if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) {
7177
+                                            $s_selected_position = $arrLP[$i]['id'];
7178
+                    } elseif ($action == 'add') {
7179
+                        $s_selected_position = 0;
7180
+                    }
7159 7181
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
7160 7182
                 }
7161 7183
             }
@@ -7350,9 +7372,11 @@  discard block
 block discarded – undo
7350 7372
 
7351 7373
             for ($i = 0; $i < count($arrLP); $i++) {
7352 7374
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
7353
-                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
7354
-                        $s_selected_position = $arrLP[$i]['id'];
7355
-                    elseif ($action == 'add') $s_selected_position = 0;
7375
+                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
7376
+                                            $s_selected_position = $arrLP[$i]['id'];
7377
+                    } elseif ($action == 'add') {
7378
+                        $s_selected_position = 0;
7379
+                    }
7356 7380
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
7357 7381
 
7358 7382
                 }
@@ -7386,8 +7410,7 @@  discard block
 block discarded – undo
7386 7410
 
7387 7411
         if (is_numeric($extra_info)) {
7388 7412
             $form->addHidden('path', $extra_info);
7389
-        }
7390
-        elseif (is_array($extra_info)) {
7413
+        } elseif (is_array($extra_info)) {
7391 7414
             $form->addHidden('path', $extra_info['path']);
7392 7415
         }
7393 7416
 
@@ -7440,8 +7463,9 @@  discard block
 block discarded – undo
7440 7463
                     lp_id = " . $this->lp_id . " AND
7441 7464
                     id != $id";
7442 7465
 
7443
-        if ($item_type == 'dir')
7444
-            $sql .= " AND parent_item_id = 0";
7466
+        if ($item_type == 'dir') {
7467
+                    $sql .= " AND parent_item_id = 0";
7468
+        }
7445 7469
 
7446 7470
         $result = Database::query($sql);
7447 7471
         $arrLP = array ();
@@ -7842,9 +7866,11 @@  discard block
 block discarded – undo
7842 7866
             $arrHide = array();
7843 7867
             for ($i = 0; $i < count($arrLP); $i++) {
7844 7868
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir' && $arrLP[$i]['item_type'] !== TOOL_LP_FINAL_ITEM) {
7845
-                    if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id'])
7869
+                    if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) {
7870
+                                            $s_selected_position = $arrLP[$i]['id'];
7871
+                    } elseif ($action == 'add') {
7846 7872
                         $s_selected_position = $arrLP[$i]['id'];
7847
-                    elseif ($action == 'add') $s_selected_position = $arrLP[$i]['id'];
7873
+                    }
7848 7874
 
7849 7875
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
7850 7876
 
@@ -7855,17 +7881,18 @@  discard block
 block discarded – undo
7855 7881
                 $item_type = isset($extra_info['item_type']) ? $extra_info['item_type'] : null;
7856 7882
                 $edit = isset($_GET['edit']) ? $_GET['edit'] : null;
7857 7883
                 if (($extra_info == 'new' || $item_type == TOOL_DOCUMENT || $item_type == TOOL_LP_FINAL_ITEM || $edit == 'true')) {
7858
-                    if (isset ($_POST['content']))
7859
-                        $content = stripslashes($_POST['content']);
7860
-                    elseif (is_array($extra_info)) {
7884
+                    if (isset ($_POST['content'])) {
7885
+                                            $content = stripslashes($_POST['content']);
7886
+                    } elseif (is_array($extra_info)) {
7861 7887
                         //If it's an html document or a text file
7862 7888
                         if (!$no_display_edit_textarea) {
7863 7889
                             $content = $this->display_document($extra_info['path'], false, false);
7864 7890
                         }
7865
-                    } elseif (is_numeric($extra_info))
7866
-                        $content = $this->display_document($extra_info, false, false);
7867
-                    else
7868
-                        $content = '';
7891
+                    } elseif (is_numeric($extra_info)) {
7892
+                                            $content = $this->display_document($extra_info, false, false);
7893
+                    } else {
7894
+                                            $content = '';
7895
+                    }
7869 7896
 
7870 7897
                     if (!$no_display_edit_textarea) {
7871 7898
                         // We need to calculate here some specific settings for the online editor.
@@ -8129,9 +8156,11 @@  discard block
 block discarded – undo
8129 8156
             $arrHide = array();
8130 8157
             for ($i = 0; $i < count($arrLP); $i++) {
8131 8158
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
8132
-                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
8133
-                        $s_selected_position = $arrLP[$i]['id'];
8134
-                    elseif ($action == 'add') $s_selected_position = 0;
8159
+                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
8160
+                                            $s_selected_position = $arrLP[$i]['id'];
8161
+                    } elseif ($action == 'add') {
8162
+                        $s_selected_position = 0;
8163
+                    }
8135 8164
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
8136 8165
 
8137 8166
                 }
@@ -8327,9 +8356,11 @@  discard block
 block discarded – undo
8327 8356
             $arrHide = array ();
8328 8357
             for ($i = 0; $i < count($arrLP); $i++) {
8329 8358
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
8330
-                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
8331
-                        $s_selected_position = $arrLP[$i]['id'];
8332
-                    elseif ($action == 'add') $s_selected_position = 0;
8359
+                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
8360
+                                            $s_selected_position = $arrLP[$i]['id'];
8361
+                    } elseif ($action == 'add') {
8362
+                        $s_selected_position = 0;
8363
+                    }
8333 8364
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
8334 8365
 
8335 8366
                 }
@@ -9381,10 +9412,11 @@  discard block
 block discarded – undo
9381 9412
 
9382 9413
                 // Dependency to other files - not yet supported.
9383 9414
                 $i = 1;
9384
-                if ($inc_docs)
9385
-                foreach ($inc_docs as $doc_info) {
9415
+                if ($inc_docs) {
9416
+                                foreach ($inc_docs as $doc_info) {
9386 9417
                     if (count($doc_info) < 1 || empty($doc_info[0])) {
9387 9418
                         continue;
9419
+                }
9388 9420
                     }
9389 9421
                     $my_dep = $xmldoc->createElement('resource');
9390 9422
                     $res_id = 'RESOURCE_'.$item->get_id().'_'.$i;
Please login to merge, or discard this patch.
main/inc/lib/sessionmanager.lib.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1604,8 +1604,10 @@  discard block
 block discarded – undo
1604 1604
         if (empty($session_visibility)) {
1605 1605
             $session_visibility = $session->getVisibility();
1606 1606
             //default status loaded if empty
1607
-            if (empty($session_visibility))
1608
-                $session_visibility = SESSION_VISIBLE_READ_ONLY; // by default readonly 1
1607
+            if (empty($session_visibility)) {
1608
+                            $session_visibility = SESSION_VISIBLE_READ_ONLY;
1609
+            }
1610
+            // by default readonly 1
1609 1611
         } else {
1610 1612
             if (!in_array($session_visibility, array(SESSION_VISIBLE_READ_ONLY, SESSION_VISIBLE, SESSION_INVISIBLE))) {
1611 1613
                 $session_visibility = SESSION_VISIBLE_READ_ONLY;
@@ -2819,10 +2821,11 @@  discard block
 block discarded – undo
2819 2821
                                 c_id = $courseId AND
2820 2822
                                 user_id = $user_id ";
2821 2823
                     $result = Database::query($sql);
2822
-                    if (Database::affected_rows($result) > 0)
2823
-                        return true;
2824
-                    else
2825
-                        return false;
2824
+                    if (Database::affected_rows($result) > 0) {
2825
+                                            return true;
2826
+                    } else {
2827
+                                            return false;
2828
+                    }
2826 2829
                 } else {
2827 2830
                     // The user is not subscribed to the session, so make sure
2828 2831
                     // he isn't subscribed to a course in this session either
Please login to merge, or discard this patch.