Passed
Push — master ( ee7fc7...175902 )
by Jean-Christophe
03:49
created
Ajax/common/traits/JsUtilsAjaxTrait.php 1 patch
Spacing   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -15,62 +15,62 @@  discard block
 block discarded – undo
15 15
 
16 16
 	protected $ajaxTransition;
17 17
 
18
-	protected $ajaxLoader = "<div class=\"ui active centered inline text loader\">Loading</div>";
18
+	protected $ajaxLoader="<div class=\"ui active centered inline text loader\">Loading</div>";
19 19
 
20 20
 	abstract public function getUrl($url);
21 21
 
22
-	abstract public function _add_event($element, $js, $event, $preventDefault = false, $stopPropagation = false, $immediatly = true);
22
+	abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true);
23 23
 
24
-	abstract public function interval($jsCode, $time, $globalName = null, $immediatly = true);
24
+	abstract public function interval($jsCode, $time, $globalName=null, $immediatly=true);
25 25
 
26
-	protected function _ajax($method, $url, $responseElement = "", $parameters = []) {
26
+	protected function _ajax($method, $url, $responseElement="", $parameters=[]) {
27 27
 		if (isset($this->params["ajax"])) {
28 28
 			extract($this->params["ajax"]);
29 29
 		}
30
-		$immediatly = false;
30
+		$immediatly=false;
31 31
 		extract($parameters);
32 32
 
33
-		$jsCallback = isset($jsCallback) ? $jsCallback : "";
34
-		$retour = $this->_getAjaxUrl($url, $attr);
35
-		$originalSelector = $responseElement;
36
-		$responseElement = $this->_getResponseElement($responseElement);
37
-		$retour .= "var self=this;\n";
38
-		$before = isset($before) ? $before : "";
39
-		$retour .= $before;
40
-		if ($hasLoader === true && JString::isNotNull($responseElement)) {
33
+		$jsCallback=isset($jsCallback) ? $jsCallback : "";
34
+		$retour=$this->_getAjaxUrl($url, $attr);
35
+		$originalSelector=$responseElement;
36
+		$responseElement=$this->_getResponseElement($responseElement);
37
+		$retour.="var self=this;\n";
38
+		$before=isset($before) ? $before : "";
39
+		$retour.=$before;
40
+		if ($hasLoader===true && JString::isNotNull($responseElement)) {
41 41
 			$this->addLoading($retour, $responseElement, $ajaxLoader);
42
-		} elseif ($hasLoader === "internal") {
43
-			$retour .= "\n$(this).addClass('loading');";
42
+		} elseif ($hasLoader==="internal") {
43
+			$retour.="\n$(this).addClass('loading');";
44 44
 		}
45
-		$ajaxParameters = [
45
+		$ajaxParameters=[
46 46
 			"url" => "url",
47
-			"method" => "'" . \strtoupper($method) . "'"
47
+			"method" => "'".\strtoupper($method)."'"
48 48
 		];
49 49
 
50
-		$ajaxParameters["async"] = ($async ? "true" : "false");
50
+		$ajaxParameters["async"]=($async ? "true" : "false");
51 51
 
52 52
 		if (isset($params)) {
53
-			$ajaxParameters["data"] = self::_correctParams($params, $parameters);
53
+			$ajaxParameters["data"]=self::_correctParams($params, $parameters);
54 54
 		}
55 55
 		if (isset($headers)) {
56
-			$ajaxParameters["headers"] = $headers;
56
+			$ajaxParameters["headers"]=$headers;
57 57
 		}
58 58
 		if (isset($partial)) {
59
-			$ajaxParameters["xhr"] = "xhrProvider";
60
-			$retour .= "var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;" . $partial . ";}; };";
59
+			$ajaxParameters["xhr"]="xhrProvider";
60
+			$retour.="var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;".$partial.";}; };";
61 61
 		}
62 62
 		$this->createAjaxParameters($ajaxParameters, $parameters);
63
-		$retour .= "$.ajax({" . $this->implodeAjaxParameters($ajaxParameters) . "}).done(function( data, textStatus, jqXHR ) {\n";
64
-		$retour .= $this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader, ($historize ? $originalSelector : null)) . "});\n";
63
+		$retour.="$.ajax({".$this->implodeAjaxParameters($ajaxParameters)."}).done(function( data, textStatus, jqXHR ) {\n";
64
+		$retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader, ($historize ? $originalSelector : null))."});\n";
65 65
 
66
-		$retour = $this->_addJsCondition($jsCondition, $retour);
66
+		$retour=$this->_addJsCondition($jsCondition, $retour);
67 67
 		if ($immediatly)
68
-			$this->jquery_code_for_compile[] = $retour;
68
+			$this->jquery_code_for_compile[]=$retour;
69 69
 		return $retour;
70 70
 	}
71 71
 
72 72
 	protected function createAjaxParameters(&$original, $parameters) {
73
-		$validParameters = [
73
+		$validParameters=[
74 74
 			"contentType" => "%value%",
75 75
 			"dataType" => "'%value%'",
76 76
 			"beforeSend" => "function(jqXHR,settings){%value%}",
@@ -79,21 +79,21 @@  discard block
 block discarded – undo
79 79
 		];
80 80
 		foreach ($validParameters as $param => $mask) {
81 81
 			if (isset($parameters[$param])) {
82
-				$original[$param] = \str_replace("%value%", $parameters[$param], $mask);
82
+				$original[$param]=\str_replace("%value%", $parameters[$param], $mask);
83 83
 			}
84 84
 		}
85 85
 	}
86 86
 
87 87
 	protected function implodeAjaxParameters($ajaxParameters) {
88
-		$s = '';
88
+		$s='';
89 89
 		foreach ($ajaxParameters as $k => $v) {
90
-			if ($s !== '') {
91
-				$s .= ',';
90
+			if ($s!=='') {
91
+				$s.=',';
92 92
 			}
93 93
 			if (is_array($v)) {
94
-				$s .= "'{$k}':{" . self::implodeAjaxParameters($v) . "}";
94
+				$s.="'{$k}':{".self::implodeAjaxParameters($v)."}";
95 95
 			} else {
96
-				$s .= "'{$k}':{$v}";
96
+				$s.="'{$k}':{$v}";
97 97
 			}
98 98
 		}
99 99
 		return $s;
@@ -101,27 +101,27 @@  discard block
 block discarded – undo
101 101
 
102 102
 	protected function _addJsCondition($jsCondition, $jsSource) {
103 103
 		if (isset($jsCondition)) {
104
-			return "if(" . $jsCondition . "){\n" . $jsSource . "\n}";
104
+			return "if(".$jsCondition."){\n".$jsSource."\n}";
105 105
 		}
106 106
 		return $jsSource;
107 107
 	}
108 108
 
109 109
 	protected function _getAjaxUrl($url, $attr) {
110
-		$url = $this->_correctAjaxUrl($url);
111
-		$retour = "url='" . $url . "';";
112
-		$slash = "/";
113
-		if (JString::endswith($url, "/") === true) {
114
-			$slash = "";
110
+		$url=$this->_correctAjaxUrl($url);
111
+		$retour="url='".$url."';";
112
+		$slash="/";
113
+		if (JString::endswith($url, "/")===true) {
114
+			$slash="";
115 115
 		}
116 116
 		if (JString::isNotNull($attr)) {
117
-			if ($attr === "value") {
118
-				$retour .= "url=url+'" . $slash . "'+$(this).val();\n";
119
-			} elseif ($attr === "html") {
120
-				$retour .= "url=url+'" . $slash . "'+$(this).html();\n";
121
-			} elseif (\substr($attr, 0, 3) === "js:") {
122
-				$retour .= "url=url+'" . $slash . "'+" . \substr($attr, 3) . ";\n";
123
-			} elseif ($attr !== null && $attr !== "")
124
-				$retour .= "url=url+'" . $slash . "'+($(this).attr('" . $attr . "')||'');\n";
117
+			if ($attr==="value") {
118
+				$retour.="url=url+'".$slash."'+$(this).val();\n";
119
+			} elseif ($attr==="html") {
120
+				$retour.="url=url+'".$slash."'+$(this).html();\n";
121
+			} elseif (\substr($attr, 0, 3)==="js:") {
122
+				$retour.="url=url+'".$slash."'+".\substr($attr, 3).";\n";
123
+			} elseif ($attr!==null && $attr!=="")
124
+				$retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n";
125 125
 		}
126 126
 		return $retour;
127 127
 	}
@@ -130,91 +130,91 @@  discard block
 block discarded – undo
130 130
 		return "window.onpopstate = function(e){if(e.state){var target=e.state.jqueryDone;$(e.state.selector)[target](e.state.html);}};";
131 131
 	}
132 132
 
133
-	protected function autoActiveLinks($previousURL = "window.location.href") {
134
-		$result = "\nfunction getHref(url) { return \$('a').filter(function(){return \$(this).prop('href') == url; });}";
135
-		$result .= "\nvar myurl={$previousURL};if(window._previousURL) getHref(window._previousURL).removeClass('active');getHref(myurl).addClass('active');window._previousURL=myurl;";
133
+	protected function autoActiveLinks($previousURL="window.location.href") {
134
+		$result="\nfunction getHref(url) { return \$('a').filter(function(){return \$(this).prop('href') == url; });}";
135
+		$result.="\nvar myurl={$previousURL};if(window._previousURL) getHref(window._previousURL).removeClass('active');getHref(myurl).addClass('active');window._previousURL=myurl;";
136 136
 		return $result;
137 137
 	}
138 138
 
139
-	protected function _getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader = false, $history = null) {
140
-		$retour = "";
141
-		$call = null;
139
+	protected function _getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader=false, $history=null) {
140
+		$retour="";
141
+		$call=null;
142 142
 		if (JString::isNotNull($responseElement)) {
143 143
 			if (isset($ajaxTransition)) {
144
-				$call = $this->setAjaxDataCall($ajaxTransition);
144
+				$call=$this->setAjaxDataCall($ajaxTransition);
145 145
 			} elseif (isset($this->ajaxTransition)) {
146
-				$call = $this->ajaxTransition;
146
+				$call=$this->ajaxTransition;
147 147
 			}
148 148
 			if (\is_callable($call))
149
-				$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
149
+				$retour="\t".$call($responseElement, $jqueryDone).";\n";
150 150
 			else
151
-				$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
151
+				$retour="\t{$responseElement}.{$jqueryDone}( data );\n";
152 152
 		}
153 153
 		if (isset($history)) {
154 154
 			if ($this->params["autoActiveLinks"]) {
155
-				$retour .= $this->autoActiveLinks("url");
155
+				$retour.=$this->autoActiveLinks("url");
156 156
 			}
157
-			$retour .= "\nwindow.history.pushState({'html':data,'selector':" . Javascript::prep_value($history) . ",'jqueryDone':'{$jqueryDone}'},'', url);";
157
+			$retour.="\nwindow.history.pushState({'html':data,'selector':".Javascript::prep_value($history).",'jqueryDone':'{$jqueryDone}'},'', url);";
158 158
 		}
159
-		if ($hasLoader === "internal") {
160
-			$retour .= "\n$(self).removeClass('loading');";
159
+		if ($hasLoader==="internal") {
160
+			$retour.="\n$(self).removeClass('loading');";
161 161
 		}
162
-		$retour .= "\t" . $jsCallback . "\n";
162
+		$retour.="\t".$jsCallback."\n";
163 163
 		return $retour;
164 164
 	}
165 165
 
166 166
 	protected function _getResponseElement($responseElement) {
167 167
 		if (JString::isNotNull($responseElement)) {
168
-			$responseElement = Javascript::prep_jquery_selector($responseElement);
168
+			$responseElement=Javascript::prep_jquery_selector($responseElement);
169 169
 		}
170 170
 		return $responseElement;
171 171
 	}
172 172
 
173 173
 	protected function _correctAjaxUrl($url) {
174
-		if ($url !== "/" && JString::endsWith($url, "/") === true)
175
-			$url = substr($url, 0, strlen($url) - 1);
176
-		if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) {
177
-			$url = $this->getUrl($url);
174
+		if ($url!=="/" && JString::endsWith($url, "/")===true)
175
+			$url=substr($url, 0, strlen($url)-1);
176
+		if (strncmp($url, 'http://', 7)!=0 && strncmp($url, 'https://', 8)!=0) {
177
+			$url=$this->getUrl($url);
178 178
 		}
179 179
 		return $url;
180 180
 	}
181 181
 
182
-	public static function _correctParams($params, $ajaxParameters = []) {
182
+	public static function _correctParams($params, $ajaxParameters=[]) {
183 183
 		if (JString::isNull($params)) {
184 184
 			return "";
185 185
 		}
186 186
 		if (\preg_match("@^\{.*?\}$@", $params)) {
187
-			if (! isset($ajaxParameters['contentType']) || ! JString::contains($ajaxParameters['contentType'], 'json')) {
188
-				return '$.param(' . $params . ')';
187
+			if (!isset($ajaxParameters['contentType']) || !JString::contains($ajaxParameters['contentType'], 'json')) {
188
+				return '$.param('.$params.')';
189 189
 			} else {
190
-				return 'JSON.stringify(' . $params . ')';
190
+				return 'JSON.stringify('.$params.')';
191 191
 			}
192 192
 		}
193 193
 		return $params;
194 194
 	}
195 195
 
196 196
 	public static function _implodeParams($parameters) {
197
-		$allParameters = [];
197
+		$allParameters=[];
198 198
 		foreach ($parameters as $params) {
199 199
 			if (isset($params))
200
-				$allParameters[] = self::_correctParams($params);
200
+				$allParameters[]=self::_correctParams($params);
201 201
 		}
202 202
 		return \implode("+'&'+", $allParameters);
203 203
 	}
204 204
 
205
-	protected function addLoading(&$retour, $responseElement, $ajaxLoader = null) {
206
-		if (! isset($ajaxLoader)) {
207
-			$ajaxLoader = $this->ajaxLoader;
205
+	protected function addLoading(&$retour, $responseElement, $ajaxLoader=null) {
206
+		if (!isset($ajaxLoader)) {
207
+			$ajaxLoader=$this->ajaxLoader;
208 208
 		}
209
-		$loading_notifier = '<div class="ajax-loader">' . $ajaxLoader . '</div>';
210
-		$retour .= "{$responseElement}.empty();\n";
211
-		$retour .= "\t\t{$responseElement}.prepend('{$loading_notifier}');\n";
209
+		$loading_notifier='<div class="ajax-loader">'.$ajaxLoader.'</div>';
210
+		$retour.="{$responseElement}.empty();\n";
211
+		$retour.="\t\t{$responseElement}.prepend('{$loading_notifier}');\n";
212 212
 	}
213 213
 
214 214
 	protected function setAjaxDataCall($params) {
215
-		$result = null;
216
-		if (! \is_callable($params)) {
217
-			$result = function ($responseElement, $jqueryDone = "html") use ($params) {
215
+		$result=null;
216
+		if (!\is_callable($params)) {
217
+			$result=function($responseElement, $jqueryDone="html") use ($params) {
218 218
 				return AjaxTransition::{$params}($responseElement, $jqueryDone);
219 219
 			};
220 220
 		}
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
 
224 224
 	protected function setDefaultParameters(&$parameters, $default) {
225 225
 		foreach ($default as $k => $v) {
226
-			if (! isset($parameters[$k]))
227
-				$parameters[$k] = $v;
226
+			if (!isset($parameters[$k]))
227
+				$parameters[$k]=$v;
228 228
 		}
229 229
 	}
230 230
 
231 231
 	public function setAjaxLoader($loader) {
232
-		$this->ajaxLoader = $loader;
232
+		$this->ajaxLoader=$loader;
233 233
 	}
234 234
 
235 235
 	/**
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 * @param string $responseElement
241 241
 	 *        	selector of the HTML element displaying the answer
242 242
 	 */
243
-	private function _get($url, $responseElement = "", $parameters = []) {
243
+	private function _get($url, $responseElement="", $parameters=[]) {
244 244
 		return $this->_ajax("get", $url, $responseElement, $parameters);
245 245
 	}
246 246
 
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 	 * @param array $parameters
255 255
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
256 256
 	 */
257
-	public function get($url, $responseElement = "", $parameters = []) {
258
-		$parameters["immediatly"] = true;
257
+	public function get($url, $responseElement="", $parameters=[]) {
258
+		$parameters["immediatly"]=true;
259 259
 		return $this->_get($url, $responseElement, $parameters);
260 260
 	}
261 261
 
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
 	 * @param array $parameters
272 272
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
273 273
 	 */
274
-	public function ajax($method, $url, $responseElement = "", $parameters = []) {
275
-		$parameters["immediatly"] = true;
274
+	public function ajax($method, $url, $responseElement="", $parameters=[]) {
275
+		$parameters["immediatly"]=true;
276 276
 		return $this->_ajax($method, $url, $responseElement, $parameters);
277 277
 	}
278 278
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 	 *        	$immediatly
295 295
 	 * @return string
296 296
 	 */
297
-	public function ajaxInterval($method, $url, $interval, $globalName = null, $responseElement = "", $parameters = [], $immediatly = true) {
297
+	public function ajaxInterval($method, $url, $interval, $globalName=null, $responseElement="", $parameters=[], $immediatly=true) {
298 298
 		return $this->interval($this->ajaxDeferred($method, $url, $responseElement, $parameters), $interval, $globalName, $immediatly);
299 299
 	}
300 300
 
@@ -310,8 +310,8 @@  discard block
 block discarded – undo
310 310
 	 * @param array $parameters
311 311
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
312 312
 	 */
313
-	public function ajaxDeferred($method, $url, $responseElement = "", $parameters = []) {
314
-		$parameters["immediatly"] = false;
313
+	public function ajaxDeferred($method, $url, $responseElement="", $parameters=[]) {
314
+		$parameters["immediatly"]=false;
315 315
 		return $this->_ajax($method, $url, $responseElement, $parameters);
316 316
 	}
317 317
 
@@ -325,15 +325,15 @@  discard block
 block discarded – undo
325 325
 	 * @param array $parameters
326 326
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)
327 327
 	 */
328
-	private function _json($url, $method = "get", $parameters = []) {
329
-		$parameters = \array_merge($parameters, [
328
+	private function _json($url, $method="get", $parameters=[]) {
329
+		$parameters=\array_merge($parameters, [
330 330
 			"hasLoader" => false
331 331
 		]);
332
-		$jsCallback = isset($parameters['jsCallback']) ? $parameters['jsCallback'] : "";
333
-		$context = isset($parameters['context']) ? $parameters['context'] : "document";
334
-		$retour = "\tdata=($.isPlainObject(data))?data:JSON.parse(data);\t" . $jsCallback . ";" . "\n\tfor(var key in data){" . "if($('#'+key," . $context . ").length){ if($('#'+key," . $context . ").is('[value]')) { $('#'+key," . $context . ").val(data[key]);} else { $('#'+key," . $context . ").html(data[key]); }}};\n";
335
-		$retour .= "\t$(document).trigger('jsonReady',[data]);\n";
336
-		$parameters["jsCallback"] = $retour;
332
+		$jsCallback=isset($parameters['jsCallback']) ? $parameters['jsCallback'] : "";
333
+		$context=isset($parameters['context']) ? $parameters['context'] : "document";
334
+		$retour="\tdata=($.isPlainObject(data))?data:JSON.parse(data);\t".$jsCallback.";"."\n\tfor(var key in data){"."if($('#'+key,".$context.").length){ if($('#'+key,".$context.").is('[value]')) { $('#'+key,".$context.").val(data[key]);} else { $('#'+key,".$context.").html(data[key]); }}};\n";
335
+		$retour.="\t$(document).trigger('jsonReady',[data]);\n";
336
+		$parameters["jsCallback"]=$retour;
337 337
 		return $this->_ajax($method, $url, null, $parameters);
338 338
 	}
339 339
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	 * @param array $parameters
348 348
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)
349 349
 	 */
350
-	public function json($url, $method = "get", $parameters = []) {
350
+	public function json($url, $method="get", $parameters=[]) {
351 351
 		return $this->_json($url, $method, $parameters);
352 352
 	}
353 353
 
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 	 * @param array $parameters
364 364
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true,"before"=>null)
365 365
 	 */
366
-	public function jsonOn($event, $element, $url, $method = "get", $parameters = array()) {
366
+	public function jsonOn($event, $element, $url, $method="get", $parameters=array()) {
367 367
 		$this->setDefaultParameters($parameters, [
368 368
 			"preventDefault" => true,
369 369
 			"stopPropagation" => true,
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 	 * @param array $parameters
383 383
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)
384 384
 	 */
385
-	public function jsonDeferred($url, $method = "get", $parameters = []) {
386
-		$parameters["immediatly"] = false;
385
+	public function jsonDeferred($url, $method="get", $parameters=[]) {
386
+		$parameters["immediatly"]=false;
387 387
 		return $this->_json($url, $method, $parameters);
388 388
 	}
389 389
 
@@ -398,29 +398,29 @@  discard block
 block discarded – undo
398 398
 	 * @param array $parameters
399 399
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"rowClass"=>"_json","before"=>null)
400 400
 	 */
401
-	private function _jsonArray($maskSelector, $url, $method = "get", $parameters = []) {
402
-		$parameters = \array_merge($parameters, [
401
+	private function _jsonArray($maskSelector, $url, $method="get", $parameters=[]) {
402
+		$parameters=\array_merge($parameters, [
403 403
 			"hasLoader" => false
404 404
 		]);
405
-		$rowClass = isset($parameters['rowClass']) ? $parameters['rowClass'] : "_json";
406
-		$jsCallback = isset($parameters['jsCallback']) ? $parameters['jsCallback'] : "";
407
-		$context = isset($parameters['context']) ? $parameters['context'] : null;
408
-		if ($context === null) {
409
-			$parent = "$('" . $maskSelector . "').parent()";
410
-			$newElm = "$('#'+newId)";
405
+		$rowClass=isset($parameters['rowClass']) ? $parameters['rowClass'] : "_json";
406
+		$jsCallback=isset($parameters['jsCallback']) ? $parameters['jsCallback'] : "";
407
+		$context=isset($parameters['context']) ? $parameters['context'] : null;
408
+		if ($context===null) {
409
+			$parent="$('".$maskSelector."').parent()";
410
+			$newElm="$('#'+newId)";
411 411
 		} else {
412
-			$parent = $context;
413
-			$newElm = $context . ".find('#'+newId)";
412
+			$parent=$context;
413
+			$newElm=$context.".find('#'+newId)";
414 414
 		}
415
-		$appendTo = "\t\tnewElm.appendTo(" . $parent . ");\n";
416
-		$retour = $parent . ".find('.{$rowClass}').remove();";
417
-		$retour .= "\tdata=($.isPlainObject(data)||$.isArray(data))?data:JSON.parse(data);\n$.each(data, function(index, value) {\n" . "\tvar created=false;var maskElm=$('" . $maskSelector . "').first();maskElm.hide();" . "\tvar newId=(maskElm.attr('id') || 'mask')+'-'+index;" . "\tvar newElm=" . $newElm . ";\n" . "\tif(!newElm.length){\n" . "\t\tnewElm=maskElm.clone();
415
+		$appendTo="\t\tnewElm.appendTo(".$parent.");\n";
416
+		$retour=$parent.".find('.{$rowClass}').remove();";
417
+		$retour.="\tdata=($.isPlainObject(data)||$.isArray(data))?data:JSON.parse(data);\n$.each(data, function(index, value) {\n"."\tvar created=false;var maskElm=$('".$maskSelector."').first();maskElm.hide();"."\tvar newId=(maskElm.attr('id') || 'mask')+'-'+index;"."\tvar newElm=".$newElm.";\n"."\tif(!newElm.length){\n"."\t\tnewElm=maskElm.clone();
418 418
 		newElm.attr('id',newId);\n;newElm.addClass('{$rowClass}').removeClass('_jsonArrayModel');\nnewElm.find('[id]').each(function(){ var newId=$(this).attr('id')+'-'+index;$(this).attr('id',newId).removeClass('_jsonArrayChecked');});\n";
419
-		$retour .= $appendTo;
420
-		$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";
421
-		$retour .= "\t$(document).trigger('jsonReady',[data]);\n";
422
-		$retour .= "\t" . $jsCallback;
423
-		$parameters["jsCallback"] = $retour;
419
+		$retour.=$appendTo;
420
+		$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";
421
+		$retour.="\t$(document).trigger('jsonReady',[data]);\n";
422
+		$retour.="\t".$jsCallback;
423
+		$parameters["jsCallback"]=$retour;
424 424
 		return $this->_ajax($method, $url, null, $parameters);
425 425
 	}
426 426
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	 * @param array $parameters
436 436
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"rowClass"=>"_json","before"=>null)
437 437
 	 */
438
-	public function jsonArray($maskSelector, $url, $method = "get", $parameters = []) {
438
+	public function jsonArray($maskSelector, $url, $method="get", $parameters=[]) {
439 439
 		return $this->_jsonArray($maskSelector, $url, $method, $parameters);
440 440
 	}
441 441
 
@@ -450,8 +450,8 @@  discard block
 block discarded – undo
450 450
 	 * @param array $parameters
451 451
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"rowClass"=>"_json","before"=>null)
452 452
 	 */
453
-	public function jsonArrayDeferred($maskSelector, $url, $method = "get", $parameters) {
454
-		$parameters["immediatly"] = false;
453
+	public function jsonArrayDeferred($maskSelector, $url, $method="get", $parameters) {
454
+		$parameters["immediatly"]=false;
455 455
 		return $this->jsonArray($maskSelector, $url, $method, $parameters);
456 456
 	}
457 457
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 	 * @param array $parameters
468 468
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","rowClass"=>"_json","immediatly"=>true,"before"=>null)
469 469
 	 */
470
-	public function jsonArrayOn($event, $element, $maskSelector, $url, $method = "get", $parameters = array()) {
470
+	public function jsonArrayOn($event, $element, $maskSelector, $url, $method="get", $parameters=array()) {
471 471
 		$this->setDefaultParameters($parameters, [
472 472
 			"preventDefault" => true,
473 473
 			"stopPropagation" => true,
@@ -487,8 +487,8 @@  discard block
 block discarded – undo
487 487
 	 * @param array $parameters
488 488
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
489 489
 	 */
490
-	public function getDeferred($url, $responseElement = "", $parameters = []) {
491
-		$parameters["immediatly"] = false;
490
+	public function getDeferred($url, $responseElement="", $parameters=[]) {
491
+		$parameters["immediatly"]=false;
492 492
 		return $this->_get($url, $responseElement, $parameters);
493 493
 	}
494 494
 
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 	 * @param array $parameters
508 508
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null)
509 509
 	 */
510
-	public function getOn($event, $element, $url, $responseElement = "", $parameters = array()) {
510
+	public function getOn($event, $element, $url, $responseElement="", $parameters=array()) {
511 511
 		$this->setDefaultParameters($parameters, [
512 512
 			"preventDefault" => true,
513 513
 			"stopPropagation" => true,
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 	 * @param array $parameters
532 532
 	 *        	default : array("method"=>"get","preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
533 533
 	 */
534
-	public function ajaxOn($event, $element, $url, $responseElement = "", $parameters = array()) {
534
+	public function ajaxOn($event, $element, $url, $responseElement="", $parameters=array()) {
535 535
 		$this->setDefaultParameters($parameters, [
536 536
 			"preventDefault" => true,
537 537
 			"stopPropagation" => true,
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 	 * @param array $parameters
555 555
 	 *        	default : array("method"=>"get","preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
556 556
 	 */
557
-	public function ajaxOnClick($element, $url, $responseElement = "", $parameters = array()) {
557
+	public function ajaxOnClick($element, $url, $responseElement="", $parameters=array()) {
558 558
 		return $this->ajaxOn("click", $element, $url, $responseElement, $parameters);
559 559
 	}
560 560
 
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 	 * @param array $parameters
572 572
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
573 573
 	 */
574
-	public function getOnClick($element, $url, $responseElement = "", $parameters = array()) {
574
+	public function getOnClick($element, $url, $responseElement="", $parameters=array()) {
575 575
 		return $this->getOn("click", $element, $url, $responseElement, $parameters);
576 576
 	}
577 577
 
@@ -586,15 +586,15 @@  discard block
 block discarded – undo
586 586
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null)
587 587
 	 * @return $this
588 588
 	 */
589
-	public function getHref($element, $responseElement = "", $parameters = array()) {
590
-		$parameters["attr"] = "href";
589
+	public function getHref($element, $responseElement="", $parameters=array()) {
590
+		$parameters["attr"]="href";
591 591
 		if (JString::isNull($responseElement)) {
592
-			$responseElement = '%$(self).attr("data-target")%';
592
+			$responseElement='%$(self).attr("data-target")%';
593 593
 		} else {
594
-			$responseElement = '%$(self).attr("data-target") || "' . $responseElement . '"%';
594
+			$responseElement='%$(self).attr("data-target") || "'.$responseElement.'"%';
595 595
 		}
596
-		if (! isset($parameters["historize"])) {
597
-			$parameters["historize"] = true;
596
+		if (!isset($parameters["historize"])) {
597
+			$parameters["historize"]=true;
598 598
 		}
599 599
 		return $this->getOnClick($element, "", $responseElement, $parameters);
600 600
 	}
@@ -610,21 +610,21 @@  discard block
 block discarded – undo
610 610
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null)
611 611
 	 * @return $this
612 612
 	 */
613
-	public function postHref($element, $responseElement = "", $parameters = array()) {
614
-		$parameters["attr"] = "href";
613
+	public function postHref($element, $responseElement="", $parameters=array()) {
614
+		$parameters["attr"]="href";
615 615
 		if (JString::isNull($responseElement)) {
616
-			$responseElement = '%$(this).attr("data-target")%';
616
+			$responseElement='%$(this).attr("data-target")%';
617 617
 		} else {
618
-			$responseElement = '%$(self).attr("data-target") || "' . $responseElement . '"%';
618
+			$responseElement='%$(self).attr("data-target") || "'.$responseElement.'"%';
619 619
 		}
620
-		if (! isset($parameters["historize"])) {
621
-			$parameters["historize"] = true;
620
+		if (!isset($parameters["historize"])) {
621
+			$parameters["historize"]=true;
622 622
 		}
623 623
 		return $this->postOnClick($element, "", "{}", $responseElement, $parameters);
624 624
 	}
625 625
 
626
-	private function _post($url, $params = "{}", $responseElement = "", $parameters = []) {
627
-		$parameters["params"] = $params;
626
+	private function _post($url, $params="{}", $responseElement="", $parameters=[]) {
627
+		$parameters["params"]=$params;
628 628
 		return $this->_ajax("POST", $url, $responseElement, $parameters);
629 629
 	}
630 630
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 * @param array $parameters
641 641
 	 *        	default : array("jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
642 642
 	 */
643
-	public function post($url, $params = "{}", $responseElement = "", $parameters = []) {
643
+	public function post($url, $params="{}", $responseElement="", $parameters=[]) {
644 644
 		return $this->_post($url, $params, $responseElement, $parameters);
645 645
 	}
646 646
 
@@ -657,8 +657,8 @@  discard block
 block discarded – undo
657 657
 	 * @param array $parameters
658 658
 	 *        	default : array("jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
659 659
 	 */
660
-	public function postDeferred($url, $params = "{}", $responseElement = "", $parameters = []) {
661
-		$parameters["immediatly"] = false;
660
+	public function postDeferred($url, $params="{}", $responseElement="", $parameters=[]) {
661
+		$parameters["immediatly"]=false;
662 662
 		return $this->_post($url, $params, $responseElement, $parameters);
663 663
 	}
664 664
 
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 	 * @param array $parameters
678 678
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
679 679
 	 */
680
-	public function postOn($event, $element, $url, $params = "{}", $responseElement = "", $parameters = array()) {
680
+	public function postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
681 681
 		$this->setDefaultParameters($parameters, [
682 682
 			"preventDefault" => true,
683 683
 			"stopPropagation" => true,
@@ -700,64 +700,64 @@  discard block
 block discarded – undo
700 700
 	 * @param array $parameters
701 701
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"before"=>null)
702 702
 	 */
703
-	public function postOnClick($element, $url, $params = "{}", $responseElement = "", $parameters = array()) {
703
+	public function postOnClick($element, $url, $params="{}", $responseElement="", $parameters=array()) {
704 704
 		return $this->postOn("click", $element, $url, $params, $responseElement, $parameters);
705 705
 	}
706 706
 
707
-	private function _postForm($url, $form, $responseElement, $parameters = []) {
707
+	private function _postForm($url, $form, $responseElement, $parameters=[]) {
708 708
 		if (isset($this->params["ajax"])) {
709 709
 			extract($this->params["ajax"]);
710 710
 		}
711
-		$params = "{}";
712
-		$validation = false;
711
+		$params="{}";
712
+		$validation=false;
713 713
 		\extract($parameters);
714
-		$async = ($async) ? "true" : "false";
715
-		$jsCallback = isset($jsCallback) ? $jsCallback : "";
716
-		$retour = $this->_getAjaxUrl($url, $attr);
717
-		$retour .= "\n$('#" . $form . "').trigger('ajaxSubmit');";
718
-		if (! isset($contentType) || $contentType != 'false') {
719
-			$retour .= "\nvar params=$('#" . $form . "').serialize();\n";
714
+		$async=($async) ? "true" : "false";
715
+		$jsCallback=isset($jsCallback) ? $jsCallback : "";
716
+		$retour=$this->_getAjaxUrl($url, $attr);
717
+		$retour.="\n$('#".$form."').trigger('ajaxSubmit');";
718
+		if (!isset($contentType) || $contentType!='false') {
719
+			$retour.="\nvar params=$('#".$form."').serialize();\n";
720 720
 			if (isset($params)) {
721
-				$retour .= "params+='&'+" . self::_correctParams($params) . ";\n";
721
+				$retour.="params+='&'+".self::_correctParams($params).";\n";
722 722
 			}
723 723
 		} else {
724
-			$retour .= "\nvar params=new FormData($('#" . $form . "')[0]);\n";
724
+			$retour.="\nvar params=new FormData($('#".$form."')[0]);\n";
725 725
 		}
726
-		$responseElement = $this->_getResponseElement($responseElement);
727
-		$retour .= "var self=this;\n";
728
-		$before = isset($before) ? $before : "";
729
-		$retour .= $before;
730
-		if ($hasLoader === true) {
726
+		$responseElement=$this->_getResponseElement($responseElement);
727
+		$retour.="var self=this;\n";
728
+		$before=isset($before) ? $before : "";
729
+		$retour.=$before;
730
+		if ($hasLoader===true) {
731 731
 			$this->addLoading($retour, $responseElement, $ajaxLoader);
732
-		} elseif ($hasLoader === "internal") {
733
-			$retour .= "\n$(this).addClass('loading');";
732
+		} elseif ($hasLoader==="internal") {
733
+			$retour.="\n$(this).addClass('loading');";
734 734
 		}
735
-		$ajaxParameters = [
735
+		$ajaxParameters=[
736 736
 			"url" => "url",
737 737
 			"method" => "'POST'",
738 738
 			"data" => "params",
739 739
 			"async" => $async
740 740
 		];
741 741
 		if (isset($headers)) {
742
-			$ajaxParameters["headers"] = $headers;
742
+			$ajaxParameters["headers"]=$headers;
743 743
 		}
744 744
 		if (isset($partial)) {
745
-			$ajaxParameters["xhr"] = "xhrProvider";
746
-			$retour .= "var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;" . $partial . ";}; };";
745
+			$ajaxParameters["xhr"]="xhrProvider";
746
+			$retour.="var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;".$partial.";}; };";
747 747
 		}
748 748
 		$this->createAjaxParameters($ajaxParameters, $parameters);
749
-		$retour .= "$.ajax({" . $this->implodeAjaxParameters($ajaxParameters) . "}).done(function( data ) {\n";
750
-		$retour .= $this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader) . "});\n";
749
+		$retour.="$.ajax({".$this->implodeAjaxParameters($ajaxParameters)."}).done(function( data ) {\n";
750
+		$retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader)."});\n";
751 751
 
752 752
 		if ($validation) {
753
-			$retour = "$('#" . $form . "').validate({submitHandler: function(form) {
754
-			" . $retour . "
753
+			$retour="$('#".$form."').validate({submitHandler: function(form) {
754
+			" . $retour."
755 755
 			}});\n";
756
-			$retour .= "$('#" . $form . "').submit();\n";
756
+			$retour.="$('#".$form."').submit();\n";
757 757
 		}
758
-		$retour = $this->_addJsCondition($jsCondition, $retour);
758
+		$retour=$this->_addJsCondition($jsCondition, $retour);
759 759
 		if ($immediatly)
760
-			$this->jquery_code_for_compile[] = $retour;
760
+			$this->jquery_code_for_compile[]=$retour;
761 761
 		return $retour;
762 762
 	}
763 763
 
@@ -773,8 +773,8 @@  discard block
 block discarded – undo
773 773
 	 * @param array $parameters
774 774
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
775 775
 	 */
776
-	public function postForm($url, $form, $responseElement, $parameters = []) {
777
-		$parameters["immediatly"] = true;
776
+	public function postForm($url, $form, $responseElement, $parameters=[]) {
777
+		$parameters["immediatly"]=true;
778 778
 		return $this->_postForm($url, $form, $responseElement, $parameters);
779 779
 	}
780 780
 
@@ -791,8 +791,8 @@  discard block
 block discarded – undo
791 791
 	 * @param array $parameters
792 792
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
793 793
 	 */
794
-	public function postFormDeferred($url, $form, $responseElement, $parameters = []) {
795
-		$parameters["immediatly"] = false;
794
+	public function postFormDeferred($url, $form, $responseElement, $parameters=[]) {
795
+		$parameters["immediatly"]=false;
796 796
 		return $this->_postForm($url, $form, $responseElement, $parameters);
797 797
 	}
798 798
 
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	 * @param array $parameters
810 810
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null)
811 811
 	 */
812
-	public function postFormOn($event, $element, $url, $form, $responseElement = "", $parameters = array()) {
812
+	public function postFormOn($event, $element, $url, $form, $responseElement="", $parameters=array()) {
813 813
 		$this->setDefaultParameters($parameters, [
814 814
 			"preventDefault" => true,
815 815
 			"stopPropagation" => true,
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 	 * @param array $parameters
831 831
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null)
832 832
 	 */
833
-	public function postFormOnClick($element, $url, $form, $responseElement = "", $parameters = array()) {
833
+	public function postFormOnClick($element, $url, $form, $responseElement="", $parameters=array()) {
834 834
 		return $this->postFormOn("click", $element, $url, $form, $responseElement, $parameters);
835 835
 	}
836 836
 }
Please login to merge, or discard this patch.