Completed
Push — master ( e9bdcb...b0560a )
by Jean-Christophe
04:52
created
Ajax/semantic/html/collections/menus/HtmlAccordionMenu.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@
 block discarded – undo
34 34
 	 * @see BaseHtml::run()
35 35
 	 */
36 36
 	public function run(JsUtils $js) {
37
-		if(isset($this->_bsComponent)===false)
38
-			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
37
+		if(isset($this->_bsComponent)===false) {
38
+					$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
39
+		}
39 40
 			$this->addEventsOnRun($js);
40 41
 			return $this->_bsComponent;
41 42
 	}
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlInput.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
 	}
17 17
 
18 18
 	public function setValue($value) {
19
-		if(isset($value))
20
-		$this->setProperty("value", $value);
19
+		if(isset($value)) {
20
+				$this->setProperty("value", $value);
21
+		}
21 22
 		return $this;
22 23
 	}
23 24
 
@@ -26,8 +27,9 @@  discard block
 block discarded – undo
26 27
 	}
27 28
 
28 29
 	public function setPlaceholder($value){
29
-		if(JString::isNotNull($value))
30
-			$this->setProperty("placeholder", $value);
30
+		if(JString::isNotNull($value)) {
31
+					$this->setProperty("placeholder", $value);
32
+		}
31 33
 		return $this;
32 34
 	}
33 35
 }
34 36
\ No newline at end of file
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
@@ -11,18 +11,21 @@
 block discarded – undo
11 11
 		parent::__construct($identifier, "textarea");
12 12
 		$this->setValue($value);
13 13
 		$this->setPlaceholder($placeholder);
14
-		if(isset($rows))
15
-			$this->setRows($rows);
14
+		if(isset($rows)) {
15
+					$this->setRows($rows);
16
+		}
16 17
 	}
17 18
 	public function setValue($value) {
18
-		if(isset($value))
19
-			$this->setContent($value);
19
+		if(isset($value)) {
20
+					$this->setContent($value);
21
+		}
20 22
 		return $this;
21 23
 	}
22 24
 
23 25
 	public function setPlaceholder($value){
24
-		if(JString::isNotNull($value))
25
-			$this->setProperty("placeholder", $value);
26
+		if(JString::isNotNull($value)) {
27
+					$this->setProperty("placeholder", $value);
28
+		}
26 29
 		return $this;
27 30
 	}
28 31
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormTextarea.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@
 block discarded – undo
8 8
 class HtmlFormInput extends HtmlFormField {
9 9
 
10 10
 	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
11
-		if(!isset($placeholder))
12
-			$placeholder=$label;
11
+		if(!isset($placeholder)) {
12
+					$placeholder=$label;
13
+		}
13 14
 		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
14 15
 	}
15 16
 
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
@@ -16,10 +16,12 @@  discard block
 block discarded – undo
16 16
 		if (isset($value)) {
17 17
 			$value=$this->_prep_value($value);
18 18
 			$str="$({$element}).attr(\"$attributeName\",{$value});";
19
-		} else
20
-			$str="$({$element}).attr(\"$attributeName\");";
21
-			if ($immediatly)
22
-				$this->jquery_code_for_compile[]=$str;
19
+		} else {
20
+					$str="$({$element}).attr(\"$attributeName\");";
21
+		}
22
+			if ($immediatly) {
23
+							$this->jquery_code_for_compile[]=$str;
24
+			}
23 25
 				return $str;
24 26
 	}
25 27
 
@@ -34,8 +36,9 @@  discard block
 block discarded – undo
34 36
 		$element=$this->_prep_element($element);
35 37
 		$value=$this->_prep_value($value);
36 38
 		$str="$({$element}).after({$value});";
37
-		if ($immediatly)
38
-			$this->jquery_code_for_compile[]=$str;
39
+		if ($immediatly) {
40
+					$this->jquery_code_for_compile[]=$str;
41
+		}
39 42
 			return $str;
40 43
 	}
41 44
 
@@ -71,8 +74,9 @@  discard block
 block discarded – undo
71 74
 
72 75
 		$str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");";
73 76
 
74
-		if ($immediatly)
75
-			$this->jquery_code_for_compile[]=$str;
77
+		if ($immediatly) {
78
+					$this->jquery_code_for_compile[]=$str;
79
+		}
76 80
 			return $str;
77 81
 	}
78 82
 
@@ -97,8 +101,9 @@  discard block
 block discarded – undo
97 101
 
98 102
 		$str="$({$element}).fadeIn({$speed}{$callback});";
99 103
 
