Passed
Push — 1.10.x ( 12c7e7...f34bae )
by Angel Fernando Quiroz
46:03
created
main/mySpace/myStudents.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 
824 824
                     if ($progress === null) {
825 825
                         $progress = '0%';
826
-                    }  else {
826
+                    } else {
827 827
                         $any_result = true;
828 828
                     }
829 829
 
@@ -853,7 +853,9 @@  discard block
 block discarded – undo
853 853
                         $start_time =  '-';
854 854
                     }
855 855
 
856
-                    if (!empty($total_time)) $any_result = true;
856
+                    if (!empty($total_time)) {
857
+                        $any_result = true;
858
+                    }
857 859
 
858 860
                     // Quiz in lp
859 861
                     $score = Tracking::get_avg_student_score(
@@ -873,8 +875,11 @@  discard block
 block discarded – undo
873 875
                         true
874 876
                     );
875 877
 
876
-                    if ($i % 2 == 0) $css_class = "row_even";
877
-                    else $css_class = "row_odd";
878
+                    if ($i % 2 == 0) {
879
+                        $css_class = "row_even";
880
+                    } else {
881
+                        $css_class = "row_odd";
882
+                    }
878 883
 
879 884
                     $i++;
880 885
 
@@ -1042,9 +1047,10 @@  discard block
 block discarded – undo
1042 1047
                 $result_last_attempt = Database::query($sql);
1043 1048
                 if (Database :: num_rows($result_last_attempt) > 0) {
1044 1049
                     $id_last_attempt = Database :: result($result_last_attempt, 0, 0);
1045
-                    if ($count_attempts > 0)
1046
-                        echo '<a href="../exercice/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin)?'tracking':$origin).'">
1050
+                    if ($count_attempts > 0) {
1051
+                                            echo '<a href="../exercice/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin)?'tracking':$origin).'">
1047 1052
                         <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" border="0" /> </a>';
1053
+                    }
1048 1054
                 }
1049 1055
                 echo '</td>';
1050 1056
 
Please login to merge, or discard this patch.
main/wiki/wiki.inc.php 1 patch
Braces   +4 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1878,7 +1878,7 @@  discard block
 block discarded – undo
1878 1878
                 $email_body = get_lang('DearUser').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).',<br /><br />';
1879 1879
                 if($session_id==0){
1880 1880
                     $email_body .= $emailtext.' <strong>'.$_course['name'].' - '.$group_name.'</strong><br /><br /><br />';
1881
-                }else{
1881
+                } else{
1882 1882
                     $email_body .= $emailtext.' <strong>'.$_course['name'].' ('.api_get_session_name(api_get_session_id()).') - '.$group_name.'</strong><br /><br /><br />';
1883 1883
                 }
1884 1884
                 $email_body .= $email_user_author.' ('.$email_date_changes.')<br /><br /><br />';
@@ -2261,8 +2261,7 @@  discard block
 block discarded – undo
2261 2261
                                         s1.reflink = s2.reflink AND
2262 2262
                                         ".$groupfilter.$condition_session.")";
2263 2263
                     // warning don't use group by reflink because don't return the last version
