Passed
Push — master ( 44f182...c7a958 )
by Anthony
03:07
created
admin/views/configuration/base-de-donnees.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <script src="<?=LIBSWEBROOT?>popup/js/popup.js"></script>
9 9
 <link rel="stylesheet" type="text/css" href="<?=LIBSWEBROOT?>checkbox/css/style.css">
10 10
 <script src="<?=LIBSWEBROOT?>checkbox/js/anim.js"></script>
11
-<?php require_once('header.php');?>
11
+<?php require_once('header.php'); ?>
12 12
 
13 13
 <div class="inner">
14 14
 	<a class="submit-contenu supprimer-page link" href="<?=ADMWEBROOT?>configuration/index"><i class="fa fa-times"></i>Annuler</a>
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 					<td>Le site est il toujours en développement</td>
21 21
 					<td>
22 22
 						<label for="developpement" class="checkbox-perso switched">
23
-							<input type="checkbox" class="test-check" id="developpement" name="developpement" <?php if ($developpement == 1): ?>checked<?php endif;?>>
23
+							<input type="checkbox" class="test-check" id="developpement" name="developpement" <?php if ($developpement == 1): ?>checked<?php endif; ?>>
24 24
 						</label>
25 25
 					</td>
26 26
 				</tr>
Please login to merge, or discard this patch.
admin/views/notifications.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
 					</tr>
23 23
 				</thead>
24 24
 				<tbody>
25
-					<?php for ($i=0 ; $i<count($gestion_module->getNom()) ; $i++):?>
25
+					<?php for ($i = 0; $i < count($gestion_module->getNom()); $i++):?>
26 26
 						<tr>
27 27
 							<td><?=$gestion_module->getNom()[$i]?></td>
28 28
 							<td><?=$gestion_module->getVersion()[$i]?></td>
29 29
 							<td><?=$gestion_module->getOnlineVersion()[$i]?></td>
30 30
 						</tr>
31
-					<?php endfor;?>
31
+					<?php endfor; ?>
32 32
 				</tbody>
33 33
 			</table>
34 34
 
@@ -37,6 +37,6 @@  discard block
 block discarded – undo
37 37
 				soit par le menu ou en cliquant sur le lien ci-dessous.
38 38
 			</p>
39 39
 			<a href="<?=ADMWEBROOT?>configuration/module" class="submit-contenu submit-standard no-shadow inline ml0">Configuration des modules</a>
40
-		<?php endif;?>
40
+		<?php endif; ?>
41 41
 	</div>
42 42
 </div>
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
core/HTML/flashmessage/FlashMessage.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 		 * @param string $message message a affiche dans la popup d'erreur
16 16
 		 * @param string $type type du message (error, success, info)
17 17
 		 */