100
-		if ($immediatly)
101
-			$this->jquery_code_for_compile[]=$str;
104
+		if ($immediatly) {
105
+					$this->jquery_code_for_compile[]=$str;
106
+		}
102 107
 			return $str;
103 108
 	}
104 109
 
@@ -123,8 +128,9 @@  discard block
 block discarded – undo
123 128
 
124 129
 		$str="$({$element}).fadeOut({$speed}{$callback});";
125 130
 
126
-		if ($immediatly)
127
-			$this->jquery_code_for_compile[]=$str;
131
+		if ($immediatly) {
132
+					$this->jquery_code_for_compile[]=$str;
133
+		}
128 134
 			return $str;
129 135
 	}
130 136
 
@@ -149,8 +155,9 @@  discard block
 block discarded – undo
149 155
 
150 156
 		$str="$({$element}).hide({$speed}{$callback});";
151 157
 
152
-		if ($immediatly)
153
-			$this->jquery_code_for_compile[]=$str;
158
+		if ($immediatly) {
159
+					$this->jquery_code_for_compile[]=$str;
160
+		}
154 161
 			return $str;
155 162
 	}
156 163
 
@@ -177,8 +184,9 @@  discard block
 block discarded – undo
177 184
 
178 185
 		$str="$({$element}).slideUp({$speed}{$callback});";
179 186
 
180
-		if ($immediatly)
181
-			$this->jquery_code_for_compile[]=$str;
187
+		if ($immediatly) {
188
+					$this->jquery_code_for_compile[]=$str;
189
+		}
182 190
 			return $str;
183 191
 	}
184 192
 
@@ -203,8 +211,9 @@  discard block
 block discarded – undo
203 211
 
204 212
 		$str="$({$element}).slideDown({$speed}{$callback});";
205 213
 
206
-		if ($immediatly)
207
-			$this->jquery_code_for_compile[]=$str;
214
+		if ($immediatly) {
215
+					$this->jquery_code_for_compile[]=$str;
216
+		}
208 217
 			return $str;
209 218
 	}
210 219
 
@@ -229,8 +238,9 @@  discard block
 block discarded – undo
229 238
 
230 239
 		$str="$({$element}).slideToggle({$speed}{$callback});";
231 240
 
232
-		if ($immediatly)
233
-			$this->jquery_code_for_compile[]=$str;
241
+		if ($immediatly) {
242
+					$this->jquery_code_for_compile[]=$str;
243
+		}
234 244
 			return $str;
235 245
 	}
236 246
 
@@ -247,8 +257,9 @@  discard block
 block discarded – undo
247 257
 		$element=$this->_prep_element($element);
248 258
 		$str="$({$element}).toggle();";
249 259
 
250
-		if ($immediatly)
251
-			$this->jquery_code_for_compile[]=$str;
260
+		if ($immediatly) {
261
+					$this->jquery_code_for_compile[]=$str;
262
+		}
252 263
 			return $str;
253 264
 	}
254 265
 
@@ -264,8 +275,9 @@  discard block
 block discarded – undo
264 275
 		$element=$this->_prep_element($element);
265 276
 		$str="$({$element}).trigger(\"$event\");";
266 277
 
267
-		if ($immediatly)
268
-			$this->jquery_code_for_compile[]=$str;
278
+		if ($immediatly) {
279
+					$this->jquery_code_for_compile[]=$str;
280
+		}
269 281
 			return $str;
270 282
 	}
271 283
 
@@ -290,8 +302,9 @@  discard block
 block discarded – undo
290 302
 
291 303
 		$str="$({$element}).show({$speed}{$callback});";
292 304
 
293
-		if ($immediatly)
294
-			$this->jquery_code_for_compile[]=$str;
305
+		if ($immediatly) {
306
+					$this->jquery_code_for_compile[]=$str;
307
+		}
295 308
 			return $str;
296 309
 	}
297 310
 
@@ -309,8 +322,9 @@  discard block
 block discarded – undo
309 322
 			$str.="else{".$jsCodeIfFalse."}";
310 323
 		}
311 324
 
312
-		if ($immediatly)
313
-			$this->jquery_code_for_compile[]=$str;
325
+		if ($immediatly) {
326
+					$this->jquery_code_for_compile[]=$str;
327
+		}
314 328
 			return $str;
315 329
 	}
316 330
 
@@ -327,11 +341,13 @@  discard block
 block discarded – undo
