Completed
Push — master ( b465d4...6e3264 )
by Jean-Christophe
03:19
created
Ajax/Bootstrap.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -267,8 +267,8 @@  discard block
 block discarded – undo
267 267
 	 * @param string $tagName container tagName
268 268
 	 * @return HtmlListgroup
269 269
 	 */
270
-	public function htmlListgroup($identifier,$items=array(),$tagName="ul"){
271
-		$listGroup=new HtmlListgroup($identifier,$tagName);
270
+	public function htmlListgroup($identifier, $items=array(), $tagName="ul") {
271
+		$listGroup=new HtmlListgroup($identifier, $tagName);
272 272
 		$listGroup->addItems($items);
273 273
 		return $this->addHtmlComponent($listGroup);
274 274
 	}
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
 	 * @param string $onClick
294 294
 	 * @return HtmlSplitbutton
295 295
 	 */
296
-	public function htmlSplitbutton($identifier,$value="", $items=array(), $cssStyle="btn-default", $onClick=NULL) {
297
-		return $this->addHtmlComponent(new HtmlSplitbutton($identifier, $value, $items, $cssStyle,$onClick));
296
+	public function htmlSplitbutton($identifier, $value="", $items=array(), $cssStyle="btn-default", $onClick=NULL) {
297
+		return $this->addHtmlComponent(new HtmlSplitbutton($identifier, $value, $items, $cssStyle, $onClick));
298 298
 	}
299 299
 
300 300
 	/**
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	 * @param string $identifier
303 303
 	 * @return HtmlInputgroup
304 304
 	 */
305
-	public function htmlInputgroup($identifier){
305
+	public function htmlInputgroup($identifier) {
306 306
 		return $this->addHtmlComponent(new HtmlInputgroup($identifier));
307 307
 	}
308 308
 	
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
315 315
 	 * @return HtmlBreadcrumbs
316 316
 	 */
317
-	public function htmlBreadcrumbs($identifier,$elements=array(),$autoActive=true,$hrefFunction=NULL){
318
-		return $this->addHtmlComponent(new HtmlBreadcrumbs($identifier,$elements,$autoActive,$hrefFunction));
317
+	public function htmlBreadcrumbs($identifier, $elements=array(), $autoActive=true, $hrefFunction=NULL) {
318
+		return $this->addHtmlComponent(new HtmlBreadcrumbs($identifier, $elements, $autoActive, $hrefFunction));
319 319
 	}
320 320
 }
321 321
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/Jquery.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 	protected $_bootstrap;
22 22
 	protected $libraryFile;
23 23
 	protected $_javascript_folder='js';
24
-	protected $jquery_code_for_load=array ();
25
-	protected $jquery_code_for_compile=array ();
24
+	protected $jquery_code_for_load=array();
25
+	protected $jquery_code_for_compile=array();
26 26
 	protected $jquery_corner_active=FALSE;
27 27
 	protected $jquery_table_sorter_active=FALSE;
28 28
 	protected $jquery_table_sorter_pager_active=FALSE;
29 29
 	protected $ajaxLoader='<span></span><span></span><span></span><span></span><span></span>';
30
-	protected $jquery_events=array (
31
-			"bind","blur","change","click","dblclick","delegate","die","error","focus","focusin","focusout","hover","keydown","keypress","keyup","live","load","mousedown","mousseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","off","on","one","ready","resize","scroll","select","submit","toggle","trigger","triggerHandler","undind","undelegate","unload"
30
+	protected $jquery_events=array(
31
+			"bind", "blur", "change", "click", "dblclick", "delegate", "die", "error", "focus", "focusin", "focusout", "hover", "keydown", "keypress", "keyup", "live", "load", "mousedown", "mousseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "off", "on", "one", "ready", "resize", "scroll", "select", "submit", "toggle", "trigger", "triggerHandler", "undind", "undelegate", "unload"
32 32
 	);
33 33
 
34 34
 	public function setDi($di) {
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 */
162 162
 	public function _click($element='this', $js=array(), $ret_false=TRUE) {
163 163
 		if (!is_array($js)) {
164
-			$js=array (
164
+			$js=array(
165 165
 					$js
166 166
 			);
167 167
 		}
@@ -345,12 +345,12 @@  discard block
 block discarded – undo
345 345
 	 */
346 346
 	public function _output($array_js='') {
347 347
 		if (!is_array($array_js)) {
348
-			$array_js=array (
348
+			$array_js=array(
349 349
 					$array_js
350 350
 			);
351 351
 		}
352 352
 
353
-		foreach ( $array_js as $js ) {
353
+		foreach ($array_js as $js) {
354 354
 			$this->jquery_code_for_compile[]="\t$js\n";
355 355
 		}
356 356
 	}
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 		if (isset($value)) {
427 427
 			$value=$this->_prep_value($value);
428 428
 			$str="$({$element}).attr(\"$attributeName\",{$value});";
429
-		} else
429
+		}else
430 430
 			$str="$({$element}).attr(\"$attributeName\");";
431 431
 		if ($immediatly)
432 432
 			$this->jquery_code_for_compile[]=$str;
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 		if (isset($value)) {
445 445
 			$value=$this->_prep_value($value);
446 446
 			$str="$({$element}).html({$value});";
447
-		} else
447
+		}else
448 448
 			$str="$({$element}).html();";
449 449
 		if ($immediatly)
450 450
 			$this->jquery_code_for_compile[]=$str;
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 
470 470
 		$animations="\t\t\t";
471 471
 		if (is_array($params)) {
472
-			foreach ( $params as $param => $value ) {
472
+			foreach ($params as $param => $value) {
473 473
 				$animations.=$param.': \''.$value.'\', ';
474 474
 			}
475 475
 		}
@@ -807,12 +807,12 @@  discard block
 block discarded – undo
807 807
 	 */
808 808
 	public function sortable($element, $options=array()) {
809 809
 		if (count($options)>0) {
810
-			$sort_options=array ();
811
-			foreach ( $options as $k => $v ) {
810
+			$sort_options=array();
811
+			foreach ($options as $k => $v) {
812 812
 				$sort_options[]="\n\t\t".$k.': '.$v."";
813 813
 			}
814 814
 			$sort_options=implode(",", $sort_options);
815
-		} else {
815
+		}else {
816 816
 			$sort_options='';
817 817
 		}
818 818
 
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
 
894 894
 		// External references
895 895
 		$external_scripts=implode('', $this->jquery_code_for_load);
896
-		extract(array (
896
+		extract(array(
897 897
 				'library_src' => $external_scripts
898 898
 		));
899 899
 
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 	 * @return void
927 927
 	 */
928 928
 	public function _clear_compile() {
929
-		$this->jquery_code_for_compile=array ();
929
+		$this->jquery_code_for_compile=array();
930 930
 	}
931 931
 
932 932
 	// --------------------------------------------------------------------
@@ -938,12 +938,12 @@  discard block
 block discarded – undo
938 938
 	 */
939 939
 	public function _document_ready($js) {
940 940
 		if (!is_array($js)) {
941
-			$js=array (
941
+			$js=array(
942 942
 					$js
943 943
 			);
944 944
 		}
945 945
 
946
-		foreach ( $js as $script ) {
946
+		foreach ($js as $script) {
947 947
 			$this->jquery_code_for_compile[]=$script;
948 948
 		}
949 949
 	}
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 	 * @return string
960 960
 	 */
961 961
 	public function _prep_element($element) {
962
-		if (strrpos($element, 'this')===false&&strrpos($element, 'event')===false) {
962
+		if (strrpos($element, 'this')===false && strrpos($element, 'event')===false) {
963 963
 			$element='"'.$element.'"';
964 964
 		}
965 965
 		return $element;
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 		if (is_array($value)) {
978 978
 			$value=implode(",", $value);
979 979
 		}
980
-		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false) {
980
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) {
981 981
 			$value='"'.$value.'"';
982 982
 		}
983 983
 		return $value;
@@ -992,8 +992,8 @@  discard block
 block discarded – undo
992 992
 	 * @return string
993 993
 	 */
994 994
 	private function _validate_speed($speed) {
995
-		if (in_array($speed, array (
996
-				'slow','normal','fast'
995
+		if (in_array($speed, array(
996
+				'slow', 'normal', 'fast'
997 997
 		))) {
998 998
 			$speed='"'.$speed.'"';
999 999
 		} elseif (preg_match("/[^0-9]/", $speed)) {
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 		$loading_notifier='<div class="ajax-loader">';
1008 1008
 		if ($this->ajaxLoader=='') {
1009 1009
 			$loading_notifier.="Loading...";
1010
-		} else {
1010
+		}else {
1011 1011
 			$loading_notifier.=$this->ajaxLoader;
1012 1012
 		}
1013 1013
 		$loading_notifier.='</div>';
@@ -1015,18 +1015,18 @@  discard block
 block discarded – undo
1015 1015
 		$retour.="\t\t$(\"{$responseElement}\").prepend('{$loading_notifier}');\n";
1016 1016
 	}
1017 1017
 
1018
-	public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
1019
-		return $this->_ajax("get", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly);
1018
+	public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
1019
+		return $this->_ajax("get", $url, $params, $responseElement, $jsCallback, $attr, $hasLoader, $immediatly);
1020 1020
 	}
1021
-	public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
1022
-		return $this->_ajax("post", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly);
1021
+	public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
1022
+		return $this->_ajax("post", $url, $params, $responseElement, $jsCallback, $attr, $hasLoader, $immediatly);
1023 1023
 	}
1024 1024
 
1025
-	protected function _ajax($method,$url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
1026
-		if(JString::isNull($params)){$params="{}";}
1025
+	protected function _ajax($method, $url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
1026
+		if (JString::isNull($params)) {$params="{}"; }
1027 1027
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
1028 1028
 		$retour=$this->_getAjaxUrl($url, $attr);
1029
-		if($hasLoader===true){
1029
+		if ($hasLoader===true) {
1030 1030
 			$this->addLoading($retour, $responseElement);
1031 1031
 		}
1032 1032
 		$retour.="$.".$method."(url,".$params.").done(function( data ) {\n";
@@ -1036,19 +1036,19 @@  discard block
 block discarded – undo
1036 1036
 		return $retour;
1037 1037
 	}
1038 1038
 
1039
-	protected function _getAjaxUrl($url,$attr){
1039
+	protected function _getAjaxUrl($url, $attr) {
1040 1040
 		$url=$this->_correctAjaxUrl($url);
1041 1041
 		$retour="url='".$url."';\n";
1042
-		if(JString::isNotNull($attr)){
1042
+		if (JString::isNotNull($attr)) {
1043 1043
 			if ($attr=="value")
1044 1044
 				$retour.="url=url+'/'+$(this).val();\n";
1045
-			else if($attr!=null && $attr!=="")
1045
+			else if ($attr!=null && $attr!=="")
1046 1046
 				$retour.="url=url+'/'+$(this).attr('".$attr."');\n";
1047 1047
 		}
1048 1048
 		return $retour;
1049 1049
 	}
1050 1050
 
1051
-	protected function _getOnAjaxDone($responseElement,$jsCallback){
1051
+	protected function _getOnAjaxDone($responseElement, $jsCallback) {
1052 1052
 		$retour="";
1053 1053
 		if ($responseElement!=="") {
1054 1054
 			$responseElement=$this->_prep_value($responseElement);
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
 	protected function _correctAjaxUrl($url) {
1062 1062
 		if (PhalconUtils::endsWith($url, "/"))
1063 1063
 			$url=substr($url, 0, strlen($url)-1);
1064
-		if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) {
1064
+		if (strncmp($url, 'http://', 7)!=0 && strncmp($url, 'https://', 8)!=0) {
1065 1065
 			$url=$this->_di->get("url")->get($url);
1066 1066
 		}
1067 1067
 		return $url;
@@ -1105,11 +1105,11 @@  discard block
 block discarded – undo
1105 1105
 		return $retour;
1106 1106
 	}
1107 1107
 
1108
-	public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
1108
+	public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
1109 1109
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
1110 1110
 		$retour=$this->_getAjaxUrl($url, $attr);
1111 1111
 		$retour.="\nvar params=$('#".$form."').serialize();\n";
1112
-		if($hasLoader===true){
1112
+		if ($hasLoader===true) {
1113 1113
 			$this->addLoading($retour, $responseElement);
1114 1114
 		}
1115 1115
 		$retour.="$.post(url,params).done(function( data ) {\n";
@@ -1136,14 +1136,14 @@  discard block
 block discarded – undo
1136 1136
 	 * @param string $responseElement
1137 1137
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
1138 1138
 	 */
1139
-	public function _getOn($event,$element, $url, $params="{}", $responseElement="", $parameters=array()) {
1139
+	public function _getOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
1140 1140
 		$preventDefault=true;
1141 1141
 		$stopPropagation=true;
1142 1142
 		$jsCallback=null;
1143 1143
 		$attr="id";
1144 1144
 		$hasLoader=true;
1145 1145
 		extract($parameters);
1146
-		return $this->_add_event($element, $this->_get($url, $params, $responseElement, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation);
1146
+		return $this->_add_event($element, $this->_get($url, $params, $responseElement, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation);
1147 1147
 	}
1148 1148
 
1149 1149
 	/**
@@ -1156,14 +1156,14 @@  discard block
 block discarded – undo
1156 1156
 	 * @param string $responseElement
1157 1157
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
1158 1158
 	 */
1159
-	public function _postOn($event,$element, $url, $params="{}", $responseElement="", $parameters=array()) {
1159
+	public function _postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
1160 1160
 		$preventDefault=true;
1161 1161
 		$stopPropagation=true;
1162 1162
 		$jsCallback=null;
1163 1163
 		$attr="id";
1164 1164
 		$hasLoader=true;
1165 1165
 		extract($parameters);
1166
-		return $this->_add_event($element, $this->_post($url, $params, $responseElement, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation);
1166
+		return $this->_add_event($element, $this->_post($url, $params, $responseElement, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation);
1167 1167
 	}
1168 1168
 
1169 1169
 	/**
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 	 * @param string $responseElement
1177 1177
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
1178 1178
 	 */
1179
-	public function _postFormOn($event,$element, $url, $form, $responseElement="", $parameters=array()) {
1179
+	public function _postFormOn($event, $element, $url, $form, $responseElement="", $parameters=array()) {
1180 1180
 		$preventDefault=true;
1181 1181
 		$stopPropagation=true;
1182 1182
 		$validation=false;
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 		$attr="id";
1185 1185
 		$hasLoader=true;
1186 1186
 		extract($parameters);
1187
-		return $this->_add_event($element, $this->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation);
1187
+		return $this->_add_event($element, $this->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation);
1188 1188
 	}
1189 1189
 
1190 1190
 	/**
Please login to merge, or discard this patch.
Ajax/JsUtils.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 	protected function _setDi($di) {
47 47
 		$this->_di=$di;
48
-		if ($this->js!=null&&$di!=null)
48
+		if ($this->js!=null && $di!=null)
49 49
 			$this->js->setDi($di);
50 50
 	}
51 51
 
@@ -120,17 +120,17 @@  discard block
 block discarded – undo
120 120
 	}
121 121
 
122 122
 	public function __construct($params=array()) {
123
-		$defaults=array (
123
+		$defaults=array(
124 124
 				'driver' => 'Jquery'
125 125
 		);
126
-		foreach ( $defaults as $key => $val ) {
127
-			if (isset($params[$key])&&$params[$key]!=="") {
126
+		foreach ($defaults as $key => $val) {
127
+			if (isset($params[$key]) && $params[$key]!=="") {
128 128
 				$defaults[$key]=$params[$key];
129 129
 			}
130 130
 		}
131 131
 		extract($defaults);
132 132
 		$this->js=new Jquery();
133
-		$this->cdns=array ();
133
+		$this->cdns=array();
134 134
 	}
135 135
 
136 136
 	public function addToCompile($jsScript) {
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 	 */
588 588
 	public function compile($view=NULL, $view_var='script_foot', $script_tags=TRUE) {
589 589
 		$bs=$this->_bootstrap;
590
-		if (isset($bs)&&isset($view)) {
590
+		if (isset($bs) && isset($view)) {
591 591
 			$bs->compileHtml($this, $view);
592 592
 		}
593 593
 		return $this->js->_compile($view, $view_var, $script_tags);
@@ -667,27 +667,27 @@  discard block
 block discarded – undo
667 667
 				$json_result=$result->result_array();
668 668
 			} elseif (is_array($result)) {
669 669
 				$json_result=$result;
670
-			} else {
670
+			}else {
671 671
 				return $this->_prep_args($result);
672 672
 			}
673
-		} else {
673
+		}else {
674 674
 			return 'null';
675 675
 		}
676 676
 		return $this->_create_json($json_result, $match_array_type);
677 677
 	}
678 678
 
679 679
 	private function _create_json($json_result, $match_array_type) {
680
-		$json=array ();
680
+		$json=array();
681 681
 		$_is_assoc=TRUE;
682
-		if (!is_array($json_result)&&empty($json_result)) {
682
+		if (!is_array($json_result) && empty($json_result)) {
683 683
 			show_error("Generate JSON Failed - Illegal key, value pair.");
684 684
 		} elseif ($match_array_type) {
685 685
 			$_is_assoc=$this->_is_associative_array($json_result);
686 686
 		}
687
-		foreach ( $json_result as $k => $v ) {
687
+		foreach ($json_result as $k => $v) {
688 688
 			if ($_is_assoc) {
689 689
 				$json[]=$this->_prep_args($k, TRUE).':'.$this->generate_json($v, $match_array_type);
690
-			} else {
690
+			}else {
691 691
 				$json[]=$this->generate_json($v, $match_array_type);
692 692
 			}
693 693
 		}
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 	 * @return type
703 703
 	 */
704 704
 	public function _is_associative_array($arr) {
705
-		foreach ( array_keys($arr) as $key => $val ) {
705
+		foreach (array_keys($arr) as $key => $val) {
706 706
 			if ($key!==$val) {
707 707
 				return TRUE;
708 708
 			}
@@ -721,11 +721,11 @@  discard block
 block discarded – undo
721 721
 			return 'null';
722 722
 		} elseif (is_bool($result)) {
723 723
 			return ($result===TRUE) ? 'true' : 'false';
724
-		} elseif (is_string($result)||$is_key) {
725
-			return '"'.str_replace(array (
726
-					'\\',"\t","\n","\r",'"','/'
727
-			), array (
728
-					'\\\\','\\t','\\n',"\\r",'\"','\/'
724
+		} elseif (is_string($result) || $is_key) {
725
+			return '"'.str_replace(array(
726
+					'\\', "\t", "\n", "\r", '"', '/'
727
+			), array(
728
+					'\\\\', '\\t', '\\n', "\\r", '\"', '\/'
729 729
 			), $result).'"';
730 730
 		} elseif (is_scalar($result)) {
731 731
 			return $result;
@@ -740,8 +740,8 @@  discard block
 block discarded – undo
740 740
 	 * @param string $jsCallback javascript code to execute after the request
741 741
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
742 742
 	 */
743
-	public function get($url, $responseElement="", $params="{}", $jsCallback=NULL,$hasLoader=true) {
744
-		return $this->js->_get($url, $params, $responseElement, $jsCallback, NULL, $hasLoader,true);
743
+	public function get($url, $responseElement="", $params="{}", $jsCallback=NULL, $hasLoader=true) {
744
+		return $this->js->_get($url, $params, $responseElement, $jsCallback, NULL, $hasLoader, true);
745 745
 	}
746 746
 
747 747
 	/**
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
 	 * @param string $jsCallback javascript code to execute after the request
798 798
 	 * @param string $attr the html attribute added to the request
799 799
 	 */
800
-	public function getDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL,$attr="id") {
800
+	public function getDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL, $attr="id") {
801 801
 		return $this->js->_get($url, $params, $responseElement, $jsCallback, $attr, false);
802 802
 	}
803 803
 
@@ -835,8 +835,8 @@  discard block
 block discarded – undo
835 835
 	 * @param string $jsCallback javascript code to execute after the request
836 836
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
837 837
 	 */
838
-	public function post($url, $responseElement="", $params="{}", $jsCallback=NULL,$hasLoader=true) {
839
-		return $this->js->_post($url, $params, $responseElement, $jsCallback, NULL, $hasLoader,true);
838
+	public function post($url, $responseElement="", $params="{}", $jsCallback=NULL, $hasLoader=true) {
839
+		return $this->js->_post($url, $params, $responseElement, $jsCallback, NULL, $hasLoader, true);
840 840
 	}
841 841
 
842 842
 	/**
@@ -849,8 +849,8 @@  discard block
 block discarded – undo
849 849
 	 * @param string $jsCallback javascript code to execute after the request
850 850
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
851 851
 	 */
852
-	public function postDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL, $attr="id",$hasLoader=true) {
853
-		return $this->js->_post($url, $params, $responseElement, $jsCallback, $attr, $hasLoader,false);
852
+	public function postDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL, $attr="id", $hasLoader=true) {
853
+		return $this->js->_post($url, $params, $responseElement, $jsCallback, $attr, $hasLoader, false);
854 854
 	}
855 855
 
856 856
 	/**
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
865 865
 	 */
866 866
 	public function postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
867
-		return $this->js->_postOn($event, $element,  $url, $params, $responseElement, $parameters);
867
+		return $this->js->_postOn($event, $element, $url, $params, $responseElement, $parameters);
868 868
 	}
869 869
 
870 870
 	/**
@@ -888,8 +888,8 @@  discard block
 block discarded – undo
888 888
 	 * @param string $jsCallback javascript code to execute after the request
889 889
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
890 890
 	 */
891
-	public function postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL,$hasLoader=true) {
892
-		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, NULL, $hasLoader,true);
891
+	public function postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $hasLoader=true) {
892
+		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, NULL, $hasLoader, true);
893 893
 	}
894 894
 
895 895
 	/**
@@ -902,8 +902,8 @@  discard block
 block discarded – undo
902 902
 	 * @param string $attr the html attribute added to the request
903 903
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
904 904
 	 */
905
-	public function postFormDeferred($url, $form, $responseElement, $validation=false, $jsCallback=NULL,$attr="id",$hasLoader=true) {
906
-		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader,false);
905
+	public function postFormDeferred($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true) {
906
+		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader, false);
907 907
 	}
908 908
 
909 909
 	/**
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
918 918
 	 */
919 919
 	public function postFormOn($event, $element, $url, $form, $responseElement="", $parameters=array()) {
920
-		return $this->js->_postFormOn($event,$element, $url, $form, $responseElement, $parameters);
920
+		return $this->js->_postFormOn($event, $element, $url, $form, $responseElement, $parameters);
921 921
 	}
922 922
 
923 923
 	/**
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 
1008 1008
 	public function setCDNs($cdns) {
1009 1009
 		if (is_array($cdns)===false) {
1010
-			$cdns=array (
1010
+			$cdns=array(
1011 1011
 					$cdns
1012 1012
 			);
1013 1013
 		}
@@ -1018,9 +1018,9 @@  discard block
 block discarded – undo
1018 1018
 		$hasJQuery=false;
1019 1019
 		$hasJQueryUI=false;
1020 1020
 		$hasBootstrap=false;
1021
-		$result=array ();
1022
-		foreach ( $this->cdns as $cdn ) {
1023
-			switch(get_class($cdn)) {
1021
+		$result=array();
1022
+		foreach ($this->cdns as $cdn) {
1023
+			switch (get_class($cdn)) {
1024 1024
 				case "Ajax\lib\CDNJQuery":
1025 1025
 					$hasJQuery=true;
1026 1026
 					$result[0]=$cdn;
@@ -1038,10 +1038,10 @@  discard block
 block discarded – undo
1038 1038
 		if ($hasJQuery===false) {
1039 1039
 			$result[0]=new CDNJQuery("x");
1040 1040
 		}
1041
-		if ($hasJQueryUI===false&&isset($this->_ui)) {
1041
+		if ($hasJQueryUI===false && isset($this->_ui)) {
1042 1042
 			$result[1]=new CDNGuiGen("x", $template);
1043 1043
 		}
1044
-		if ($hasBootstrap===false&&isset($this->_bootstrap)) {
1044
+		if ($hasBootstrap===false && isset($this->_bootstrap)) {
1045 1045
 			$result[2]=new CDNBootstrap("x");
1046 1046
 		}
1047 1047
 		ksort($result);
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 			$this->_setDi($di);
1056 1056
 		}
1057 1057
 	}
1058
-} else {
1058
+}else {
1059 1059
 	class JsUtils extends _JsUtils {
1060 1060
 
1061 1061
 		public function setDi(DiInterface $di) {
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Collapse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 	}
66 66
 
67 67
 	protected function compileEvents() {
68
-		foreach ( $this->events as $event => $jsCode ) {
68
+		foreach ($this->events as $event => $jsCode) {
69 69
 			$this->jquery_code_for_compile []="$( \"".$this->collapsed."\" ).on(\"".$event."\" , function (e) {".$jsCode."});";
70 70
 		}
71 71
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/GenericComponent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 	 * @see \Ajax\bootstrap\components\SimpleBsComponent::getScript()
10 10
 	 */
11 11
 	public function getScript() {
12
-		$this->jquery_code_for_compile=array ();
13
-		foreach ( $this->jsCodes as $jsCode ) {
14
-			$this->jquery_code_for_compile []=$jsCode->compile(array (
12
+		$this->jquery_code_for_compile=array();
13
+		foreach ($this->jsCodes as $jsCode) {
14
+			$this->jquery_code_for_compile []=$jsCode->compile(array(
15 15
 					"identifier" => $this->attachTo 
16 16
 			));
17 17
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Modal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 		if ($value) {
58 58
 			$this->jsCodes ["draggable"]=new Draggable();
59 59
 			$this->setBackdrop(false);
60
-		} else if (array_key_exists("draggable", $this->jsCodes)) {
60
+		}else if (array_key_exists("draggable", $this->jsCodes)) {
61 61
 			unset($this->jsCodes ["draggable"]);
62 62
 			unset($this->params ["backdrop"]);
63 63
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/SimpleBsComponent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 use Ajax\common\JsCode;
7 7
 
8 8
 class SimpleBsComponent extends SimpleComponent {
9
-	protected $events=array ();
10
-	protected $jsCodes=array ();
9
+	protected $events=array();
10
+	protected $jsCodes=array();
11 11
 
12 12
 	public function addEvent($event, $jsCode) {
13 13
 		$this->events [$event]=$jsCode;
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 	public function getScript() {
17 17
 		parent::getScript();
18
-		foreach ( $this->jsCodes as $jsCode ) {
19
-			$this->jquery_code_for_compile []=$jsCode->compile(array (
18
+		foreach ($this->jsCodes as $jsCode) {
19
+			$this->jquery_code_for_compile []=$jsCode->compile(array(
20 20
 					"identifier" => $this->attachTo 
21 21
 			));
22 22
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Splitbutton.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 	 * @see \Ajax\common\SimpleComponent::compileEvents()
10 10
 	 */
11 11
 	protected function compileEvents() {
12
-		foreach ( $this->events as $event => $jsCode ) {
12
+		foreach ($this->events as $event => $jsCode) {
13 13
 			if ($event==="buttonClick") {
14 14
 				$this->jquery_code_for_compile []="$( \"#split-".preg_replace('/[^a-zA-Z0-9\-.]/s', '', $this->attachTo)."\" ).on(\"click\" , function( event, data ) {".$jsCode."});";
15
-			} else {
15
+			}else {
16 16
 				$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
17 17
 			}
18 18
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Tabs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 	public function __construct(JsUtils $js) {
20 20
 		parent::__construct($js);
21
-		$this->tabs=array ();
21
+		$this->tabs=array();
22 22
 	}
23 23
 
24 24
 	public function getTabs() {
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 
37 37
 	public function getTab($index) {
38
-		if ($index>0&&$index<sizeof($this->tabs))
38
+		if ($index>0 && $index<sizeof($this->tabs))
39 39
 			return $this->tabs [$index];
40 40
 	}
41 41
 
Please login to merge, or discard this patch.