Completed
Push — 1.10.x ( 501d19...0db498 )
by Yannick
89:35 queued 49:03
created
main/inc/lib/message.lib.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -143,8 +143,9 @@  discard block
 block discarded – undo
143 143
             $direction = 'DESC';
144 144
         } else {
145 145
             $column = intval($column);
146
-            if (!in_array($direction, array('ASC', 'DESC')))
147
-                $direction = 'ASC';
146
+            if (!in_array($direction, array('ASC', 'DESC'))) {
147
+                            $direction = 'ASC';
148
+            }
148 149
         }
149 150
 
150 151
         $keyword = Session::read('message_search_keyword');
@@ -521,8 +522,9 @@  discard block
 block discarded – undo
521 522
     public static function delete_message_by_user_receiver($user_receiver_id, $id)
522 523
     {
523 524
         $table_message = Database::get_main_table(TABLE_MESSAGE);
524
-        if ($id != strval(intval($id)))
525
-            return false;
525
+        if ($id != strval(intval($id))) {
526
+                    return false;
527
+        }
526 528
         $user_receiver_id = intval($user_receiver_id);
527 529
         $id = intval($id);
528 530
         $sql = "SELECT * FROM $table_message
@@ -697,8 +699,9 @@  discard block
 block discarded – undo
697 699
      */
698 700
     public static function update_message($user_id, $message_id)
699 701
     {
700
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
701
-            return false;
702
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
703
+                    return false;
704
+        }
702 705
 
703 706
         $table_message = Database::get_main_table(TABLE_MESSAGE);
704 707
         $sql = "UPDATE $table_message SET msg_status = '0'
@@ -738,8 +741,9 @@  discard block
 block discarded – undo
738 741
      */
739 742
     public static function get_message_by_user($user_id, $message_id)
740 743
     {
741
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
742
-            return false;
744
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
745
+                    return false;
746
+        }
743 747
         $table_message = Database::get_main_table(TABLE_MESSAGE);
744 748
         $query = "SELECT * FROM $table_message
745 749
                   WHERE user_receiver_id=".intval($user_id)." AND id='".intval($message_id)."'";
@@ -754,8 +758,9 @@  discard block
 block discarded – undo
754 758
      */
755 759
     public static function get_messages_by_group($group_id)
756 760
     {
757
-        if ($group_id != strval(intval($group_id)))
758
-            return false;
761
+        if ($group_id != strval(intval($group_id))) {
762
+                    return false;
763
+        }
759 764
 
760 765
         $table_message = Database::get_main_table(TABLE_MESSAGE);
761 766
         $group_id = intval($group_id);
@@ -782,8 +787,9 @@  discard block
 block discarded – undo
782 787
      */
783 788
     public static function get_messages_by_group_by_message($group_id, $message_id)
784 789
     {
785
-        if ($group_id != strval(intval($group_id)))
786
-            return false;
790
+        if ($group_id != strval(intval($group_id))) {
791
+                    return false;
792
+        }
787 793
         $table_message = Database::get_main_table(TABLE_MESSAGE);
788 794
         $group_id = intval($group_id);
789 795
         $sql = "SELECT * FROM $table_message
@@ -861,8 +867,9 @@  discard block
 block discarded – undo
861 867
      */
862 868
     public static function exist_message($user_id, $id)
863 869
     {
864
-        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id)))
865
-            return false;
870
+        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) {
871
+                    return false;
872
+        }
866 873
         $table_message = Database::get_main_table(TABLE_MESSAGE);
867 874
         $query = "SELECT id FROM $table_message
868 875
                   WHERE
@@ -893,8 +900,9 @@  discard block
 block discarded – undo
893 900
             $direction = 'DESC';
894 901
         } else {
895 902
             $column = intval($column);
896
-            if (!in_array($direction, array('ASC', 'DESC')))
897
-                $direction = 'ASC';
903
+            if (!in_array($direction, array('ASC', 'DESC'))) {
904
+                            $direction = 'ASC';
905
+            }
898 906
         }
899 907
         $table_message = Database::get_main_table(TABLE_MESSAGE);
