Completed
Push — master ( db460e...6ada0e )
by Jean-Christophe
04:52
created
Ajax/JsUtils.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,8 +50,9 @@  discard block
 block discarded – undo
50 50
 
51 51
 	protected function _setDi($di) {
52 52
 		$this->_di=$di;
53
-		if ($this->js!=null&&$di!=null)
54
-			$this->js->setDi($di);
53
+		if ($this->js!=null&&$di!=null) {
54
+					$this->js->setDi($di);
55
+		}
55 56
 	}
56 57
 
57 58
 	/**
@@ -1130,12 +1131,14 @@  discard block
 block discarded – undo
1130 1131
 					$result[1]=$cdn;
1131 1132
 					break;
1132 1133
 				case "Ajax\lib\CDNCoreCss":
1133
-					if($cdn->getFramework()==="Bootstrap")
1134
-						$hasBootstrap=true;
1135
-					elseif($cdn->getFramework()==="Semantic")
1136
-						$hasSemantic=true;
1137
-					if($hasSemantic || $hasBootstrap)
1138
-						$result[2]=$cdn;
1134
+					if($cdn->getFramework()==="Bootstrap") {
1135
+											$hasBootstrap=true;
1136
+					} elseif($cdn->getFramework()==="Semantic") {
1137
+											$hasSemantic=true;
1138
+					}
1139
+					if($hasSemantic || $hasBootstrap) {
1140
+											$result[2]=$cdn;
1141
+					}
1139 1142
 					break;
1140 1143
 			}
1141 1144
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlAccordion.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/semantic/html/content/HtmlAccordionItem.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@  discard block
 block discarded – undo
31 31
 	protected function createTitleElement(){
32 32
 		$element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title");
33 33
 		$element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title));
34
-		if($this->_active===true)
35
-			$element->addToProperty("class", "active");
34
+		if($this->_active===true) {
35
+					$element->addToProperty("class", "active");
36
+		}
36 37
 		return $element;
37 38
 	}
38 39
 
@@ -43,10 +44,11 @@  discard block
 block discarded – undo
43 44
 
44 45
 	public function setActive($value=true){
45 46
 		$this->_active=$value;
46
-		if($value===true)
47
-			$this->addToPropertyCtrl("class", "active", array("active"));
48
-		else
49
-			$this->removePropertyValue("class", "active");
47
+		if($value===true) {
48
+					$this->addToPropertyCtrl("class", "active", array("active"));
49
+		} else {
50
+					$this->removePropertyValue("class", "active");
51
+		}
50 52
 		return $this;
51 53
 	}
52 54
 }
53 55
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormField.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@  discard block
 block discarded – undo
8 8
 	public function __construct($identifier, $field,$label=NULL) {
9 9
 		parent::__construct($identifier, "div","ui field");
10 10
 		$this->content=array();
11
-		if(isset($label))
12
-			$this->setLabel($label);
11
+		if(isset($label)) {
12
+					$this->setLabel($label);
13
+		}
13 14
 		$this->setField($field);
14 15
 	}
15 16
 
@@ -28,8 +29,9 @@  discard block
 block discarded – undo
28 29
 	}
29 30
 
30 31
 	public function getLabel(){
31
-		if(\array_key_exists("label", $this->content))
32
-			return $this->content["label"];
32
+		if(\array_key_exists("label", $this->content)) {
33
+					return $this->content["label"];
34
+		}
33 35
 	}
34 36
 
35 37
 	public function getField(){
Please login to merge, or discard this patch.
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/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.