Completed
Push — master ( f99fed...57dceb )
by Jean-Christophe
03:29
created
Ajax/semantic/html/content/HtmlMenuItem.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 				$icon=@$content[0];
19 19
 				$title=@$content[1];
20 20
 				$desc=@$content[2];
21
-			}else{
21
+			} else{
22 22
 				$icon=@$content["icon"];
23 23
 				$title=@$content["title"];
24 24
 				$desc=@$content["description"];
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 			if(isset($title)){
30 30
 				$this->setTitle($title,$desc);
31 31
 			}
32
-		}else{
32
+		} else{
33 33
 			$this->setContent($content);
34 34
 		}
35 35
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlStepItem.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 				$title=@$content[1];
18 18
 				$desc=@$content[2];
19 19
 				$status=@$content[3];
20
-			}else{
20
+			} else{
21 21
 				$icon=@$content["icon"];
22 22
 				$title=@$content["title"];
23 23
 				$desc=@$content["description"];
@@ -32,16 +32,17 @@  discard block
 block discarded – undo
32 32
 			if(isset($title)){
33 33
 				$this->setTitle($title,$desc);
34 34
 			}
35
-		}else{
35
+		} else{
36 36
 			$this->setContent($content);
37 37
 		}
38 38
 	}
39 39
 
40 40
 	public function setActive($value=true){
41
-		if($value)
42
-			$this->setStatus(StepStatus::ACTIVE);
43
-		else
44
-			$this->setStatus(StepStatus::NONE);
41
+		if($value) {
42
+					$this->setStatus(StepStatus::ACTIVE);
43
+		} else {
44
+					$this->setStatus(StepStatus::NONE);
45
+		}
45 46
 		return $this;
46 47
 	}
47 48
 
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/IconTrait.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
27 27
 			$this->addContent($iconO,$direction===Direction::LEFT);
28 28
 			$this->_hasIcon=true;
29
-		}else{
29
+		} else{
30 30
 			$iconO=$this->getIcon();
31 31
 			$iconO->setIcon($icon);
32 32
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 	public function getIcon(){
38 38
 		if(\is_array($this->content)){
39 39
 			foreach ($this->content as $item){
40
-				if($item instanceof HtmlIcon)
41
-					return $item;
40
+				if($item instanceof HtmlIcon) {
41
+									return $item;
42
+				}
42 43
 			}
43 44
 		}
44 45
 	}
Please login to merge, or discard this patch.
Ajax/common/traits/JqueryActionsTrait.php 1 patch
Braces   +51 added lines, -34 removed lines patch added patch discarded remove patch
@@ -24,10 +24,12 @@  discard block
 block discarded – undo
24 24
 		if (isset($value)) {
25 25
 			$value=Javascript::prep_value($value);
26 26
 			$str="$({$element}).attr(\"$attributeName\",{$value});";
27
-		} else
28
-			$str="$({$element}).attr(\"$attributeName\");";
29
-			if ($immediatly)
30
-				$this->jquery_code_for_compile[]=$str;
27
+		} else {
28
+					$str="$({$element}).attr(\"$attributeName\");";
29
+		}
30
+			if ($immediatly) {
31
+							$this->jquery_code_for_compile[]=$str;
32
+			}
31 33
 				return $str;
32 34
 	}
33 35
 
@@ -42,8 +44,9 @@  discard block
 block discarded – undo
42 44
 		$element=Javascript::prep_element($element);
43 45
 		$value=Javascript::prep_value($value);
44 46
 		$str="$({$element}).after({$value});";
45
-		if ($immediatly)
46
-			$this->jquery_code_for_compile[]=$str;
47
+		if ($immediatly) {
48
+					$this->jquery_code_for_compile[]=$str;
49
+		}
47 50
 			return $str;
48 51
 	}
49 52
 
@@ -79,8 +82,9 @@  discard block
 block discarded – undo
79 82
 
80 83
 		$str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");";
81 84
 
82
-		if ($immediatly)
83
-			$this->jquery_code_for_compile[]=$str;
85
+		if ($immediatly) {
86
+					$this->jquery_code_for_compile[]=$str;
87
+		}
84 88
 			return $str;
85 89
 	}
86 90
 