900 908
         $request = api_is_xml_http_request();
Please login to merge, or discard this patch.
main/inc/lib/blog.lib.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1001,8 +1001,9 @@  discard block
 block discarded – undo
1001 1001
             $blog_post_actions .= '</a>';
1002 1002
         }
1003 1003
 
1004
-		if (api_is_allowed('BLOG_' . $blog_id, 'article_rate'))
1005
-			$rating_select = Blog::display_rating_form('post',$blog_id,$post_id);
1004
+		if (api_is_allowed('BLOG_' . $blog_id, 'article_rate')) {
1005
+					$rating_select = Blog::display_rating_form('post',$blog_id,$post_id);
1006
+		}
1006 1007
 
1007 1008
 		$blog_post_text=stripslashes($blog_post_text);
1008 1009
 
@@ -1648,8 +1649,9 @@  discard block
 block discarded – undo
1648 1649
 
1649 1650
 						$arrPermissions = array();
1650 1651
 
1651
-						while ($row = Database::fetch_array($result))
1652
-							$arrPermissions[] = $row['action'];
1652
+						while ($row = Database::fetch_array($result)) {
1653
+													$arrPermissions[] = $row['action'];
1654
+						}
1653 1655
 
1654 1656
 						    echo '<tr>';
1655 1657
 							echo '<td style="text-align:right; vertical-align:top;">' . get_lang('TaskManager') . ':&nbsp;&nbsp;</td>';
@@ -2325,8 +2327,9 @@  discard block
 block discarded – undo
2325 2327
 		//Handle leap year
