Passed
Push — 1.10.x ( 767d99...288426 )
by Yannick
44:51
created
main/admin/group_edit.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,8 +109,7 @@
 block discarded – undo
109 109
 	$picture_uri = $group_data['picture_uri'];
110 110
 	if ($group['delete_picture']) {
111 111
 		$picture_uri = GroupPortalManager::delete_group_picture($group_id);
112
-		}
113
-	elseif (!empty($picture['name'])) {
112
+		} elseif (!empty($picture['name'])) {
114 113
         $picture_uri = GroupPortalManager::update_group_picture(
115 114
             $group_id,
116 115
             $_FILES['picture']['name'],
Please login to merge, or discard this patch.
main/admin/access_url_edit_courses_to_url.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -108,8 +108,9 @@  discard block
 block discarded – undo
108 108
 
109 109
 api_display_tool_title($tool_name);
110 110
 
111
-if (isset($_GET['action']) && $_GET['action'] == 'show_message')
111
+if (isset($_GET['action']) && $_GET['action'] == 'show_message') {
112 112
 	Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
113
+}
113 114
 
114 115
 $no_course_list = $course_list = array();
115 116
 $ajax_search = $add_type == 'unique' ? true : false;
@@ -261,10 +262,11 @@  discard block
 block discarded – undo
261 262
 				<td colspan="3" align="center">
262 263
 					<br />
263 264
 					<?php
264
-					if(isset($_GET['add']))
265
-						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
266
-					else
267
-						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
265
+					if(isset($_GET['add'])) {
266
+											echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
267
+					} else {
268
+											echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
269
+					}
268 270
 					?>
269 271
 				</td>
270 272
 			</tr>
Please login to merge, or discard this patch.
main/admin/archive_cleanup.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,10 +49,11 @@
 block discarded – undo
49 49
 Display::display_warning_message(get_lang('ArchiveDirCleanupDescr'));
50 50
 
51 51
 if (isset($_GET['msg']) && isset($_GET['type'])) {
52
-	if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed')))
53
-	switch($_GET['type']) {
52
+	if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) {
53
+		switch($_GET['type']) {
54 54
 		case 'error':
55 55
 			$message = Display::return_message(get_lang($_GET['msg']), 'error');
56
+	}
56 57
 			break;
57 58
 		case 'confirmation':
58 59
 			$message = Display::return_message(get_lang($_GET['msg']), 'confirm');
Please login to merge, or discard this patch.
main/admin/subscribe_user2class.php 1 patch
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
                 exit();
64 64
             }
65 65
         } elseif ($remove_from_class) {
66
-            if (count($right_user_list) == 0)
67
-                $error_message = get_lang('AtLeastOneUser');
68
-            else {
66
+            if (count($right_user_list) == 0) {
67
+                            $error_message = get_lang('AtLeastOneUser');
68
+            } else {
69 69
                 foreach ($right_user_list as $index => $user_id) {
70 70
                     ClassManager :: unsubscribe_user($user_id, $class_id);
71 71
                 }
@@ -122,7 +122,10 @@  discard block
 block discarded – undo
122 122
                 <?php
123 123
                 foreach ($left_users as $user) {
124 124
                     ?>
125
-                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
125
+                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) {
126
+    echo 'selected="selected"';
127
+}
128
+?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
126 129
                         <?php
127 130
                     }
128 131
                     ?>
@@ -138,7 +141,10 @@  discard block
 block discarded – undo
138 141
                     <?php
139 142
                     foreach ($right_users as $user) {
140 143
                         ?>
141
-                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
144
+                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) {
145
+    echo 'selected="selected"';
146
+}
147
+?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
142 148
     <?php
143 149
 }
144 150
 ?>
Please login to merge, or discard this patch.
main/admin/subscribe_user2course.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -285,7 +285,10 @@  discard block
 block discarded – undo
285 285
 <?php
286 286
     foreach ($db_users as $user) {
287 287
 ?>
288
-      <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) echo 'selected="selected"'; ?>>
288
+      <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) {
289
+    echo 'selected="selected"';
290
+}
291
+?>>
289 292
       <?php
290 293
         $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')';
291 294
         if ($showOfficialCode) {
@@ -312,7 +315,10 @@  discard block
 block discarded – undo
312 315
 <?php
313 316
     foreach ($db_courses as $course) {
314 317
 ?>
315
-     <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>>
318
+     <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) {
319
+    echo 'selected="selected"';
320
+}
321
+?>>
316 322
          <?php echo '('.$course['visual_code'].') '.$course['title']; ?>
317 323
      </option>
318 324
 <?php
Please login to merge, or discard this patch.
main/admin/legal_list.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,9 @@
 block discarded – undo
24 24
 
25 25
 // Actions
26 26
 if (isset ($_GET['action'])) {
27
-	if ($_GET['action'] == 'show_message')
28
-		Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
27
+	if ($_GET['action'] == 'show_message') {
28
+			Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
29
+	}
29 30
 	Security::clear_token();
30 31
 }
31 32
 
Please login to merge, or discard this patch.
main/admin/add_sessions_to_promotion.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,10 @@
 block discarded – undo
144 144
 echo '</div>';
145 145
 ?>
146 146
 
147
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
147
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) {
148
+    echo '&add=true' ;
149
+}
150
+?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
148 151
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
149 152
 
150 153
 if ($add_type=='multiple') {
Please login to merge, or discard this patch.
main/admin/access_url_edit_usergroup_to_url.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -254,10 +254,11 @@
 block discarded – undo
254 254
 	<td colspan="3" align="center">
255 255
 		<br />
256 256
 		<?php
257
-		if(isset($_GET['add']))
258
-			echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>';
259
-		else
260
-			echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>';
257
+		if(isset($_GET['add'])) {
258
+					echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>';
259
+		} else {
260
+					echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>';
261
+		}
261 262
 		?>
262 263
 	</td>
263 264
 </tr>
Please login to merge, or discard this patch.
main/admin/settings.lib.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -471,8 +471,9 @@  discard block
 block discarded – undo
471 471
                     $extraction_path = $cssToUpload.$style_name.'/';
472 472
                     for ($i = 0; $i < $num_files; $i++) {
473 473
                         $entry = $zip->getNameIndex($i);
474
-                        if (substr($entry, -1) == '/')
475
-                            continue;
474
+                        if (substr($entry, -1) == '/') {
475
+                                                    continue;
476
+                        }
476 477
 
477 478
                         $pos_slash = strpos($entry, '/');
478 479
                         $entry_without_first_dir = substr($entry, $pos_slash + 1);
@@ -1231,17 +1232,21 @@  discard block
 block discarded – undo
1231 1232
                 $hideme = array('disabled');
1232 1233
             } elseif ($url_info['active'] == 1) {
1233 1234
                 // We show the elements.
1234
-                if (empty($row['variable']))
1235
-                    $row['variable'] = 0;
1236
-                if (empty($row['subkey']))
1237
-                    $row['subkey'] = 0;
1238
-                if (empty($row['category']))
1239
-                    $row['category'] = 0;
1235
+                if (empty($row['variable'])) {
1236
+                                    $row['variable'] = 0;
1237
+                }
1238
+                if (empty($row['subkey'])) {
1239
+                                    $row['subkey'] = 0;
1240
+                }
1241
+                if (empty($row['category'])) {
1242
+                                    $row['category'] = 0;
1243
+                }
1240 1244
 
1241 1245
                 if (is_array($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ])) {
1242 1246
                     // We are sure that the other site have a selected value.
1243
-                    if ($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ]['selected_value'] != '')
1244
-                        $row['selected_value'] = $settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value'];
1247
+                    if ($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ]['selected_value'] != '') {
1248
+                                            $row['selected_value'] = $settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value'];
1249
+                    }
1245 1250
                 }
1246 1251
                 // There is no else{} statement because we load the default $row['selected_value'] of the main Chamilo site.
1247 1252
             }
Please login to merge, or discard this patch.