@@ -105,8 +109,9 @@  discard block
 block discarded – undo
105 109
 
106 110
 		$str="$({$element}).fadeIn({$speed}{$callback});";
107 111
 
108
-		if ($immediatly)
109
-			$this->jquery_code_for_compile[]=$str;
112
+		if ($immediatly) {
113
+					$this->jquery_code_for_compile[]=$str;
114
+		}
110 115
 			return $str;
111 116
 	}
112 117
 
@@ -131,8 +136,9 @@  discard block
 block discarded – undo
131 136
 
132 137
 		$str="$({$element}).fadeOut({$speed}{$callback});";
133 138
 
134
-		if ($immediatly)
135
-			$this->jquery_code_for_compile[]=$str;
139
+		if ($immediatly) {
140
+					$this->jquery_code_for_compile[]=$str;
141
+		}
136 142
 			return $str;
137 143
 	}
138 144
 
@@ -157,8 +163,9 @@  discard block
 block discarded – undo
157 163
 
158 164
 		$str="$({$element}).hide({$speed}{$callback});";
159 165
 
160
-		if ($immediatly)
161
-			$this->jquery_code_for_compile[]=$str;
166
+		if ($immediatly) {
167
+					$this->jquery_code_for_compile[]=$str;
168
+		}
162 169
 			return $str;
163 170
 	}
164 171
 
@@ -185,8 +192,9 @@  discard block
 block discarded – undo
185 192
 
186 193
 		$str="$({$element}).slideUp({$speed}{$callback});";
187 194
 
188
-		if ($immediatly)
189
-			$this->jquery_code_for_compile[]=$str;
195
+		if ($immediatly) {
196
+					$this->jquery_code_for_compile[]=$str;
197
+		}
190 198
 			return $str;
191 199
 	}
192 200
 
@@ -211,8 +219,9 @@  discard block
 block discarded – undo
211 219
 
212 220
 		$str="$({$element}).slideDown({$speed}{$callback});";
213 221
 
214
-		if ($immediatly)
215
-			$this->jquery_code_for_compile[]=$str;
222
+		if ($immediatly) {
223
+					$this->jquery_code_for_compile[]=$str;
224
+		}
216 225
 			return $str;
217 226
 	}
218 227
 
@@ -237,8 +246,9 @@  discard block
 block discarded – undo
237 246
 
238 247
 		$str="$({$element}).slideToggle({$speed}{$callback});";
239 248
 
240
-		if ($immediatly)
241
-			$this->jquery_code_for_compile[]=$str;
249
+		if ($immediatly) {
250
+					$this->jquery_code_for_compile[]=$str;
251
+		}
242 252
 			return $str;
243 253
 	}
244 254
 
@@ -255,8 +265,9 @@  discard block
 block discarded – undo
255 265
 		$element=Javascript::prep_element($element);
256 266
 		$str="$({$element}).toggle();";
257 267
 
258
-		if ($immediatly)
259
-			$this->jquery_code_for_compile[]=$str;
268
+		if ($immediatly) {
269
+					$this->jquery_code_for_compile[]=$str;
270
+		}
260 271
 			return $str;
261 272
 	}
262 273
 
@@ -272,8 +283,9 @@  discard block
 block discarded – undo
272 283
 		$element=Javascript::prep_element($element);
273 284
 		$str="$({$element}).trigger(\"$event\");";
274 285
 
275
-		if ($immediatly)
276
-			$this->jquery_code_for_compile[]=$str;
286
+		if ($immediatly) {
287
+					$this->jquery_code_for_compile[]=$str;
288
+		}
277 289
 			return $str;
278 290
 	}
279 291
 
@@ -298,8 +310,9 @@  discard block
 block discarded – undo
298 310
 
299 311
 		$str="$({$element}).show({$speed}{$callback});";
300 312
 
301
-		if ($immediatly)
302
-			$this->jquery_code_for_compile[]=$str;
313
+		if ($immediatly) {
314
+					$this->jquery_code_for_compile[]=$str;
315
+		}
303 316
 			return $str;
304 317
 	}
305 318
 
@@ -317,8 +330,9 @@  discard block
 block discarded – undo
317 330
 			$str.="else{".$jsCodeIfFalse."}";
318 331
 		}