327 341
 	public function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) {
328 342
 		$param=$this->_prep_value($param);
329 343
 		$callback="";
330
-		if ($jsCallback!="")
331
-			$callback=", function(event){\n{$jsCallback}\n}";
344
+		if ($jsCallback!="") {
345
+					$callback=", function(event){\n{$jsCallback}\n}";
346
+		}
332 347
 			$script="$(".$this->_prep_element($element).").".$jqueryCall."(".$param.$callback.");\n";
333
-			if ($immediatly)
334
-				$this->jquery_code_for_compile[]=$script;
348
+			if ($immediatly) {
349
+							$this->jquery_code_for_compile[]=$script;
350
+			}
335 351
 				return $script;
336 352
 	}
337 353
 
@@ -360,8 +376,9 @@  discard block
 block discarded – undo
360 376
 	 */
361 377
 	public function _exec($js, $immediatly=false) {
362 378
 		$script=$js."\n";
363
-		if ($immediatly)
364
-			$this->jquery_code_for_compile[]=$script;
379
+		if ($immediatly) {
380
+					$this->jquery_code_for_compile[]=$script;
381
+		}
365 382
 			return $script;
366 383
 	}
367 384
 
Please login to merge, or discard this patch.
Ajax/common/traits/JqueryAjaxTrait.php 1 patch
Braces   +24 added lines, -17 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 		$retour.="$.".$method."(url,".$params.").done(function( data ) {\n";
37 37
 		$retour.=$this->_getOnAjaxDone($responseElement, $jsCallback)."});\n";
38
-		if ($immediatly)
39
-			$this->jquery_code_for_compile[]=$retour;
38
+		if ($immediatly) {
39
+					$this->jquery_code_for_compile[]=$retour;
40
+		}
40 41
 			return $retour;
41 42
 	}
42 43
 
@@ -44,13 +45,15 @@  discard block
 block discarded – undo
44 45
 		$url=$this->_correctAjaxUrl($url);
45 46
 		$retour="url='".$url."';\n";
46 47
 		$slash="/";
47
-		if(PhalconUtils::endsWith($url, "/"))
48
-			$slash="";
48
+		if(PhalconUtils::endsWith($url, "/")) {
49
+					$slash="";
50
+		}
49 51
 			if(JString::isNotNull($attr)){
50
-				if ($attr=="value")
51
-					$retour.="url=url+'".$slash."'+$(this).val();\n";
52
-					else if($attr!=null && $attr!=="")
53
-						$retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n";
52
+				if ($attr=="value") {
53
+									$retour.="url=url+'".$slash."'+$(this).val();\n";
54
+				} else if($attr!=null && $attr!=="") {
55
+											$retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n";
56
+					}
54 57
 			}
55 58
 			return $retour;
56 59
 	}
@@ -72,8 +75,9 @@  discard block
 block discarded – undo
72 75
 	}
73 76
 
74 77
 	protected function _correctAjaxUrl($url) {
75
-		if (PhalconUtils::endsWith($url, "/"))
76
-			$url=substr($url, 0, strlen($url)-1);
78
+		if (PhalconUtils::endsWith($url, "/")) {
79
+					$url=substr($url, 0, strlen($url)-1);
80
+		}
77 81
 			if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) {
78 82
 				$url=$this->_di->get("url")->get($url);
79 83
 			}
@@ -97,8 +101,9 @@  discard block
 block discarded – undo
97 101
 				$retour.="\t".$jsCallback."\n".
98 102
 						"\t$(document).trigger('jsonReady',[data]);\n".
99 103
 						"});\n";
100
-				if ($immediatly)
101
-					$this->jquery_code_for_compile[]=$retour;
104
+				if ($immediatly) {
105
+									$this->jquery_code_for_compile[]=$retour;
106
+				}
102 107
 					return $retour;
103 108
 	}
104 109
 
@@ -137,7 +142,7 @@  discard block
 block discarded – undo
137 142
 		if($context===null){
138 143
 			$appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n";
139 144
 			$newElm = "$('#'+newId)";
140
-		}else{
145
+		} else{
141 146
 			$appendTo="\t\tnewElm.appendTo(".$context.");\n";
142 147
 			$newElm = $context.".find('#'+newId)";
143 148
 		}
@@ -147,8 +152,9 @@  discard block
 block discarded – undo