18
-		public static function setFlash($message, $type="error") {
18
+		public static function setFlash($message, $type = "error") {
19 19
 			if (session_id() == "") {
20 20
 				session_start();
21 21
 			}
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,11 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 			if ($type == "error") {
24 24
 				$icone = "<i class='fa fa-close'></i>";
25
-			}
26
-			else if ($type == "success") {
25
+			} else if ($type == "success") {
27 26
 				$icone = "<i class='fa fa-check'></i>";
28
-			}
29
-			else {
27
+			} else {
30 28
 				$icone = "<i class='fa fa-info'></i>";
31 29
 			}
32 30
 
@@ -55,16 +53,14 @@  discard block
 block discarded – undo
55 53
 					if (strstr($_SERVER['SCRIPT_NAME'], "index.php")) {
56 54
 						//definit le chemin sachant que l'on part de index.php
57 55
 						$chemin = str_replace("\\", "/", str_replace("index.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/");
58
-					}
59
-					else {
56
+					} else {
60 57
 						//definit le chemin sachant que l'on part de admin.php
61 58
 						$chemin = str_replace("\\", "/", str_replace("admin.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/");
62 59
 					}
63 60
 
64 61
 
65 62
 					require("view/index.php");
66
-				}
67
-				else {
63
+				} else {
68 64
 					echo("$icone $type : $message");
69 65
 				}
70 66
 				unset($_SESSION['flash']);
Please login to merge, or discard this patch.
core/images/Images.class.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@
 block discarded – undo
43 43
 		//-------------------------- GETTER ----------------------------------------------------------------------------//
44 44
 
45 45
 		public function getOldImage() {
46
-		    return $this->old_image;
46
+			return $this->old_image;
47 47
 		}
48 48
 		public function getCheminImage() {
49
-		    return $this->chemin_image;
49
+			return $this->chemin_image;
50 50
 		}
51 51
 		public function getErreur() {
52
-		    return $this->erreur;
52
+			return $this->erreur;
53 53
 		}
54 54
 		public function getNomImage() {
55 55
 			return $this->nom_image;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		 * @param int $delete_old_img
76 76
 		 * @return null|boolean -> renvoi false si err sinon renvoi le chemin vers l'img
77 77
 		 */
78
-		public function setEnvoyerImage($name, $old_image_req=null, $autorize_empty=1, $delete_old_img=1) {
78
+		public function setEnvoyerImage($name, $old_image_req = null, $autorize_empty = 1, $delete_old_img = 1) {
79 79
 			$dbc = App::getDb();
80 80
 
81 81
 			$this->old_image = null;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		 * @param null $req_img
146 146
 		 * @return string
147 147
 		 */
148
-		public function setResizeImage($width, $height, $prefixe, $delete_old=1, $req_img=null) {
148
+		public function setResizeImage($width, $height, $prefixe, $delete_old = 1, $req_img = null) {
149 149
 			if (($req_img == null) && ($this->chemin_image != "")) {
150 150
 				$this->getImage();
151 151
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		 * @param null|string $nom_image
172 172
 		 * @return boolean|null
173 173
 		 */
174
-		public function setDeleteImage($nom_image=null) {
174
+		public function setDeleteImage($nom_image = null) {
175 175
 			//si pas de requete et qu'on a une old_img on la supprime
176 176
 			if (($this->old_image != "") && ($nom_image == null)) {
177 177
 				$old_image = explode("/", $this->old_image);
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
 				if (is_array($nom_image)) {
188 188
 					$count = count($nom_image);
189
-					for ($i=0 ; $i<$count ; $i++) {
189
+					for ($i = 0; $i < $count; $i++) {
190 190
 						$chemin_img = $this->dossier_image."/".$nom_image[$i];
191 191
 
192 192
 						if (unlink($chemin_img)) {
Please login to merge, or discard this patch.
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
 				$explode = explode("/", $this->chemin_image);
59 59
 				$this->image = end($explode);
60 60
 				return $this->image;
61
-			}
62
-			else {
61
+			} else {
63 62
 				$this->erreur = "Impossible de trouver votre image, vuellez réessayer dans un instant";
64 63
 				return false;
65 64
 			}
@@ -89,8 +88,7 @@  discard block
 block discarded – undo
89 88
 					$this->erreur = "Vous devez obligatoirement ajouter une image";
90 89
 					return false;
91 90
 				}
92
-			}
93
-			else {
91
+			} else {
94 92
 				//test si il y a deja une img
95 93
 				if ($old_image_req != null) {
96 94
 					$query = $dbc->query($old_image_req);
@@ -108,12 +106,10 @@  discard block
 block discarded – undo
108 106
 				if (!in_array(substr($image, -3), $this->autorized_extention)) {
109 107
 					$this->erreur = "Votre image ne comporte pas l'extension jpg, png, jpeg, gif, JPG, PNG, JPEG, GIF";
110 108
 					return false;
111
-				}
112
-				else if (($infos_img[0] >= $this->width_max) && ($infos_img[1] >= $this->height_max) && ($_FILES[$name]['size'] >= $this->poid_max)) {
109
+				} else if (($infos_img[0] >= $this->width_max) && ($infos_img[1] >= $this->height_max) && ($_FILES[$name]['size'] >= $this->poid_max)) {
113 110
 					$this->erreur = "Problème dans les dimensions ou taille de l'image.";
114 111
 					return false;
115
-				}
116
-				else {
112
+				} else {
117 113
 					$uniqid = uniqid();
118 114
 
119 115
 					if (move_uploaded_file($_FILES[$name]['tmp_name'], $this->dossier_image."/".$uniqid.substr($image, -4))) {
@@ -128,8 +124,7 @@  discard block
 block discarded – undo
128 124
 						}
129 125
 
130 126
 						return true;
131
-					}
132
-					else {
127
+					} else {
133 128
 						$this->erreur = "Impossible d'envoyer votre image sur le serveur, veuillez réessayer dans une instant, si l'erreur se reproduit, contactez votre administrateur";
134 129
 					}
135 130
 				}
@@ -155,8 +150,7 @@  discard block
 block discarded – undo
155 150
 				$resize->saveImage($this->dossier_image."/".$img_resize, 100);
156 151
 
157 152
 				$this->nom_image = $img_resize;
158
-			}
159
-			else {
153
+			} else {
160 154
 				$this->nom_image = null;
161 155
 			}
162 156
 
@@ -181,8 +175,7 @@  discard block
 block discarded – undo
181 175
 					unlink($this->dossier_image."/".end($old_image));
182 176
 					return true;
183 177
 				}
184
-			}
185
-			else if ($nom_image !== null) {
178
+			} else if ($nom_image !== null) {
186 179
 
187 180
 				if (is_array($nom_image)) {
188 181
 					$count = count($nom_image);
@@ -191,27 +184,22 @@  discard block
 block discarded – undo
191 184
 
192 185
 						if (unlink($chemin_img)) {
193 186
 							$success = true;
194
-						}
195
-						else {
187
+						} else {
196 188
 							if (unlink($this->chemin_image)) {
197 189
 								$success = true;
198
-							}
199
-							else {
190
+							} else {
200 191
 								$this->erreur = "Impossible de supprimer cette image, veuillez réesayer dans un instant, sinon contacter l'administrateur de votre site";
201 192
 								$success = false;
202 193
 							}
203 194
 						}
204 195
 					}
205
-				}
206
-				else {
196
+				} else {
207 197
 					if (unlink($this->dossier_image."/".$nom_image)) {
208 198
 						$success = true;
209
-					}
210
-					else {
199
+					} else {
211 200
 						if (unlink($this->chemin_image)) {
212 201
 							$success = true;
213
-						}
214
-						else {
202
+						} else {
215 203
 							$this->erreur = "Impossible de supprimer cette image, veuillez réesayer dans un instant, sinon contacter l'administrateur de votre site";
216 204
 							$success = false;
217 205
 						}
@@ -219,8 +207,7 @@  discard block
 block discarded – undo
219 207
 				}
220 208
 
221 209
 				return $success;
222
-			}
223
-			else {
210
+			} else {
224 211
 				$this->erreur = "Impossible de supprimer cette image";
225 212
 				return false;
226 213
 			}
Please login to merge, or discard this patch.
core/images/Resize.class.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 		{
22 22
 			// *** Class variables
23 23
 			private $image;
24
-		    private $width;
25
-		    private $height;
24
+			private $width;
25
+			private $height;
26 26
 			private $imageResized;
27 27
 
28 28
 			function __construct($fileName)
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 				// *** Open up the file
31 31
 				$this->image = $this->openImage($fileName);
32 32
 
33
-			    // *** Get width and height
34
-			    $this->width  = imagesx($this->image);
35
-			    $this->height = imagesy($this->image);
33
+				// *** Get width and height
34
+				$this->width  = imagesx($this->image);
35
+				$this->height = imagesy($this->image);
36 36
 			}
37 37
 
38 38
 			## --------------------------------------------------------
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
 			public function saveImage($savePath, $imageQuality="100")
207 207
 			{
208 208
 				// *** Get extension
209
-        		$extension = strrchr($savePath, '.');
210
-       			$extension = strtolower($extension);
209
+				$extension = strrchr($savePath, '.');
210
+	   			$extension = strtolower($extension);
211 211
 
212 212
 				switch($extension)
213 213
 				{
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				// *** Get extension
43 43
 				$extension = strtolower(strrchr($file, '.'));
44 44
 
45
-				switch($extension)
45
+				switch ($extension)
46 46
 				{
47 47
 					case '.jpg':
48 48
 					case '.jpeg':
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 			## --------------------------------------------------------
65 65
 
66
-			public function resizeImage($newWidth, $newHeight, $option="auto")
66
+			public function resizeImage($newWidth, $newHeight, $option = "auto")
67 67
 			{
68 68
 				// *** Get optimal width and height - based on $option
69 69
 				$optionArray = $this->getDimensions($newWidth, $newHeight, $option);
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
 				{
93 93
 					case 'exact':
94 94
 						$optimalWidth = $newWidth;
95
-						$optimalHeight= $newHeight;
95
+						$optimalHeight = $newHeight;
96 96
 						break;
97 97
 					case 'portrait':
98 98
 						$optimalWidth = $this->getSizeByFixedHeight($newHeight);
99
-						$optimalHeight= $newHeight;
99
+						$optimalHeight = $newHeight;
100 100
 						break;
101 101
 					case 'landscape':
102 102
 						$optimalWidth = $newWidth;
103
-						$optimalHeight= $this->getSizeByFixedWidth($newWidth);
103
+						$optimalHeight = $this->getSizeByFixedWidth($newWidth);
104 104
 						break;
105 105
 					case 'auto':
106 106
 						$optionArray = $this->getSizeByAuto($newWidth, $newHeight);
@@ -138,27 +138,27 @@  discard block
 block discarded – undo
138 138
 				// *** Image to be resized is wider (landscape)
139 139
 				{
140 140
 					$optimalWidth = $newWidth;
141
-					$optimalHeight= $this->getSizeByFixedWidth($newWidth);
141
+					$optimalHeight = $this->getSizeByFixedWidth($newWidth);
142 142
 				}
143 143
 				elseif ($this->height > $this->width)
144 144
 				// *** Image to be resized is taller (portrait)
145 145
 				{
146 146
 					$optimalWidth = $this->getSizeByFixedHeight($newHeight);
147
-					$optimalHeight= $newHeight;
147
+					$optimalHeight = $newHeight;
148 148
 				}
149 149
 				else
150 150
 				// *** Image to be resizerd is a square
151 151
 				{
152 152
 					if ($newHeight < $newWidth) {
153 153
 						$optimalWidth = $newWidth;
154
-						$optimalHeight= $this->getSizeByFixedWidth($newWidth);
154
+						$optimalHeight = $this->getSizeByFixedWidth($newWidth);
155 155
 					} else if ($newHeight > $newWidth) {
156 156
 						$optimalWidth = $this->getSizeByFixedHeight($newHeight);
157
-						$optimalHeight= $newHeight;
157
+						$optimalHeight = $newHeight;
158 158
 					} else {
159 159
 						// *** Sqaure being resized to a square
160 160
 						$optimalWidth = $newWidth;
161
-						$optimalHeight= $newHeight;
161
+						$optimalHeight = $newHeight;
162 162
 					}
163 163
 				}
164 164
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 			{
172 172
 
173 173
 				$heightRatio = $this->height / $newHeight;
174
-				$widthRatio  = $this->width /  $newWidth;
174
+				$widthRatio  = $this->width / $newWidth;
175 175
 
176 176
 				if ($heightRatio < $widthRatio) {
177 177
 					$optimalRatio = $heightRatio;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				}
181 181
 
182 182
 				$optimalHeight = $this->height / $optimalRatio;
183
-				$optimalWidth  = $this->width  / $optimalRatio;
183
+				$optimalWidth  = $this->width / $optimalRatio;
184 184
 
185 185
 				return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
186 186
 			}
@@ -190,26 +190,26 @@  discard block
 block discarded – undo
190 190
 			private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight)
191 191
 			{
192 192
 				// *** Find center - this will be used for the crop
193
-				$cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
194
-				$cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
193
+				$cropStartX = ($optimalWidth / 2) - ($newWidth / 2);
194
+				$cropStartY = ($optimalHeight / 2) - ($newHeight / 2);
195 195
 
196 196
 				$crop = $this->imageResized;
197 197
 				//imagedestroy($this->imageResized);
198 198
 
199 199
 				// *** Now crop from center to exact requested size
200
-				$this->imageResized = imagecreatetruecolor($newWidth , $newHeight);
201
-				imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight);
200
+				$this->imageResized = imagecreatetruecolor($newWidth, $newHeight);
201
+				imagecopyresampled($this->imageResized, $crop, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight, $newWidth, $newHeight);
202 202
 			}
203 203
 
204 204
 			## --------------------------------------------------------
205 205
 
206
-			public function saveImage($savePath, $imageQuality="100")
206
+			public function saveImage($savePath, $imageQuality = "100")
207 207
 			{
208 208
 				// *** Get extension
209 209
         		$extension = strrchr($savePath, '.');
210 210
        			$extension = strtolower($extension);
211 211
 
212
-				switch($extension)
212
+				switch ($extension)
213 213
 				{
214 214
 					case '.jpg':
215 215
 					case '.jpeg':
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
 					case '.png':
228 228
 						// *** Scale quality from 0-100 to 0-9
229
-						$scaleQuality = round(($imageQuality/100) * 9);
229
+						$scaleQuality = round(($imageQuality / 100) * 9);
230 230
 
231 231
 						// *** Invert quality setting as 0 is best, not 9
232 232
 						$invertScaleQuality = 9 - $scaleQuality;
Please login to merge, or discard this patch.
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -134,19 +134,19 @@
 block discarded – undo
134 134
 
135 135
 			private function getSizeByAuto($newWidth, $newHeight)
136 136
 			{
137
-				if ($this->height < $this->width)
138
-				// *** Image to be resized is wider (landscape)
137
+				if ($this->height < $this->width) {
138
+								// *** Image to be resized is wider (landscape)
139 139
 				{
140 140
 					$optimalWidth = $newWidth;
141
-					$optimalHeight= $this->getSizeByFixedWidth($newWidth);
142 141
 				}
143
-				elseif ($this->height > $this->width)
144
-				// *** Image to be resized is taller (portrait)
142
+					$optimalHeight= $this->getSizeByFixedWidth($newWidth);
143
+				} elseif ($this->height > $this->width) {
144
+								// *** Image to be resized is taller (portrait)
145 145
 				{
146 146
 					$optimalWidth = $this->getSizeByFixedHeight($newHeight);
147
-					$optimalHeight= $newHeight;
148 147
 				}
149
-				else
148
+					$optimalHeight= $newHeight;
149
+				} else
150 150
 				// *** Image to be resizerd is a square
151 151
 				{
152 152
 					if ($newHeight < $newWidth) {
Please login to merge, or discard this patch.
core/Database.class.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		 * @param $req -> la req a executer
63 63
 		 * @param $value -> le ou les tableaux de valeurs
64 64
 		 */
65
-		public function prepare($req, $value=null) {
65
+		public function prepare($req, $value = null) {
66 66
 			//si pas de donnees
67 67
 			if ($value === null) {
68 68
 				$this->getPdo()->query($req);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		 * @param $value
98 98
 		 * @return bool
99 99
 		 */
100
-		public function rechercherEgalite($table, $champ, $value, $id_table=null, $id=null) {
100
+		public function rechercherEgalite($table, $champ, $value, $id_table = null, $id = null) {
101 101
 			if ($id == null) {
102 102
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value'");
103 103
 			}
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
 		/**
123 123
 		 * tester si une table dans la base donnee existe
124 124
 		 * @param string $table definit la table pour laquelle on doit tester l'existance
125
-		 * @return true|false
125
+		 * @return boolean
126 126
 		 */
127 127
 		public function TestTableExist($table) {
128 128
 			$query = $this->getPdo()->query("SHOW TABLES LIKE '$table'");
Please login to merge, or discard this patch.
Braces   +9 added lines, -13 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@  discard block
 block discarded – undo
51 51
 			if ($query) {
52 52
 				$obj = $query->fetchAll(PDO::FETCH_OBJ);
53 53
 				return $obj;
54
-			}
55
-			else {
54
+			} else {
56 55
 				FlashMessage::setFlash("Une erreur est survenue en executant cette requette : ".$req);
57 56
 			}
58 57
 		}
@@ -66,8 +65,7 @@  discard block
 block discarded – undo
66 65
 			//si pas de donnees
67 66
 			if ($value === null) {
68 67
 				$this->getPdo()->query($req);
69
-			}
70
-			else {
68
+			} else {
71 69
 				$query = $this->getPdo()->prepare($req);
72 70
 				//si on a plusieurs tableaux
73 71
 				if (array_key_exists(0, $value)) {
@@ -76,8 +74,7 @@  discard block
 block discarded – undo
76 74
 							$err = true;
77 75
 						}
78 76
 					}
79
-				}
80
-				else {
77
+				} else {
81 78
 					if (!$query->execute($value)) {
82 79
 						$err = true;
83 80
 					}
@@ -100,8 +97,7 @@  discard block
 block discarded – undo
100 97
 		public function rechercherEgalite($table, $champ, $value, $id_table=null, $id=null) {
101 98
 			if ($id == null) {
102 99
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value'");
103
-			}
104
-			else {
100
+			} else {
105 101
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value' AND $id_table != $id");
106 102
 			}
107 103
 
@@ -110,9 +106,10 @@  discard block
 block discarded – undo
110 106
 					$nb = $obj["nb"];
111 107
 				}
112 108
 
113
-				if (isset($nb)) return true;
114
-			}
115
-			else {
109
+				if (isset($nb)) {
110
+					return true;
111
+				}
112
+			} else {
116 113
 				return false;
117 114
 			}
118 115
 		}
@@ -129,8 +126,7 @@  discard block
 block discarded – undo
129 126
 
130 127
 			if ($query->rowCount() > 0) {
131 128
 				return true;
132
-			}
133
-			else {
129
+			} else {
134 130
 				return false;
135 131
 			}
136 132
 		}
Please login to merge, or discard this patch.
core/admin/droitsacces/liste/get_detail.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,6 +29,6 @@
 block discarded – undo
29 29
 		$contenu[] = "Cette liste ne contient pas d'élément dans cette catégorie, modifiez la liste pour en ajouter.";
30 30
 	}
31 31
 ?>
32
-<?php for ($i=0 ; $i<$counter ; $i++):?>
32
+<?php for ($i = 0; $i < $counter; $i++):?>
33 33
 	<h4><?=$contenu[$i]?></h4>
34
-<?php endfor;?>
35 34
\ No newline at end of file
35
+<?php endfor; ?>
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
core/admin/droitsacces/GestionDroitAcces.class.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-    namespace core\admin\droitsacces;
2
+	namespace core\admin\droitsacces;
3 3
 
4
-    use core\App;
4
+	use core\App;
5 5
 
6 6
 	class GestionDroitAcces extends DroitAcces {
7 7
 		//pour les droit_acces standard
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 
26 26
 
27
-        //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
27
+		//-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
28 28
 		public function __construct($id_liste_droit_acces=null) {
29 29
 			$dbc = App::getDb();
30 30
 
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 				$this->id_liste_droit_acces = $id_liste_droit_acces;
65 65
 			}
66 66
 		}
67
-        //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
67
+		//-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
68 68
 
69 69
 
70 70
 
71
-        //-------------------------- GETTER ----------------------------------------------------------------------------//
71
+		//-------------------------- GETTER ----------------------------------------------------------------------------//
72 72
 		//pour les droit_acces standard
73 73
 		public function getIdListeDroitAcces() {
74 74
 			return $this->id_liste_droit_acces;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 			return $this->pseudo;
109 109
 		}
110 110
 		public function getNbUser(){
111
-		    return $this->nb_user;
111
+			return $this->nb_user;
112 112
 		}
113 113
 
114 114
 		/**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		 * @param $id_liste_droit_acces
117 117
 		 */
118 118
 		public function getListeDroitAccesDetailDroit($id_liste_droit_acces=null){
119
-		    $dbc = \core\App::getDb();
119
+			$dbc = \core\App::getDb();
120 120
 
121 121
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
122 122
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		 * @param $id_liste_droit_acces
161 161
 		 */
162 162
 		public function getListeDroitAccesDetailPage($id_liste_droit_acces=null){
163
-		    $dbc = \core\App::getDb();
163
+			$dbc = \core\App::getDb();
164 164
 
165 165
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
166 166
 
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 				$this->setListeDroitAccesDetailPage($id_page, $titre_page);
180 180
 			}
181 181
 		}
182
-        //-------------------------- FIN GETTER ----------------------------------------------------------------------------//
182
+		//-------------------------- FIN GETTER ----------------------------------------------------------------------------//
183 183
 
184 184
 
185 185
 
186
-        //-------------------------- SETTER ----------------------------------------------------------------------------//
186
+		//-------------------------- SETTER ----------------------------------------------------------------------------//
187 187
 		private function setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user){
188 188
 			$this->id_liste_droit_acces = $id_liste_droit_acces;
189 189
 			$this->nom_liste = $nom_liste;
@@ -205,4 +205,4 @@  discard block
 block discarded – undo
205 205
 			$this->prenom = $prenom;
206 206
 		}
207 207
 		//-------------------------- FIN SETTER ----------------------------------------------------------------------------//
208
-    }
209 208
\ No newline at end of file
209
+	}
210 210
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
         //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
28
-		public function __construct($id_liste_droit_acces=null) {
28
+		public function __construct($id_liste_droit_acces = null) {
29 29
 			$dbc = App::getDb();
30 30
 
31 31
 			if ($id_liste_droit_acces == null) {
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		public function getIdPage() {
88 88
 			return $this->id_page;
89 89
 		}
90
-		public function getTitrePage(){
90
+		public function getTitrePage() {
91 91
 			return $this->titre_page;
92 92
 		}
93 93
 		public function getNbDroitAccesPage() {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		public function getPseudo() {
108 108
 			return $this->pseudo;
109 109
 		}
110
-		public function getNbUser(){
110
+		public function getNbUser() {
111 111
 		    return $this->nb_user;
112 112
 		}
113 113
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 		 * fonction qui récupère la liste des droits d'acces en texte en fonction de l'id de la liste
116 116
 		 * @param $id_liste_droit_acces
117 117
 		 */
118
-		public function getListeDroitAccesDetailDroit($id_liste_droit_acces=null){
118
+		public function getListeDroitAccesDetailDroit($id_liste_droit_acces = null) {
119 119
 		    $dbc = \core\App::getDb();
120 120
 
121 121
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		 * fonction qui récupère la liste des utilisateur dans une liste de droits d'acces en texte en fonction de l'id de la liste
137 137
 		 * @param $id_liste_droit_acces
138 138
 		 */
139
-		public function getListeDroitAccesDetailUser($id_liste_droit_acces=null) {
139
+		public function getListeDroitAccesDetailUser($id_liste_droit_acces = null) {
140 140
 			$dbc = \core\App::getDb();
141 141
 
142 142
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		 * fonction qui récupère la liste des droits d'acces sur les pages en texte en fonction de l'id de la liste
160 160
 		 * @param $id_liste_droit_acces
161 161
 		 */
162
-		public function getListeDroitAccesDetailPage($id_liste_droit_acces=null){
162
+		public function getListeDroitAccesDetailPage($id_liste_droit_acces = null) {
163 163
 		    $dbc = \core\App::getDb();
164 164
 
165 165
 			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
 
186 186
         //-------------------------- SETTER ----------------------------------------------------------------------------//
187
-		private function setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user){
187
+		private function setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user) {
188 188
 			$this->id_liste_droit_acces = $id_liste_droit_acces;
189 189
 			$this->nom_liste = $nom_liste;
190 190
 			$this->nb_droit_acces = $nb_droit_acces;
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 					$this->setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user);
61 61
 				}
62
-			}
63
-			else {
62
+			} else {
64 63
 				$this->id_liste_droit_acces = $id_liste_droit_acces;
65 64
 			}
66 65
 		}
@@ -118,7 +117,9 @@  discard block
 block discarded – undo
118 117
 		public function getListeDroitAccesDetailDroit($id_liste_droit_acces=null){
119 118
 		    $dbc = \core\App::getDb();
120 119
 
121
-			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
120
+			if ($id_liste_droit_acces == null) {
121
+				$id_liste_droit_acces = $this->id_liste_droit_acces;
122
+			}
122 123
 
123 124
 			$query = $dbc->query("SELECT * FROM droit_acces, liaison_liste_droit WHERE
124 125
 										droit_acces.ID_droit_acces = liaison_liste_droit.ID_droit_acces AND
@@ -139,7 +140,9 @@  discard block
 block discarded – undo
139 140
 		public function getListeDroitAccesDetailUser($id_liste_droit_acces=null) {
140 141
 			$dbc = \core\App::getDb();
141 142
 
142
-			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
143
+			if ($id_liste_droit_acces == null) {
144
+				$id_liste_droit_acces = $this->id_liste_droit_acces;
145
+			}
143 146
 
144 147
 			//récupératin des utilisateurs qui sont dans cette liste
145 148
 			$query = $dbc->query("SELECT * FROM identite WHERE liste_droit=".$id_liste_droit_acces);
@@ -162,7 +165,9 @@  discard block
 block discarded – undo
162 165
 		public function getListeDroitAccesDetailPage($id_liste_droit_acces=null){
163 166
 		    $dbc = \core\App::getDb();
164 167
 
165
-			if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces;
168
+			if ($id_liste_droit_acces == null) {
169
+				$id_liste_droit_acces = $this->id_liste_droit_acces;
170
+			}
166 171
 
167 172
 			//récupération des droits d'acces pour les pages
168 173
 			$query = $dbc->query("SELECT * FROM liste_droit_acces, droit_acces_page, page WHERE
Please login to merge, or discard this patch.
core/admin/droitsacces/initialise/ajout_modification.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@  discard block
 block discarded – undo
7 7
 		$article = $_SESSION['contenu'];*/
8 8
 
9 9
 		unset($_SESSION['err_modification_droitsacces']);
10
-	}
11
-	else if ($page == "gestion-droits-acces/modifier-liste") {
10
+	} else if ($page == "gestion-droits-acces/modifier-liste") {
12 11
 		$gestion_droit_acces = new \core\admin\droitsacces\GestionDroitAcces($_GET['id_liste']);
13 12
 		/*$id_article = $_GET['id_article'];
14 13
 		$balise_title = $admin_blog->getBaliseTitle();
@@ -16,8 +15,7 @@  discard block
 block discarded – undo
16 15
 		$meta_description = $admin_blog->getMetaDescription();
17 16
 		$titre_courant = $admin_blog->getTitre();
18 17
 		$article = $admin_blog->getContenuArticle();*/
19
-	}
20
-	else {
18
+	} else {
21 19
 		$balise_title = null;
22 20
 		$url = null;
23 21
 		$meta_description = null;
Please login to merge, or discard this patch.