2264
-                }
2265
-                else {
2264
+                } else {
2266 2265
                     $sql = " SELECT * FROM ".$tbl_wiki." s1
2267 2266
                             WHERE
2268 2267
                                 s1.c_id = $course_id AND
@@ -3696,8 +3695,7 @@  discard block
 block discarded – undo
3696 3695
                 '.api_htmlentities($obj->title).'</a>';
3697 3696
                 if ($obj->user_id <>0) {
3698 3697
                     $row[] = UserManager::getUserProfileLink($userinfo);
3699
-                }
3700
-                else {
3698
+                } else {
3701 3699
                     $row[] = get_lang('Anonymous').' ('.api_htmlentities($obj->user_ip).')';
3702 3700
                 }
3703 3701
                 $row[] = api_get_local_time($obj->dtime, null, date_default_timezone_get());
@@ -3932,8 +3930,7 @@  discard block
 block discarded – undo
3932 3930
                         api_htmlentities($obj->title).'</a>';
3933 3931
                     if ($obj->user_id <>0) {
3934 3932
                         $row[] = UserManager::getUserProfileLink($userinfo);
3935
-                    }
3936
-                    else {
3933
+                    } else {
3937 3934
                         $row[] = get_lang('Anonymous').' ('.$obj->user_ip.')';
3938 3935
                     }
3939 3936
                     $row[] = $year.'-'.$month.'-'.$day.' '.$hours.":".$minutes.":".$seconds;
Please login to merge, or discard this patch.
main/coursecopy/classes/CourseSelectForm.class.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -527,14 +527,15 @@
 block discarded – undo
527 527
 						// Mark folders to import which are not selected by the user to import,
528 528
 						// but in which a document was selected.
529 529
 						$documents = isset($_POST['resource'][RESOURCE_DOCUMENT]) ? $_POST['resource'][RESOURCE_DOCUMENT] : null;
530
-						if (!empty($resources) && is_array($resources))
531
-							foreach ($resources as $id => $obj) {
530
+						if (!empty($resources) && is_array($resources)) {
531
+													foreach ($resources as $id => $obj) {
532 532
 								if (isset($obj->file_type) && $obj->file_type == 'folder' &&
533 533
                                     !isset($_POST['resource'][RESOURCE_DOCUMENT][$id]) &&
534 534
                                     is_array($documents)
535 535
                                 ) {
536 536
 									foreach ($documents as $id_to_check => $post_value) {
537 537
 										$obj_to_check = $resources[$id_to_check];
538
+						}
538 539
 										$shared_path_part = substr($obj_to_check->path,0,strlen($obj->path));
539 540
 										if ($id_to_check != $id && $obj->path == $shared_path_part) {
540 541
 											$_POST['resource'][RESOURCE_DOCUMENT][$id] = 1;
Please login to merge, or discard this patch.
main/coursecopy/classes/CourseRestorer.class.php 1 patch
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -512,7 +512,9 @@  discard block
 block discarded – undo
512 512
 
513 513
                                     if (in_array($file_info['extension'], array('html', 'htm'))) {
514 514
                                         $content = file_get_contents($path.$document->path);
515
-                                        if (UTF8_CONVERT) $content = utf8_encode($content);
515
+                                        if (UTF8_CONVERT) {
516
+                                            $content = utf8_encode($content);
517
+                                        }
516 518
                                         $content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
517 519
                                             $content,
518 520
                                             $this->course->code,
@@ -2240,7 +2242,11 @@  discard block
 block discarded – undo
2240 2242
 		            c_id = ".$this->destination_course_id." AND
2241 2243
 		            code='".self::DBUTF8escapestring($survey_code)."'";
2242 2244
 		$result = Database::query($sql);
2243
-		if (Database::num_rows($result) > 0) return false; else return true;
2245
+		if (Database::num_rows($result) > 0) {
2246
+		    return false;
2247
+		} else {
2248
+		    return true;
2249
+		}
2244 2250
 	}
2245 2251
 
2246 2252
 	/**
@@ -2719,8 +2725,9 @@  discard block
 block discarded – undo
2719 2725
                             echo '<font color="red">File ('.$path.') '.get_lang('NotHavePermission').'</font>';
2720 2726
                         }*/
2721 2727
                     } elseif(is_dir($path)) {
2722
-                        if (!is_dir($dest . '/' . $file))
2723
-                        mkdir($dest . '/' . $file);
2728
+                        if (!is_dir($dest . '/' . $file)) {
2729
+                                                mkdir($dest . '/' . $file);
2730
+                        }
2724 2731
                        self:: allow_create_all_directory($path, $dest . '/' . $file, $overwrite);
2725 2732
                     }
2726 2733
                 }
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
@@ -104,6 +104,8 @@
 block discarded – undo
104 104
 }
105 105
 
106 106
 $q = strtolower($_GET["q"]);
107
-if (!$q) return;
107
+if (!$q) {
108
+    return;
109
+}
108 110
 //echo $q . "| value\n";
109 111
 get_suggestions_from_search_engine($q);
Please login to merge, or discard this patch.
main/permissions/group_permissions.inc.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,9 +97,11 @@
 block discarded – undo
97 97
 echo "\t</tr>\n";
98 98
 
99 99
 // the main area with the checkboxes or images
100
-foreach ($tool_rights as $tool=>$rights) // $tool_rights contains all the possible tools and their rights
100
+foreach ($tool_rights as $tool=>$rights) {
101
+    // $tool_rights contains all the possible tools and their rights
101 102
 {
102 103
 	echo "\t<tr>\n";
104
+}
103 105
 	echo "\t\t<td>\n";
104 106
 	echo get_lang($tool);
105 107
 	echo "\t\t</td>\n";
Please login to merge, or discard this patch.
main/permissions/permissions_functions.inc.php 1 patch
Braces   +10 added lines, -16 removed lines patch added patch discarded remove patch
@@ -132,24 +132,20 @@  discard block
 block discarded – undo
132 132
 	{
133 133
 		$table=Database::get_course_table(TABLE_PERMISSION_USER);
134 134
 		$id_field = 'user_id';
135
-	}
136
-	elseif ($content == 'group')
135
+	} elseif ($content == 'group')
137 136
 	{
138 137
 		$table=Database::get_course_table(TABLE_PERMISSION_GROUP);
139 138
 		$id_field = 'group_id';
140
-	}
141
-	elseif ($content == 'role')
139
+	} elseif ($content == 'role')
142 140
 	{
143 141
 		$table=Database::get_course_table(TABLE_ROLE_PERMISSION);
144 142
 		$id_field = 'role_id';
145
-	}
146
-	elseif ($content == 'platform_role')
143
+	} elseif ($content == 'platform_role')
147 144
 	{
148 145
 		$table=Database::get_main_table(TABLE_ROLE_PERMISSION);
149 146
 		$id_field = 'role_id';
150 147
         $course_id_condition = '';
151
-	}
152
-	elseif ($content == 'task')
148
+	} elseif ($content == 'task')
153 149
 	{
154 150
 		$table=Database::get_course_table(TABLE_BLOGS_TASKS_PERMISSIONS);
155 151
 		$id_field = 'task_id';
@@ -162,8 +158,9 @@  discard block
 block discarded – undo
162 158
 		WHERE $course_id_condition " . $id_field . "='" . Database::escape_string($id) . "'";
163 159
 	$result = Database::query($sql);
164 160
 
165
-	while($row = Database::fetch_array($result))
166
-		$currentpermissions[$row['tool']][] = $row['action'];
161
+	while($row = Database::fetch_array($result)) {
162
+			$currentpermissions[$row['tool']][] = $row['action'];
163
+	}
167 164
 
168 165
 	return $currentpermissions;
169 166
 }