147 152
 		$retour.="\t}\n"."\tfor(var key in value){\n"."\t\t\tvar html = $('<div />').append($(newElm).clone()).html();\n"."\t\t\tif(html.indexOf('[['+key+']]')>-1){\n"."\t\t\t\tcontent=$(html.split('[['+key+']]').join(value[key]));\n"."\t\t\t\t$(newElm).replaceWith(content);newElm=content;\n"."\t\t\t}\n"."\t\tvar sel='[data-id=\"'+key+'\"]';if($(sel,newElm).length){\n"."\t\t\tvar selElm=$(sel,newElm);\n"."\t\t\t if(selElm.is('[value]')) { selElm.attr('value',value[key]);selElm.val(value[key]);} else { selElm.html(value[key]); }\n"."\t\t}\n"."}\n"."\t$(newElm).show(true);"."\n"."\t$(newElm).removeClass('hide');"."});\n";
148 153
 		$retour.="\t$(document).trigger('jsonReady',[data]);\n";
149 154
 		$retour.="\t".$jsCallback."\n"."});\n";
150
-		if ($immediatly)
151
-			$this->jquery_code_for_compile[]=$retour;
155
+		if ($immediatly) {
156
+					$this->jquery_code_for_compile[]=$retour;
157
+		}
152 158
 			return $retour;
153 159
 	}
154 160
 	/**
@@ -189,8 +195,9 @@  discard block
 block discarded – undo
189 195
 			}});\n";
190 196
 			$retour.="$('#".$form."').submit();\n";
191 197
 		}
192
-		if ($immediatly)
193
-			$this->jquery_code_for_compile[]=$retour;
198
+		if ($immediatly) {
199
+					$this->jquery_code_for_compile[]=$retour;
200
+		}
194 201
 			return $retour;
195 202
 	}
196 203
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlForm.php 1 patch
Braces   +20 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,8 +29,9 @@  discard block
 block discarded – undo
29 29
 
30 30
 	public function addHeader($title,$niveau=1,$dividing=true){
31 31
 		$header=new HtmlHeader("",$niveau,$title);
32
-		if($dividing)
33
-			$header->setDividing();
32
+		if($dividing) {
33
+					$header->setDividing();
34
+		}
34 35
 		return $this->addItem($header);
35 36
 	}
36 37
 
@@ -43,14 +44,17 @@  discard block
 block discarded – undo
43 44
 					if(\is_string($end)){
44 45
 						$label=$end;
45 46
 						\array_pop($fields);
46
-					}else $label=NULL;
47
+					} else {
48
+						$label=NULL;
49
+					}
47 50
 				}
48 51
 				$this->_fields=\array_merge($this->_fields,$fields);
49 52
 				$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count(),$fields);
50 53
 			}
51
-			if(isset($label))
52
-			 $fields=new HtmlFormField("", $fields,$label);
53
-		}else{
54
+			if(isset($label)) {
55
+						 $fields=new HtmlFormField("", $fields,$label);
56
+			}
57
+		} else{
54 58
 			$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count());
55 59
 		}
56 60
 		$this->addItem($fields);
@@ -68,7 +72,7 @@  discard block
 block discarded – undo
68 72
 	public function getField($index){
69 73
 		if(\is_string($index)){
70 74
 			$field=$this->getElementById($index, $this->_fields);
71
-		}else{
75
+		} else{
72 76
 			$field=$this->_fields[$index];
73 77
 		}
74 78
 		return $field;
@@ -101,12 +105,15 @@  discard block
 block discarded – undo
101 105
 	 */
102 106
 	public function addMessage($identifier,$content,$header=NULL,$icon=NULL,$type=NULL){
103 107
 		$message=new HtmlMessage($identifier,$content);
104
-		if(isset($header))
105
-			$message->addHeader($header);
106
-		if(isset($icon))
107
-			$message->setIcon($icon);
108
-		if(isset($type))
109
-			$message->setStyle($type);
108
+		if(isset($header)) {
109
+					$message->addHeader($header);
110
+		}
111
+		if(isset($icon)) {
112
+					$message->setIcon($icon);
113
+		}
114
+		if(isset($type)) {
115
+					$message->setStyle($type);
116
+		}
110 117
 		return $this->addItem($message);
111 118
 	}
112 119
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FieldsTrait.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@
 block discarded – undo
13 13
 		if(\is_array($value)){
14 14
 			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null)));
15 15
 			return $itemO;
16
-		}else
17
-			return new HtmlFormInput($value);
16
+		} else {
17
+					return new HtmlFormInput($value);
18
+		}
18 19
 	}
19 20
 
20 21
 	public function addInputs($inputs,$fieldslabel=null){
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticHtmlElementsTrait.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 			foreach ($icons as $icon=>$size){
37 37
 				$group->addIcon($icon,$size);
38 38
 			}
39
-		}else{
39
+		} else{
40 40
 			foreach ($icons as $icon){
41 41
 				$group->addIcon($icon);
42 42
 			}
Please login to merge, or discard this patch.