319 332
 
320
-		if ($immediatly)
321
-			$this->jquery_code_for_compile[]=$str;
333
+		if ($immediatly) {
334
+					$this->jquery_code_for_compile[]=$str;
335
+		}
322 336
 			return $str;
323 337
 	}
324 338
 
@@ -335,11 +349,13 @@  discard block
 block discarded – undo
335 349
 	public function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) {
336 350
 		$param=Javascript::prep_value($param);
337 351
 		$callback="";
338
-		if ($jsCallback!="")
339
-			$callback=", function(event){\n{$jsCallback}\n}";
352
+		if ($jsCallback!="") {
353
+					$callback=", function(event){\n{$jsCallback}\n}";
354
+		}
340 355
 			$script="$(".Javascript::prep_element($element).").".$jqueryCall."(".$param.$callback.");\n";
341
-			if ($immediatly)
342
-				$this->jquery_code_for_compile[]=$script;
356
+			if ($immediatly) {
357
+							$this->jquery_code_for_compile[]=$script;
358
+			}
343 359
 				return $script;
344 360
 	}
345 361
 
@@ -368,8 +384,9 @@  discard block
 block discarded – undo
368 384
 	 */
369 385
 	public function _exec($js, $immediatly=false) {
370 386
 		$script=$js."\n";
371
-		if ($immediatly)
372
-			$this->jquery_code_for_compile[]=$script;
387
+		if ($immediatly) {
388
+					$this->jquery_code_for_compile[]=$script;
389
+		}
373 390
 			return $script;
374 391
 	}
375 392
 