@@ -321,14 +318,12 @@  discard block
 block discarded – undo
321 318
 	if ($course_admin)
322 319
 	{
323 320
 		echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
324
-	}
325
-	else
321
+	} else
326 322
 	{
327 323
 		if (!empty($inherited_permissions) and in_array($permission,$inherited_permissions[$tool]))
328 324
 		{
329 325
 			echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
330
-		}
331
-		else
326
+		} else
332 327
 		{
333 328
 			if (is_array($permission_array[$tool]) AND in_array($permission,$permission_array[$tool]))
334 329
 			{
@@ -439,8 +434,7 @@  discard block
 block discarded – undo
439 434
 			$checked='checked';
440 435
 			$image='checkbox_on2.gif';
441 436
 			$action='revoke';
442
-		}
443
-		else
437
+		} else
444 438
 		{
445 439
 			$checked='';
446 440
 			$image='wrong.gif';
Please login to merge, or discard this patch.
main/permissions/user_permissions.inc.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -140,9 +140,11 @@  discard block
 block discarded – undo
140 140
 echo "\t</tr>\n";
141 141
 
142 142
 // the main area with the checkboxes or images
143
-foreach ($tool_rights as $tool=>$rights) // $tool_rights contains all the possible tools and their rights
143
+foreach ($tool_rights as $tool=>$rights) {
144
+    // $tool_rights contains all the possible tools and their rights
144 145
 {
145 146
 	echo "\t<tr>\n";
147
+}
146 148
 	echo "\t\t<td>\n";
147 149
 	if (strstr($tool,'BLOG'))
148 150
 	{
@@ -152,8 +154,7 @@  discard block
 block discarded – undo
152 154
 		$blog_id = substr($tool,$tmp,strlen($tool));
153 155
 		// Get title
154 156
 		echo get_lang('Blog').": ".Blog::get_blog_title($blog_id);
155
-	}
156
-	else
157
+	} else
157 158
 	{
158 159
 		echo get_lang($tool);
159 160
 	}
Please login to merge, or discard this patch.
main/permissions/roles.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
 		$result=Database::query($sql);
27 27
 		$role_id=Database::insert_id();
28 28
 		$result_message=store_permissions('role', $role_id);
29
-	}
30
-	else
29
+	} else
31 30
 	{
32 31
 		$result_message=get_lang('ErrorPleaseGiveRoleName');
33 32
 	}
@@ -122,9 +121,11 @@  discard block
 block discarded – undo
122 121
 	echo "\t</tr>\n";
123 122
 
124 123
 	// the main area with the checkboxes or images
125
-	foreach ($tool_rights as $tool=>$rights) // $tool_rights contains all the possible tools and their rights
124
+	foreach ($tool_rights as $tool=>$rights) {
125
+	    // $tool_rights contains all the possible tools and their rights
126 126
 	{
127 127
 		echo "\t<tr>\n";
128
+	}
128 129
 		echo "\t\t<td>\n";
129 130
 		echo get_lang($tool);
130 131
 		echo "\t\t</td>\n";
@@ -216,9 +217,11 @@  discard block
 block discarded – undo
216 217
 	echo "\t</tr>\n";
217 218
 
218 219
 	// the main area with the checkboxes or images
219
-	foreach ($tool_rights as $tool=>$rights) // $tool_rights contains all the possible tools and their rights
220
+	foreach ($tool_rights as $tool=>$rights) {
221
+	    // $tool_rights contains all the possible tools and their rights
220 222
 	{
221 223
 		echo "\t<tr>\n";
224
+	}
222 225
 		echo "\t\t<td>\n";
223 226
 		echo get_lang($tool);
224 227
 		echo "\t\t</td>\n";
@@ -237,8 +240,7 @@  discard block
 block discarded – undo
237 240
 					if ($_GET['scope']=='platform')
238 241
 					{
239 242
 						$roles_editable=false;
240
-					}
241
-					else
243
+					} else
242 244
 					{
243 245
 						$roles_editable=true;
244 246
 					}
Please login to merge, or discard this patch.