2326 2328
 		$numberofdays = array (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
2327 2329
 
2328
-		if(($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0))
2329
-			$numberofdays[2] = 29;
2330
+		if(($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) {
2331
+					$numberofdays[2] = 29;
2332
+		}
2330 2333
 
2331 2334
 		//Get the first day of the month
2332 2335
 		$dayone = getdate(mktime(0, 0, 0, $month, 1, $year));
@@ -2356,8 +2359,9 @@  discard block
 block discarded – undo
2356 2359
 		if( Database::num_rows($result) > 0) {
2357 2360
 			while($blog_post = Database::fetch_array($result)) {
2358 2361
 				// If the day of this post is not yet in the array, add it.
2359
-				if (!in_array($blog_post['post_day'], $posts))
2360
-					$posts[] = $blog_post['post_day'];
2362
+				if (!in_array($blog_post['post_day'], $posts)) {
2363
+									$posts[] = $blog_post['post_day'];
2364
+				}
2361 2365
 			}
2362 2366
 		}
2363 2367
 
@@ -2396,8 +2400,9 @@  discard block
 block discarded – undo
2396 2400
 
2397 2401
 		echo "<tr>";
2398 2402
 
2399
-		for($ii = 1; $ii < 8; $ii ++)
2400
-			echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
2403
+		for($ii = 1; $ii < 8; $ii ++) {
2404
+					echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
2405
+		}
2401 2406
 
2402 2407
 		echo "</tr>";
2403 2408
 
@@ -2407,8 +2412,9 @@  discard block
 block discarded – undo
2407 2412
 		while ($curday <= $numberofdays[$month]) {
2408 2413
 			echo "<tr>";
2409 2414
 			for ($ii = 0; $ii < 7; $ii ++) {
2410
-				if (($curday == -1) && ($ii == $startdayofweek))
2411
-					$curday = 1;
2415
+				if (($curday == -1) && ($ii == $startdayofweek)) {
2416
+									$curday = 1;
2417
+				}
2412 2418
 
2413 2419
 			 	if (($curday > 0) && ($curday <= $numberofdays[$month])) {
2414 2420
 					$bgcolor = $ii < 5 ? $class="class=\"days_week\"" : $class="class=\"days_weekend\"";
@@ -2422,10 +2428,11 @@  discard block
 block discarded – undo
2422 2428
 					echo "<td " . $class.">";
2423 2429
 
2424 2430
 					// If there are posts on this day, create a filter link.
2425
-					if(in_array($curday, $posts))
2426
-						echo '<a href="blog.php?blog_id=' . $blog_id . '&filter=' . $year . '-' . $month . '-' . $curday . '&month=' . $month . '&year=' . $year . '" title="' . get_lang('ViewPostsOfThisDay') . '">' . $curday . '</a>';
2427
-					else
2428
-						echo $dayheader;
2431
+					if(in_array($curday, $posts)) {
2432
+											echo '<a href="blog.php?blog_id=' . $blog_id . '&filter=' . $year . '-' . $month . '-' . $curday . '&month=' . $month . '&year=' . $year . '" title="' . get_lang('ViewPostsOfThisDay') . '">' . $curday . '</a>';
2433
+					} else {
2434
+											echo $dayheader;
2435
+					}
2429 2436
 
2430 2437
 					if (count($tasks) > 0) {
2431 2438
 						if (isset($tasks[$curday]) && is_array($tasks[$curday])) {
@@ -2440,8 +2447,9 @@  discard block
 block discarded – undo
2440 2447
 
2441 2448
 					echo "</td>";
2442 2449
 					$curday ++;
2443
-				} else
2444
-					echo "<td>&nbsp;</td>";
2450
+				} else {
2451
+									echo "<td>&nbsp;</td>";
2452
+				}
2445 2453
 			}
2446 2454
 			echo "</tr>";
2447 2455
 		}
Please login to merge, or discard this patch.
main/search/search_suggestions.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,6 +115,8 @@
 block discarded – undo
115 115
 }
116 116
 
117 117
 $q = strtolower($_GET["term"]);
118
-if (!$q) return;
118
+if (!$q) {
119
+    return;
120
+}
119 121
 //echo $q . "| value\n";
120 122
 get_suggestions_from_search_engine($q);
Please login to merge, or discard this patch.
main/document/edit_draw.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,13 +90,14 @@
 block discarded – undo
90 90
 
91 91
 $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
92 92
 
93
-if (!$is_certificate_mode)
93
+if (!$is_certificate_mode) {
94 94
 	$interbreadcrumb[] = array(
95 95
 		"url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(),
96 96
 		"name" => get_lang('Documents')
97 97
 	);
98
-else
98
+} else {
99 99
 	$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
100
+}
100 101
 
101 102
 // Interbreadcrumb for the current directory root path
102 103
 if (empty($document_data['parents'])) {
Please login to merge, or discard this patch.
main/exercice/export/aiken/aiken_classes.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@
 block discarded – undo
7 7
  * @package chamilo.exercise
8 8
  */
9 9
 
10
-if ( count( get_included_files() ) == 1 ) die( '---' );
10
+if ( count( get_included_files() ) == 1 ) {
11
+    die( '---' );
12
+}
11 13
 
12 14
 if (!function_exists('mime_content_type')) {
13 15
 
Please login to merge, or discard this patch.
main/auth/shibboleth/test/shibboleth_test.class.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,8 +207,7 @@
 block discarded – undo
207 207
             // Dump variable for debug
208 208
             var_dump(debug_backtrace());
209 209
             die;
210
-        }
211
-        else
210
+        } else
212 211
         {
213 212
             $message = "Assert successful $message <br/>";
214 213
             echo $message;
Please login to merge, or discard this patch.
main/admin/user_update_import.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -464,7 +464,10 @@
 block discarded – undo
464 464
 <blockquote>
465 465
     <pre>
466 466
         <b>UserName</b>;LastName;FirstName;Email;NewUserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;Active;Language;Courses;ClassId;
467
-        xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;user/teacher/drh;YYYY-MM-DD 00:00:00;0/1;xxx;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br />
467
+        xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;xxx;user/teacher/drh;YYYY-MM-DD 00:00:00;0/1;xxx;<span style="color:red;"><?php if (count($list_reponse) > 0) {
468
+    echo implode(';', $list_reponse).';';
469
+}
470
+?></span>xxx1|xxx2|xxx3;1;<br />
468 471
     </pre>
469 472
 </blockquote>
470 473
 <p><?php
Please login to merge, or discard this patch.