Please login to merge, or discard this patch.
Ajax/common/components/SimpleComponent.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 		foreach ( $this->events as $event => $jsCode ) {
25 25
 			if($event=="execute"){
26 26
 				$this->jquery_code_for_compile []=$jsCode;
27
-			}else if($event=="beforeExecute"){
27
+			} else if($event=="beforeExecute"){
28 28
 				\array_unshift($this->jquery_code_for_compile, $jsCode);
29
-			}else{
29
+			} else{
30 30
 				$selector=$this->attachTo;
31 31
 				if(isset($this->itemSelector)){
32 32
 					$selector.=" ".$this->itemSelector;
@@ -75,8 +75,9 @@  discard block
 block discarded – undo
75 75
 
76 76
 	protected function setParamCtrl($key, $value, $typeCtrl) {
77 77
 		if (\is_array($typeCtrl)) {
78
-			if (array_search($value, $typeCtrl)===false)
79
-				throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
78
+			if (array_search($value, $typeCtrl)===false) {
79
+							throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
80
+			}
80 81
 		} else {
81 82
 			if (!$typeCtrl($value)) {
82 83
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
Please login to merge, or discard this patch.
Ajax/common/components/BaseComponent.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 	public function getParam($key) {
41 41
 		$value=null;
42
-		if (array_key_exists($key, $this->params))
43
-			$value=$this->params [$key];
42
+		if (array_key_exists($key, $this->params)) {
43
+					$value=$this->params [$key];
44
+		}
44 45
 		return $value;
45 46
 	}
46 47
 
@@ -49,16 +50,18 @@  discard block
 block discarded – undo
49 50
 	}
50 51
 
51 52
 	public function compile(JsUtils $js=NULL) {
52
-		if ($js==NULL)
53
-			$js=$this->js;
53
+		if ($js==NULL) {
54
+					$js=$this->js;
55
+		}
54 56
 		$script=$this->getScript();
55 57
 		$js->addToCompile($script);
56 58
 	}
57 59
 
58 60
 	protected function setParamCtrl($key, $value, $typeCtrl) {
59 61
 		if (\is_array($typeCtrl)) {
60
-			if (array_search($value, $typeCtrl)===false)
61
-				throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
62
+			if (array_search($value, $typeCtrl)===false) {
63
+							throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
64
+			}
62 65
 		} else {
63 66
 			if (!$typeCtrl($value)) {
64 67
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key);
@@ -70,9 +73,9 @@  discard block
 block discarded – undo
70 73
 	public function setParams($params) {
71 74
 		foreach ( $params as $k => $v ) {
72 75
 			$method="set".ucfirst($k);
73
-			if (method_exists($this, $method))
74
-				$this->$method($v);
75
-			else {
76
+			if (method_exists($this, $method)) {
77
+							$this->$method($v);
78
+			} else {
76 79
 				$this->setParam($k, $v);
77 80
 				trigger_error("`".$k."` property n'existe pas", E_USER_NOTICE);
78 81
 			}
Please login to merge, or discard this patch.
Ajax/common/html/HtmlCollection.php 1 patch
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 			foreach ($items as $k=>$v){
23 23
 				$this->addItem([$k,$v]);
24 24
 			}
25
-		}else{
25
+		} else{
26 26
 			foreach ($items as $item){
27 27
 				$this->addItem($item);
28 28
 			}
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 	 * @return \Ajax\common\html\HtmlDoubleElement
71 71
 	 */
72 72
 	public function getItem($index) {
73
-		if (is_int($index))
74
-			return $this->content[$index];
75
-		else {
73
+		if (is_int($index)) {
74
+					return $this->content[$index];
75
+		} else {
76 76
 			$elm=$this->getElementById($index, $this->content);
77 77
 			return $elm;
78 78
 		}
@@ -134,10 +134,11 @@  discard block
 block discarded – undo
134 134
 		$i=0;
135 135
 		foreach ($properties as $k=>$v){
136 136
 			$c=$this->content[$i++];
137
-			if(isset($c))
138
-				$c->setProperty($k,$v);
139
-			else
140
-				return $this;
137
+			if(isset($c)) {
138
+							$c->setProperty($k,$v);
139
+			} else {
140
+							return $this;
141
+			}
141 142
 		}
142 143
 		return $this;
143 144
 	}
@@ -151,8 +152,7 @@  discard block
 block discarded – undo
151 152
 			$c=$this->content[$i++];
152 153
 			if(isset($c)){
153 154
 				$c->setProperty($property,$value);
154
-			}
155
-			else{
155
+			} else{
156 156
 				return $this;
157 157
 			}
158 158
 		}
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlTextarea.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,18 +12,21 @@
 block discarded – undo
12 12
 		$this->setProperty("name", $identifier);
13 13
 		$this->setValue($value);
14 14
 		$this->setPlaceholder($placeholder);
15
-		if(isset($rows))
16
-			$this->setRows($rows);
15
+		if(isset($rows)) {
16
+					$this->setRows($rows);
17
+		}
17 18
 	}
18 19
 	public function setValue($value) {
19
-		if(isset($value))
20
-			$this->setContent($value);
20
+		if(isset($value)) {
21
+					$this->setContent($value);
22
+		}
21 23
 		return $this;
22 24
 	}
23 25
 
24 26
 	public function setPlaceholder($value){
25
-		if(JString::isNotNull($value))
26
-			$this->setProperty("placeholder", $value);
27
+		if(JString::isNotNull($value)) {
28
+					$this->setProperty("placeholder", $value);
29
+		}
27 30
 		return $this;
28 31
 	}
29 32
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAbsractItem.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			$this->setTagName("div");
58 58
 			$this->removeProperty("href");
59 59
 			$this->addToPropertyCtrl("class", "active", array("active"));
60
-		}else{
60
+		} else{
61 61
 			$this->removePropertyValue("class", "active");
62 62
 		}
63 63
 		return $this;
@@ -65,8 +65,9 @@  discard block
 block discarded – undo
65 65
 
66 66
 	public function asLink($href=NULL,$part=NULL){
67 67
 		$this->setTagName("a");
68
-		if(isset($href))
69
-			$this->setProperty("href", $href);
68
+		if(isset($href)) {
69
+					$this->setProperty("href", $href);
70
+		}
70 71
 		return $this;
71 72
 	}
72 73
 
@@ -77,8 +78,9 @@  discard block
 block discarded – undo
77 78
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
78 79
 	 */
79 80
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
80
-		if(\is_array($this->content) && JArray::isAssociative($this->content))
81
-			$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
81
+		if(\is_array($this->content) && JArray::isAssociative($this->content)) {
82
+					$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
83
+		}
82 84
 		return parent::compile($js, $view);
83 85
 	}
84 86
 }
85 87
\ No newline at end of file
Please login to merge, or discard this patch.