Completed
Push — master ( 3cf661...c0f044 )
by Jean-Christophe
03:28
created
Ajax/bootstrap/html/content/HtmlGridCol.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -15,22 +15,22 @@  discard block
 block discarded – undo
15 15
 class HtmlGridCol extends HtmlDoubleElement {
16 16
 	private $positions;
17 17
 	private $offsets;
18
-	public function __construct($identifier,$size=CssSize::SIZE_MD,$width=1){
19
-		parent::__construct($identifier,"div");
18
+	public function __construct($identifier, $size=CssSize::SIZE_MD, $width=1) {
19
+		parent::__construct($identifier, "div");
20 20
 		$this->positions=array();
21 21
 		$this->offsets=array();
22
-		$this->addPosition($size,$width);
22
+		$this->addPosition($size, $width);
23 23
 	}
24
-	public function addPosition($size=CssSize::SIZE_MD,$width=1){
24
+	public function addPosition($size=CssSize::SIZE_MD, $width=1) {
25 25
 		$this->positions[$size]=$width;
26 26
 		return $this;
27 27
 	}
28
-	private function _generateClass(){
28
+	private function _generateClass() {
29 29
 		$result=array();
30
-		foreach ($this->positions as $size=>$width){
30
+		foreach ($this->positions as $size=>$width) {
31 31
 			$result[]="col-".$size."-".$width;
32 32
 		}
33
-		foreach ($this->offsets as $size=>$offset){
33
+		foreach ($this->offsets as $size=>$offset) {
34 34
 			$result[]="col-".$size."-offset-".$offset;
35 35
 		}
36 36
 		return implode(" ", $result);
@@ -38,63 +38,63 @@  discard block
 block discarded – undo
38 38
 	
39 39
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
40 40
 		$this->setProperty("class", $this->_generateClass());
41
-		return parent::compile($js,$view);
41
+		return parent::compile($js, $view);
42 42
 	}
43 43
 	
44
-	public function setOffset($size,$offset){
44
+	public function setOffset($size, $offset) {
45 45
 		$this->offsets[$size]=$offset;
46 46
 		return $this;
47 47
 	}
48 48
 
49
-	public function setOffsetForAll($newOffset){
50
-		foreach ($this->offsets as &$value){
49
+	public function setOffsetForAll($newOffset) {
50
+		foreach ($this->offsets as &$value) {
51 51
 			$value=$newOffset;
52 52
 		}
53 53
 		unset($value);
54 54
 		return $this;
55 55
 	}
56 56
 	
57
-	public function setWidthForAll($newWidth){
58
-		foreach ($this->positions as &$pos){
57
+	public function setWidthForAll($newWidth) {
58
+		foreach ($this->positions as &$pos) {
59 59
 			$pos=$newWidth;
60 60
 		}
61 61
 		unset($pos);
62 62
 		return $this;
63 63
 	}
64 64
 	
65
-	public function setWidth($size=CssSize::SIZE_MD,$width=1){
65
+	public function setWidth($size=CssSize::SIZE_MD, $width=1) {
66 66
 		$this->positions[$size]=$width;
67 67
 		return $this;	
68 68
 	}
69 69
 	
70
-	public function setPosition($size=CssSize::SIZE_MD,$width=1){
71
-		return $this->addPosition($size,$width);
70
+	public function setPosition($size=CssSize::SIZE_MD, $width=1) {
71
+		return $this->addPosition($size, $width);
72 72
 	}
73 73
 	
74
-	public function getWidth($size){
74
+	public function getWidth($size) {
75 75
 		return @$this->positions[$size];
76 76
 	}
77 77
 	
78
-	public function getOffest($size){
78
+	public function getOffest($size) {
79 79
 		return @$this->offsets[$size];
80 80
 	}
81 81
 	
82
-	public function addClear(){
83
-		$this->wrap("","<div class='clearfix'></div>");
82
+	public function addClear() {
83
+		$this->wrap("", "<div class='clearfix'></div>");
84 84
 	}
85 85
 	public function setOffsets($offsets) {
86
-		$this->offsets = $offsets;
86
+		$this->offsets=$offsets;
87 87
 		return $this;
88 88
 	}
89 89
 	
90
-	public function copy($identifier){
90
+	public function copy($identifier) {
91 91
 		$result=new HtmlGridCol($identifier);
92 92
 		$result->setPositions($this->positions);
93 93
 		$result->setOffsets($this->offsets);
94 94
 		return $result;
95 95
 	}
96 96
 	public function setPositions($positions) {
97
-		$this->positions = $positions;
97
+		$this->positions=$positions;
98 98
 		return $this;
99 99
 	}
100 100
 	public function getOffsets() {
Please login to merge, or discard this patch.
Ajax/Jquery.php 3 patches
Doc Comments   +35 added lines, -4 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 * Outputs a jQuery click event
160 160
 	 *
161 161
 	 * @param string $element The element to attach the event to
162
-	 * @param mixed $js The code to execute
162
+	 * @param string $js The code to execute
163 163
 	 * @param boolean $ret_false whether or not to return false
164 164
 	 * @return string
165 165
 	 */
@@ -235,6 +235,8 @@  discard block
 block discarded – undo
235 235
 	 * @param string - element
236 236
 	 * @param string - Javascript code for mouse over
237 237
 	 * @param string - Javascript code for mouse out
238
+	 * @param string $over
239
+	 * @param string $out
238 240
 	 * @return string
239 241
 	 */
240 242
 	public function _hover($element='this', $over, $out) {
@@ -768,7 +770,7 @@  discard block
 block discarded – undo
768 770
 	 *
769 771
 	 * @param string $element
770 772
 	 * @param array $options
771
-	 * @return void
773
+	 * @return string
772 774
 	 */
773 775
 	public function sortable($element, $options=array()) {
774 776
 		if (count($options)>0) {
@@ -904,6 +906,7 @@  discard block
 block discarded – undo
904 906
 	/**
905 907
 	 * A wrapper for writing document.ready()
906 908
 	 *
909
+	 * @param string $js
907 910
 	 * @return string
908 911
 	 */
909 912
 	public function _document_ready($js) {
@@ -958,7 +961,7 @@  discard block
 block discarded – undo
958 961
 	/**
959 962
 	 * Ensures the speed parameter is valid for jQuery
960 963
 	 *
961
-	 * @param string|int $speed
964
+	 * @param string $speed
962 965
 	 * @return string
963 966
 	 */
964 967
 	private function _validate_speed($speed) {
@@ -973,6 +976,10 @@  discard block
 block discarded – undo
973 976
 		return $speed;
974 977
 	}
975 978
 	// ------------------------------------------------------------------------
979
+
980
+	/**
981
+	 * @param string $retour
982
+	 */
976 983
 	protected function addLoading(&$retour, $responseElement) {
977 984
 		$loading_notifier='<div class="ajax-loader">';
978 985
 		if ($this->ajaxLoader=='') {
@@ -985,13 +992,25 @@  discard block
 block discarded – undo
985 992
 		$retour.="\t\t$({$responseElement}).prepend('{$loading_notifier}');\n";
986 993
 	}
987 994
 
995
+	/**
996
+	 * @param string $url
997
+	 * @param string $jsCallback
998
+	 */
988 999
 	public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
989 1000
 		return $this->_ajax("get", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly);
990 1001
 	}
1002
+
1003
+	/**
1004
+	 * @param string $url
1005
+	 * @param string $jsCallback
1006
+	 */
991 1007
 	public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
992 1008
 		return $this->_ajax("post", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly);
993 1009
 	}
994 1010
 
1011
+	/**
1012
+	 * @param string $method
1013
+	 */
995 1014
 	protected function _ajax($method,$url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
996 1015
 		if(JString::isNull($params)){$params="{}";}
997 1016
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
@@ -1008,6 +1027,9 @@  discard block
 block discarded – undo
1008 1027
 		return $retour;
1009 1028
 	}
1010 1029
 
1030
+	/**
1031
+	 * @param string $attr
1032
+	 */
1011 1033
 	protected function _getAjaxUrl($url,$attr){
1012 1034
 		$url=$this->_correctAjaxUrl($url);
1013 1035
 		$retour="url='".$url."';\n";
@@ -1139,6 +1161,12 @@  discard block
 block discarded – undo
1139 1161
 		return $this->_add_event($element, $this->_jsonArray($maskSelector,$url,$method, $params,$jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation,$immediatly);
1140 1162
 	}
1141 1163
 
1164
+	/**
1165
+	 * @param string $url
1166
+	 * @param string $form
1167
+	 * @param string $responseElement
1168
+	 * @param string $jsCallback
1169
+	 */
1142 1170
 	public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
1143 1171
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
1144 1172
 		$retour=$this->_getAjaxUrl($url, $attr);
@@ -1252,7 +1280,7 @@  discard block
 block discarded – undo
1252 1280
 	 * @param string $element
1253 1281
 	 * @param string $elementToModify
1254 1282
 	 * @param string $jqueryCall
1255
-	 * @param string|array $param
1283
+	 * @param string $param
1256 1284
 	 * @param boolean $preventDefault
1257 1285
 	 * @param boolean $stopPropagation
1258 1286
 	 * @param string $jsCallback javascript code to execute after the jquery call
@@ -1290,6 +1318,9 @@  discard block
 block discarded – undo
1290 1318
 		return $this->_add_event($element, $this->_exec($js), $event, $preventDefault, $stopPropagation,$immediatly);
1291 1319
 	}
1292 1320
 
1321
+	/**
1322
+	 * @param string $input
1323
+	 */
1293 1324
 	private function minify($input) {
1294 1325
 	if(trim($input) === "") return $input;
1295 1326
 	return preg_replace(
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 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) {
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 	public function __construct($params) {
53 53
 		$this->params=array();
54
-		foreach ( $params as $key => $val ) {
54
+		foreach ($params as $key => $val) {
55 55
 				$this->params[$key]=$params[$key];
56 56
 		}
57 57
 	}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	public function _click($element='this', $js=array(), $ret_false=TRUE) {
167 167
 		if (!is_array($js)) {
168
-			$js=array (
168
+			$js=array(
169 169
 					$js
170 170
 			);
171 171
 		}
@@ -360,12 +360,12 @@  discard block
 block discarded – undo
360 360
 	 */
361 361
 	public function _output($array_js='') {
362 362
 		if (!is_array($array_js)) {
363
-			$array_js=array (
363
+			$array_js=array(
364 364
 					$array_js
365 365
 			);
366 366
 		}
367 367
 
368
-		foreach ( $array_js as $js ) {
368
+		foreach ($array_js as $js) {
369 369
 			$this->jquery_code_for_compile[]="\t$js\n";
370 370
 		}
371 371
 	}
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 	 * @param boolean $immediatly defers the execution if set to false
421 421
 	 * @return string
422 422
 	 */
423
-	public function after($element='this', $value='', $immediatly=false){
423
+	public function after($element='this', $value='', $immediatly=false) {
424 424
 		$element=$this->_prep_element($element);
425 425
 		$value=$this->_prep_value($value);
426 426
 		$str="$({$element}).after({$value});";
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 		if (isset($value)) {
442 442
 			$value=$this->_prep_value($value);
443 443
 			$str="$({$element}).attr(\"$attributeName\",{$value});";
444
-		} else
444
+		}else
445 445
 			$str="$({$element}).attr(\"$attributeName\");";
446 446
 		if ($immediatly)
447 447
 			$this->jquery_code_for_compile[]=$str;
@@ -455,12 +455,12 @@  discard block
 block discarded – undo
455 455
 	 * @param string $param
456 456
 	 * @param boolean $immediatly delayed if false
457 457
 	 */
458
-	public function _genericCallValue($jQueryCall,$element='this', $param="", $immediatly=false) {
458
+	public function _genericCallValue($jQueryCall, $element='this', $param="", $immediatly=false) {
459 459
 		$element=$this->_prep_element($element);
460 460
 		if (isset($param)) {
461 461
 			$param=$this->_prep_value($param);
462 462
 			$str="$({$element}).{$jQueryCall}({$param});";
463
-		} else
463
+		}else
464 464
 			$str="$({$element}).{$jQueryCall}();";
465 465
 			if ($immediatly)
466 466
 				$this->jquery_code_for_compile[]=$str;
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 	 * @param boolean $immediatly delayed if false
475 475
 	 * @return string
476 476
 	 */
477
-	public function _genericCallElement($jQueryCall,$to='this', $element, $immediatly=false) {
477
+	public function _genericCallElement($jQueryCall, $to='this', $element, $immediatly=false) {
478 478
 		$to=$this->_prep_element($to);
479 479
 		$element=$this->_prep_element($element);
480 480
 		$str="$({$to}).{$jQueryCall}({$element});";
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 
501 501
 		$animations="\t\t\t";
502 502
 		if (is_array($params)) {
503
-			foreach ( $params as $param => $value ) {
503
+			foreach ($params as $param => $value) {
504 504
 				$animations.=$param.': \''.$value.'\', ';
505 505
 			}
506 506
 		}
@@ -772,12 +772,12 @@  discard block
 block discarded – undo
772 772
 	 */
773 773
 	public function sortable($element, $options=array()) {
774 774
 		if (count($options)>0) {
775
-			$sort_options=array ();
776
-			foreach ( $options as $k => $v ) {
775
+			$sort_options=array();
776
+			foreach ($options as $k => $v) {
777 777
 				$sort_options[]="\n\t\t".$k.': '.$v."";
778 778
 			}
779 779
 			$sort_options=implode(",", $sort_options);
780
-		} else {
780
+		}else {
781 781
 			$sort_options='';
782 782
 		}
783 783
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 	 * @param boolean $stopPropagation Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
812 812
 	 * @return string
813 813
 	 */
814
-	public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true) {
814
+	public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true) {
815 815
 		if (is_array($js)) {
816 816
 			$js=implode("\n\t\t", $js);
817 817
 		}
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 			$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
826 826
 		else
827 827
 			$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
828
-		if($immediatly)
828
+		if ($immediatly)
829 829
 			$this->jquery_code_for_compile[]=$event;
830 830
 		return $event;
831 831
 	}
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 
860 860
 		// External references
861 861
 		$external_scripts=implode('', $this->jquery_code_for_load);
862
-		extract(array (
862
+		extract(array(
863 863
 				'library_src' => $external_scripts
864 864
 		));
865 865
 
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 		$script.='});';
875 875
 
876 876
 		$this->jquery_code_for_compile=array();
877
-		if($this->params["debug"]==false){
877
+		if ($this->params["debug"]==false) {
878 878
 			$script=$this->minify($script);
879 879
 		}
880 880
 		$output=($script_tags===FALSE) ? $script : $this->inline($script);
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 	 * @return void
897 897
 	 */
898 898
 	public function _clear_compile() {
899
-		$this->jquery_code_for_compile=array ();
899
+		$this->jquery_code_for_compile=array();
900 900
 	}
901 901
 
902 902
 	// --------------------------------------------------------------------
@@ -908,12 +908,12 @@  discard block
 block discarded – undo
908 908
 	 */
909 909
 	public function _document_ready($js) {
910 910
 		if (!is_array($js)) {
911
-			$js=array (
911
+			$js=array(
912 912
 					$js
913 913
 			);
914 914
 		}
915 915
 
916
-		foreach ( $js as $script ) {
916
+		foreach ($js as $script) {
917 917
 			$this->jquery_code_for_compile[]=$script;
918 918
 		}
919 919
 	}
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
 	 * @return string
930 930
 	 */
931 931
 	public function _prep_element($element) {
932
-		if (strrpos($element, 'this')===false&&strrpos($element, 'event')===false&&strrpos($element, 'self')===false) {
932
+		if (strrpos($element, 'this')===false && strrpos($element, 'event')===false && strrpos($element, 'self')===false) {
933 933
 			$element='"'.addslashes($element).'"';
934 934
 		}
935 935
 		return $element;
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
 		if (is_array($value)) {
948 948
 			$value=implode(",", $value);
949 949
 		}
950
-		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false&&strrpos($value, 'self')===false) {
950
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false && strrpos($value, 'self')===false) {
951 951
 			$value='"'.$value.'"';
952 952
 		}
953 953
 		return $value;
@@ -962,8 +962,8 @@  discard block
 block discarded – undo
962 962
 	 * @return string
963 963
 	 */
964 964
 	private function _validate_speed($speed) {
965
-		if (in_array($speed, array (
966
-				'slow','normal','fast'
965
+		if (in_array($speed, array(
966
+				'slow', 'normal', 'fast'
967 967
 		))) {
968 968
 			$speed='"'.$speed.'"';
969 969
 		} elseif (preg_match("/[^0-9]/", $speed)) {
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 		$loading_notifier='<div class="ajax-loader">';
978 978
 		if ($this->ajaxLoader=='') {
979 979
 			$loading_notifier.="Loading...";
980
-		} else {
980
+		}else {
981 981
 			$loading_notifier.=$this->ajaxLoader;
982 982
 		}
983 983
 		$loading_notifier.='</div>';
@@ -985,20 +985,20 @@  discard block
 block discarded – undo
985 985
 		$retour.="\t\t$({$responseElement}).prepend('{$loading_notifier}');\n";
986 986
 	}
987 987
 
988
-	public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
989
-		return $this->_ajax("get", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly);
988
+	public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
989
+		return $this->_ajax("get", $url, $params, $responseElement, $jsCallback, $attr, $hasLoader, $immediatly);
990 990
 	}
991
-	public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
992
-		return $this->_ajax("post", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly);
991
+	public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
992
+		return $this->_ajax("post", $url, $params, $responseElement, $jsCallback, $attr, $hasLoader, $immediatly);
993 993
 	}
994 994
 
995
-	protected function _ajax($method,$url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
996
-		if(JString::isNull($params)){$params="{}";}
995
+	protected function _ajax($method, $url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
996
+		if (JString::isNull($params)) {$params="{}"; }
997 997
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
998 998
 		$retour=$this->_getAjaxUrl($url, $attr);
999 999
 		$responseElement=$this->_getResponseElement($responseElement);
1000 1000
 		$retour.="var self=this;\n";
1001
-		if($hasLoader===true){
1001
+		if ($hasLoader===true) {
1002 1002
 			$this->addLoading($retour, $responseElement);
1003 1003
 		}
1004 1004
 		$retour.="$.".$method."(url,".$params.").done(function( data ) {\n";
@@ -1008,22 +1008,22 @@  discard block
 block discarded – undo
1008 1008
 		return $retour;
1009 1009
 	}
1010 1010
 
1011
-	protected function _getAjaxUrl($url,$attr){
1011
+	protected function _getAjaxUrl($url, $attr) {
1012 1012
 		$url=$this->_correctAjaxUrl($url);
1013 1013
 		$retour="url='".$url."';\n";
1014 1014
 		$slash="/";
1015
-		if(PhalconUtils::endsWith($url, "/"))
1015
+		if (PhalconUtils::endsWith($url, "/"))
1016 1016
 			$slash="";
1017
-		if(JString::isNotNull($attr)){
1017
+		if (JString::isNotNull($attr)) {
1018 1018
 			if ($attr=="value")
1019 1019
 				$retour.="url=url+'".$slash."'+$(this).val();\n";
1020
-			else if($attr!=null && $attr!=="")
1020
+			else if ($attr!=null && $attr!=="")
1021 1021
 				$retour.="url=url+'".$slash."'+$(this).attr('".$attr."');\n";
1022 1022
 		}
1023 1023
 		return $retour;
1024 1024
 	}
1025 1025
 
1026
-	protected function _getOnAjaxDone($responseElement,$jsCallback){
1026
+	protected function _getOnAjaxDone($responseElement, $jsCallback) {
1027 1027
 		$retour="";
1028 1028
 		if ($responseElement!=="") {
1029 1029
 			$retour="\t$({$responseElement}).html( data );\n";
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 		return $retour;
1033 1033
 	}
1034 1034
 
1035
-	protected function _getResponseElement($responseElement){
1035
+	protected function _getResponseElement($responseElement) {
1036 1036
 		if ($responseElement!=="") {
1037 1037
 			$responseElement=$this->_prep_value($responseElement);
1038 1038
 		}
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 	protected function _correctAjaxUrl($url) {
1043 1043
 		if (PhalconUtils::endsWith($url, "/"))
1044 1044
 			$url=substr($url, 0, strlen($url)-1);
1045
-		if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) {
1045
+		if (strncmp($url, 'http://', 7)!=0 && strncmp($url, 'https://', 8)!=0) {
1046 1046
 			$url=$this->_di->get("url")->get($url);
1047 1047
 		}
1048 1048
 		return $url;
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
 	 * @param string $jsCallback javascript code to execute after the request
1057 1057
 	 * @param boolean $immediatly
1058 1058
 	 */
1059
-	public function _json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document",$immediatly=false) {
1059
+	public function _json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document", $immediatly=false) {
1060 1060
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
1061 1061
 		$retour=$this->_getAjaxUrl($url, $attr);
1062 1062
 		$retour.="$.{$method}(url,".$params.").done(function( data ) {\n";
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
 	 * @param string $url the request address
1078 1078
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true)
1079 1079
 	 */
1080
-	public function _jsonOn($event,$element, $url,$parameters=array()) {
1080
+	public function _jsonOn($event, $element, $url, $parameters=array()) {
1081 1081
 		$preventDefault=true;
1082 1082
 		$stopPropagation=true;
1083 1083
 		$jsCallback=null;
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 		$params="{}";
1088 1088
 		$immediatly=true;
1089 1089
 		extract($parameters);
1090
-		return $this->_add_event($element, $this->_json($url,$method, $params,$jsCallback, $attr,$context), $event, $preventDefault, $stopPropagation,$immediatly);
1090
+		return $this->_add_event($element, $this->_json($url, $method, $params, $jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation, $immediatly);
1091 1091
 	}
1092 1092
 
1093 1093
 	/**
@@ -1099,19 +1099,19 @@  discard block
 block discarded – undo
1099 1099
 	 * @param string $context jquery DOM element, array container.
1100 1100
 	 * @param boolean $immediatly
1101 1101
 	 */
1102
-	public function _jsonArray($maskSelector, $url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context=null,$immediatly=false) {
1102
+	public function _jsonArray($maskSelector, $url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context=null, $immediatly=false) {
1103 1103
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
1104 1104
 		$retour=$this->_getAjaxUrl($url, $attr);
1105
-		if($context===null){
1105
+		if ($context===null) {
1106 1106
 			$appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n";
1107
-			$newElm = "$('#'+newId)";
1108
-		}else{
1107
+			$newElm="$('#'+newId)";
1108
+		}else {
1109 1109
 			$appendTo="\t\tnewElm.appendTo(".$context.");\n";
1110
-			$newElm = $context.".find('#'+newId)";
1110
+			$newElm=$context.".find('#'+newId)";
1111 1111
 		}
1112 1112
 		$retour.="var self = $(this);\n$.{$method}(url,".$params.").done(function( data ) {\n";
1113 1113
 		$retour.="\tdata=$.parseJSON(data);$.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();newElm.attr('id',newId);\n";
1114
-		$retour.= $appendTo;
1114
+		$retour.=$appendTo;
1115 1115
 		$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";
1116 1116
 		$retour.="\t$(document).trigger('jsonReady',[data]);\n";
1117 1117
 		$retour.="\t".$jsCallback."\n"."});\n";
@@ -1126,26 +1126,26 @@  discard block
 block discarded – undo
1126 1126
 	 * @param string $url the request address
1127 1127
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get", "context"=>null)
1128 1128
 	 */
1129
-	public function _jsonArrayOn($event,$element, $maskSelector,$url,$parameters=array()) {
1129
+	public function _jsonArrayOn($event, $element, $maskSelector, $url, $parameters=array()) {
1130 1130
 		$preventDefault=true;
1131 1131
 		$stopPropagation=true;
1132 1132
 		$jsCallback=null;
1133 1133
 		$attr="id";
1134 1134
 		$method="get";
1135
-		$context = null;
1135
+		$context=null;
1136 1136
 		$params="{}";
1137 1137
 		$immediatly=true;
1138 1138
 		extract($parameters);
1139
-		return $this->_add_event($element, $this->_jsonArray($maskSelector,$url,$method, $params,$jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation,$immediatly);
1139
+		return $this->_add_event($element, $this->_jsonArray($maskSelector, $url, $method, $params, $jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation, $immediatly);
1140 1140
 	}
1141 1141
 
1142
-	public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
1142
+	public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
1143 1143
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
1144 1144
 		$retour=$this->_getAjaxUrl($url, $attr);
1145 1145
 		$retour.="\nvar params=$('#".$form."').serialize();\n";
1146 1146
 		$responseElement=$this->_getResponseElement($responseElement);
1147 1147
 		$retour.="var self=this;\n";
1148
-		if($hasLoader===true){
1148
+		if ($hasLoader===true) {
1149 1149
 			$this->addLoading($retour, $responseElement);
1150 1150
 		}
1151 1151
 		$retour.="$.post(url,params).done(function( data ) {\n";
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 	 * @param string $responseElement
1173 1173
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
1174 1174
 	 */
1175
-	public function _getOn($event,$element, $url, $params="{}", $responseElement="", $parameters=array()) {
1175
+	public function _getOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
1176 1176
 		$preventDefault=true;
1177 1177
 		$stopPropagation=true;
1178 1178
 		$jsCallback=null;
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 		$hasLoader=true;
1181 1181
 		$immediatly=true;
1182 1182
 		extract($parameters);
1183
-		return $this->_add_event($element, $this->_get($url, $params, $responseElement, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation,$immediatly);
1183
+		return $this->_add_event($element, $this->_get($url, $params, $responseElement, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation, $immediatly);
1184 1184
 	}
1185 1185
 
1186 1186
 	/**
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
 	 * @param string $responseElement
1194 1194
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
1195 1195
 	 */
1196
-	public function _postOn($event,$element, $url, $params="{}", $responseElement="", $parameters=array()) {
1196
+	public function _postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
1197 1197
 		$preventDefault=true;
1198 1198
 		$stopPropagation=true;
1199 1199
 		$jsCallback=null;
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 		$hasLoader=true;
1202 1202
 		$immediatly=true;
1203 1203
 		extract($parameters);
1204
-		return $this->_add_event($element, $this->_post($url, $params, $responseElement, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation,$immediatly);
1204
+		return $this->_add_event($element, $this->_post($url, $params, $responseElement, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation, $immediatly);
1205 1205
 	}
1206 1206
 
1207 1207
 	/**
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
 	 * @param string $responseElement
1215 1215
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true)
1216 1216
 	 */
1217
-	public function _postFormOn($event,$element, $url, $form, $responseElement="", $parameters=array()) {
1217
+	public function _postFormOn($event, $element, $url, $form, $responseElement="", $parameters=array()) {
1218 1218
 		$preventDefault=true;
1219 1219
 		$stopPropagation=true;
1220 1220
 		$validation=false;
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 		$hasLoader=true;
1224 1224
 		$immediatly=true;
1225 1225
 		extract($parameters);
1226
-		return $this->_add_event($element, $this->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation,$immediatly);
1226
+		return $this->_add_event($element, $this->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation, $immediatly);
1227 1227
 	}
1228 1228
 
1229 1229
 	/**
@@ -1259,8 +1259,8 @@  discard block
 block discarded – undo
1259 1259
 	 * @param boolean $immediatly
1260 1260
 	 * @return string
1261 1261
 	 */
1262
-	public function _doJQueryOn($event, $element, $elementToModify, $jqueryCall, $param="", $preventDefault=false, $stopPropagation=false, $jsCallback="",$immediatly=true) {
1263
-		return $this->_add_event($element, $this->_doJQuery($elementToModify, $jqueryCall, $param, $jsCallback), $event, $preventDefault, $stopPropagation,$immediatly);
1262
+	public function _doJQueryOn($event, $element, $elementToModify, $jqueryCall, $param="", $preventDefault=false, $stopPropagation=false, $jsCallback="", $immediatly=true) {
1263
+		return $this->_add_event($element, $this->_doJQuery($elementToModify, $jqueryCall, $param, $jsCallback), $event, $preventDefault, $stopPropagation, $immediatly);
1264 1264
 	}
1265 1265
 
1266 1266
 	/**
@@ -1286,12 +1286,12 @@  discard block
 block discarded – undo
1286 1286
 	 * @param boolean $immediatly
1287 1287
 	 * @return String
1288 1288
 	 */
1289
-	public function _execOn($element, $event, $js, $preventDefault=false, $stopPropagation=false,$immediatly=true) {
1290
-		return $this->_add_event($element, $this->_exec($js), $event, $preventDefault, $stopPropagation,$immediatly);
1289
+	public function _execOn($element, $event, $js, $preventDefault=false, $stopPropagation=false, $immediatly=true) {
1290
+		return $this->_add_event($element, $this->_exec($js), $event, $preventDefault, $stopPropagation, $immediatly);
1291 1291
 	}
1292 1292
 
1293 1293
 	private function minify($input) {
1294
-	if(trim($input) === "") return $input;
1294
+	if (trim($input)==="") return $input;
1295 1295
 	return preg_replace(
1296 1296
 			array(
1297 1297
 					// Remove comment(s)
Please login to merge, or discard this patch.
Braces   +98 added lines, -66 removed lines patch added patch discarded remove patch
@@ -424,8 +424,9 @@  discard block
 block discarded – undo
424 424
 		$element=$this->_prep_element($element);
425 425
 		$value=$this->_prep_value($value);
426 426
 		$str="$({$element}).after({$value});";
427
-		if ($immediatly)
428
-			$this->jquery_code_for_compile[]=$str;
427
+		if ($immediatly) {
428
+					$this->jquery_code_for_compile[]=$str;
429
+		}
429 430
 		return $str;
430 431
 	}
431 432
 
@@ -441,10 +442,12 @@  discard block
 block discarded – undo
441 442
 		if (isset($value)) {
442 443
 			$value=$this->_prep_value($value);
443 444
 			$str="$({$element}).attr(\"$attributeName\",{$value});";
444
-		} else
445
-			$str="$({$element}).attr(\"$attributeName\");";
446
-		if ($immediatly)
447
-			$this->jquery_code_for_compile[]=$str;
445
+		} else {
446
+					$str="$({$element}).attr(\"$attributeName\");";
447
+		}
448
+		if ($immediatly) {
449
+					$this->jquery_code_for_compile[]=$str;
450
+		}
448 451
 		return $str;
449 452
 	}
450 453
 
@@ -460,10 +463,12 @@  discard block
 block discarded – undo
460 463
 		if (isset($param)) {
461 464
 			$param=$this->_prep_value($param);
462 465
 			$str="$({$element}).{$jQueryCall}({$param});";
463
-		} else
464
-			$str="$({$element}).{$jQueryCall}();";
465
-			if ($immediatly)
466
-				$this->jquery_code_for_compile[]=$str;
466
+		} else {
467
+					$str="$({$element}).{$jQueryCall}();";
468
+		}
469
+			if ($immediatly) {
470
+							$this->jquery_code_for_compile[]=$str;
471
+			}
467 472
 			return $str;
468 473
 	}
469 474
 	/**
@@ -478,8 +483,9 @@  discard block
 block discarded – undo
478 483
 		$to=$this->_prep_element($to);
479 484
 		$element=$this->_prep_element($element);
480 485
 		$str="$({$to}).{$jQueryCall}({$element});";
481
-		if ($immediatly)
482
-			$this->jquery_code_for_compile[]=$str;
486
+		if ($immediatly) {
487
+					$this->jquery_code_for_compile[]=$str;
488
+		}
483 489
 			return $str;
484 490
 	}
485 491
 	// --------------------------------------------------------------------
@@ -516,8 +522,9 @@  discard block
 block discarded – undo
516 522
 
517 523
 		$str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");";
518 524
 
519
-		if ($immediatly)
520
-			$this->jquery_code_for_compile[]=$str;
525
+		if ($immediatly) {
526
+					$this->jquery_code_for_compile[]=$str;
527
+		}
521 528
 		return $str;
522 529
 	}
523 530
 
@@ -542,8 +549,9 @@  discard block
 block discarded – undo
542 549
 
543 550
 		$str="$({$element}).fadeIn({$speed}{$callback});";
544 551
 
545
-		if ($immediatly)
546
-			$this->jquery_code_for_compile[]=$str;
552
+		if ($immediatly) {
553
+					$this->jquery_code_for_compile[]=$str;
554
+		}
547 555
 		return $str;
548 556
 	}
549 557
 
@@ -568,8 +576,9 @@  discard block
 block discarded – undo
568 576
 
569 577
 		$str="$({$element}).fadeOut({$speed}{$callback});";
570 578
 
571
-		if ($immediatly)
572
-			$this->jquery_code_for_compile[]=$str;
579
+		if ($immediatly) {
580
+					$this->jquery_code_for_compile[]=$str;
581
+		}
573 582
 		return $str;
574 583
 	}
575 584
 
@@ -594,8 +603,9 @@  discard block
 block discarded – undo
594 603
 
595 604
 		$str="$({$element}).hide({$speed}{$callback});";
596 605
 
597
-		if ($immediatly)
598
-			$this->jquery_code_for_compile[]=$str;
606
+		if ($immediatly) {
607
+					$this->jquery_code_for_compile[]=$str;
608
+		}
599 609
 		return $str;
600 610
 	}
601 611
 
@@ -622,8 +632,9 @@  discard block
 block discarded – undo
622 632
 
623 633
 		$str="$({$element}).slideUp({$speed}{$callback});";
624 634
 
625
-		if ($immediatly)
626
-			$this->jquery_code_for_compile[]=$str;
635
+		if ($immediatly) {
636
+					$this->jquery_code_for_compile[]=$str;
637
+		}
627 638
 		return $str;
628 639
 	}
629 640
 
@@ -648,8 +659,9 @@  discard block
 block discarded – undo
648 659
 
649 660
 		$str="$({$element}).slideDown({$speed}{$callback});";
650 661
 
651
-		if ($immediatly)
652
-			$this->jquery_code_for_compile[]=$str;
662
+		if ($immediatly) {
663
+					$this->jquery_code_for_compile[]=$str;
664
+		}
653 665
 		return $str;
654 666
 	}
655 667
 
@@ -674,8 +686,9 @@  discard block
 block discarded – undo
674 686
 
675 687
 		$str="$({$element}).slideToggle({$speed}{$callback});";
676 688
 
677
-		if ($immediatly)
678
-			$this->jquery_code_for_compile[]=$str;
689
+		if ($immediatly) {
690
+					$this->jquery_code_for_compile[]=$str;
691
+		}
679 692
 		return $str;
680 693
 	}
681 694
 
@@ -692,8 +705,9 @@  discard block
 block discarded – undo
692 705
 		$element=$this->_prep_element($element);
693 706
 		$str="$({$element}).toggle();";
694 707
 
695
-		if ($immediatly)
696
-			$this->jquery_code_for_compile[]=$str;
708
+		if ($immediatly) {
709
+					$this->jquery_code_for_compile[]=$str;
710
+		}
697 711
 		return $str;
698 712
 	}
699 713
 
@@ -709,8 +723,9 @@  discard block
 block discarded – undo
709 723
 		$element=$this->_prep_element($element);
710 724
 		$str="$({$element}).trigger(\"$event\");";
711 725
 
712
-		if ($immediatly)
713
-			$this->jquery_code_for_compile[]=$str;
726
+		if ($immediatly) {
727
+					$this->jquery_code_for_compile[]=$str;
728
+		}
714 729
 		return $str;
715 730
 	}
716 731
 
@@ -735,8 +750,9 @@  discard block
 block discarded – undo
735 750
 
736 751
 		$str="$({$element}).show({$speed}{$callback});";
737 752
 
738
-		if ($immediatly)
739
-			$this->jquery_code_for_compile[]=$str;
753
+		if ($immediatly) {
754
+					$this->jquery_code_for_compile[]=$str;
755
+		}
740 756
 		return $str;
741 757
 	}
742 758
 
@@ -754,8 +770,9 @@  discard block
 block discarded – undo
754 770
 			$str.="else{".$jsCodeIfFalse."}";
755 771
 		}
756 772
 
757
-		if ($immediatly)
758
-			$this->jquery_code_for_compile[]=$str;
773
+		if ($immediatly) {
774
+					$this->jquery_code_for_compile[]=$str;
775
+		}
759 776
 		return $str;
760 777
 	}
761 778
 
@@ -821,12 +838,14 @@  discard block
 block discarded – undo
821 838
 		if ($stopPropagation===true) {
822 839
 			$js="event.stopPropagation();\n".$js;
823 840
 		}
824
-		if (array_search($event, $this->jquery_events)===false)
825
-			$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
826
-		else
827
-			$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
828
-		if($immediatly)
829
-			$this->jquery_code_for_compile[]=$event;
841
+		if (array_search($event, $this->jquery_events)===false) {
842
+					$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
843
+		} else {
844
+					$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
845
+		}
846
+		if($immediatly) {
847
+					$this->jquery_code_for_compile[]=$event;
848
+		}
830 849
 		return $event;
831 850
 	}
832 851
 
@@ -879,8 +898,9 @@  discard block
 block discarded – undo
879 898
 		}
880 899
 		$output=($script_tags===FALSE) ? $script : $this->inline($script);
881 900
 
882
-		if ($view!=NULL)
883
-			$view->setVar($view_var, $output);
901
+		if ($view!=NULL) {
902
+					$view->setVar($view_var, $output);
903
+		}
884 904
 		return $output;
885 905
 	}
886 906
 
@@ -1003,8 +1023,9 @@  discard block
 block discarded – undo
1003 1023
 		}
1004 1024
 		$retour.="$.".$method."(url,".$params.").done(function( data ) {\n";
1005 1025
 		$retour.=$this->_getOnAjaxDone($responseElement, $jsCallback)."});\n";
1006
-		if ($immediatly)
1007
-			$this->jquery_code_for_compile[]=$retour;
1026
+		if ($immediatly) {
1027
+					$this->jquery_code_for_compile[]=$retour;
1028
+		}
1008 1029
 		return $retour;
1009 1030
 	}
1010 1031
 
@@ -1012,13 +1033,15 @@  discard block
 block discarded – undo
1012 1033
 		$url=$this->_correctAjaxUrl($url);
1013 1034
 		$retour="url='".$url."';\n";
1014 1035
 		$slash="/";
1015
-		if(PhalconUtils::endsWith($url, "/"))
1016
-			$slash="";
1036
+		if(PhalconUtils::endsWith($url, "/")) {
1037
+					$slash="";
1038
+		}
1017 1039
 		if(JString::isNotNull($attr)){
1018
-			if ($attr=="value")
1019
-				$retour.="url=url+'".$slash."'+$(this).val();\n";
1020
-			else if($attr!=null && $attr!=="")
1021
-				$retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n";
1040
+			if ($attr=="value") {
1041
+							$retour.="url=url+'".$slash."'+$(this).val();\n";
1042
+			} else if($attr!=null && $attr!=="") {
1043
+							$retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n";
1044
+			}
1022 1045
 		}
1023 1046
 		return $retour;
1024 1047
 	}
@@ -1040,8 +1063,9 @@  discard block
 block discarded – undo
1040 1063
 	}
1041 1064
 
1042 1065
 	protected function _correctAjaxUrl($url) {
1043
-		if (PhalconUtils::endsWith($url, "/"))
1044
-			$url=substr($url, 0, strlen($url)-1);
1066
+		if (PhalconUtils::endsWith($url, "/")) {
1067
+					$url=substr($url, 0, strlen($url)-1);
1068
+		}
1045 1069
 		if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) {
1046 1070
 			$url=$this->_di->get("url")->get($url);
1047 1071
 		}
@@ -1065,8 +1089,9 @@  discard block
 block discarded – undo
1065 1089
 		$retour.="\t".$jsCallback."\n".
1066 1090
 				"\t$(document).trigger('jsonReady',[data]);\n".
1067 1091
 		"});\n";
1068
-		if ($immediatly)
1069
-			$this->jquery_code_for_compile[]=$retour;
1092
+		if ($immediatly) {
1093
+					$this->jquery_code_for_compile[]=$retour;
1094
+		}
1070 1095
 		return $retour;
1071 1096
 	}
1072 1097
 
@@ -1105,7 +1130,7 @@  discard block
 block discarded – undo
1105 1130
 		if($context===null){
1106 1131
 			$appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n";
1107 1132
 			$newElm = "$('#'+newId)";
1108
-		}else{
1133
+		} else{
1109 1134
 			$appendTo="\t\tnewElm.appendTo(".$context.");\n";
1110 1135
 			$newElm = $context.".find('#'+newId)";
1111 1136
 		}
@@ -1115,8 +1140,9 @@  discard block
 block discarded – undo
1115 1140
 		$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";
1116 1141
 		$retour.="\t$(document).trigger('jsonReady',[data]);\n";
1117 1142
 		$retour.="\t".$jsCallback."\n"."});\n";
1118
-		if ($immediatly)
1119
-			$this->jquery_code_for_compile[]=$retour;
1143
+		if ($immediatly) {
1144
+					$this->jquery_code_for_compile[]=$retour;
1145
+		}
1120 1146
 		return $retour;
1121 1147
 	}
1122 1148
 	/**
@@ -1157,8 +1183,9 @@  discard block
 block discarded – undo
1157 1183
 			}});\n";
1158 1184
 			$retour.="$('#".$form."').submit();\n";
1159 1185
 		}
1160
-		if ($immediatly)
1161
-			$this->jquery_code_for_compile[]=$retour;
1186
+		if ($immediatly) {
1187
+					$this->jquery_code_for_compile[]=$retour;
1188
+		}
1162 1189
 		return $retour;
1163 1190
 	}
1164 1191
 
@@ -1238,11 +1265,13 @@  discard block
 block discarded – undo
1238 1265
 	public function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) {
1239 1266
 		$param=$this->_prep_value($param);
1240 1267
 		$callback="";
1241
-		if ($jsCallback!="")
1242
-			$callback=", function(event){\n{$jsCallback}\n}";
1268
+		if ($jsCallback!="") {
1269
+					$callback=", function(event){\n{$jsCallback}\n}";
1270
+		}
1243 1271
 		$script="$(".$this->_prep_element($element).").".$jqueryCall."(".$param.$callback.");\n";
1244
-		if ($immediatly)
1245
-			$this->jquery_code_for_compile[]=$script;
1272
+		if ($immediatly) {
1273
+					$this->jquery_code_for_compile[]=$script;
1274
+		}
1246 1275
 		return $script;
1247 1276
 	}
1248 1277
 
@@ -1271,8 +1300,9 @@  discard block
 block discarded – undo
1271 1300
 	 */
1272 1301
 	public function _exec($js, $immediatly=false) {
1273 1302
 		$script=$js."\n";
1274
-		if ($immediatly)
1275
-			$this->jquery_code_for_compile[]=$script;
1303
+		if ($immediatly) {
1304
+					$this->jquery_code_for_compile[]=$script;
1305
+		}
1276 1306
 		return $script;
1277 1307
 	}
1278 1308
 
@@ -1291,7 +1321,9 @@  discard block
 block discarded – undo
1291 1321
 	}
1292 1322
 
1293 1323
 	private function minify($input) {
1294
-	if(trim($input) === "") return $input;
1324
+	if(trim($input) === "") {
1325
+		return $input;
1326
+	}
1295 1327
 	return preg_replace(
1296 1328
 			array(
1297 1329
 					// Remove comment(s)
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlBreadcrumbs.php 3 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,7 +164,6 @@  discard block
 block discarded – undo
164 164
 	 * Associate an ajax get to the breadcrumbs elements, displayed in $targetSelector
165 165
 	 * $attr member is used to build each element url
166 166
 	 * @param string $targetSelector the target of the get
167
-	 * @param string $attr the html attribute used to build the elements url
168 167
 	 * @return HtmlBreadcrumbs
169 168
 	 */
170 169
 	public function autoGetOnClick($targetSelector){
@@ -178,6 +177,9 @@  discard block
 block discarded – undo
178 177
 		return parent::contentAsString();
179 178
 	}
180 179
 
180
+	/**
181
+	 * @param integer $index
182
+	 */
181 183
 	public function getElement($index){
182 184
 		return $this->content[$index];
183 185
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
 		if(is_array($element)){
66 66
 			$elm=new HtmlLink("lnk-".$this->identifier."-".$size);
67 67
 			$elm->fromArray($element);
68
-		}else if($element instanceof HtmlLink){
68
+		} else if($element instanceof HtmlLink){
69 69
 			$elm=$element;
70
-		}else{
70
+		} else{
71 71
 			$elm=new HtmlLink("lnk-".$this->identifier."-".$size,$href,$element);
72 72
 			if(isset($glyph)){
73 73
 				$elm->wrapContentWithGlyph($glyph);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		}
115 115
 		if($this->absolutePaths===true){
116 116
 			return $this->_hrefFunction($this->content[$index]);
117
-		}else{
117
+		} else{
118 118
 			return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1));
119 119
 		}
120 120
 	}
@@ -204,8 +204,9 @@  discard block
 block discarded – undo
204 204
 		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
205 205
 			$items[]=$action;
206 206
 			foreach ($params as $p){
207
-				if(\is_object($p)===false)
208
-				$items[]=$p;
207
+				if(\is_object($p)===false) {
208
+								$items[]=$p;
209
+				}
209 210
 			}
210 211
 		}
211 212
 		return $this->addElements($items);
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
 	 * @param boolean $autoActive sets the last element's class to <b>active</b> if true
42 42
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
43 43
 	 */
44
-	public function __construct($identifier,$elements=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
45
-		parent::__construct($identifier,"ol");
44
+	public function __construct($identifier, $elements=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
45
+		parent::__construct($identifier, "ol");
46 46
 		$this->startIndex=$startIndex;
47 47
 		$this->setProperty("class", "breadcrumb");
48 48
 		$this->content=array();
49 49
 		$this->autoActive=$autoActive;
50 50
 		$this->absolutePaths;
51
-		$this->_hrefFunction=function ($e){return $e->getContent();};
52
-		if(isset($hrefFunction)){
51
+		$this->_hrefFunction=function($e) {return $e->getContent(); };
52
+		if (isset($hrefFunction)) {
53 53
 			$this->_hrefFunction=$hrefFunction;
54 54
 		}
55 55
 		$this->addElements($elements);
@@ -60,43 +60,43 @@  discard block
 block discarded – undo
60 60
 	 * @param string $href
61 61
 	 * @return \Ajax\bootstrap\html\HtmlLink
62 62
 	 */
63
-	public function addElement($element,$href="",$glyph=NULL){
63
+	public function addElement($element, $href="", $glyph=NULL) {
64 64
 		$size=sizeof($this->content);
65
-		if(is_array($element)){
65
+		if (is_array($element)) {
66 66
 			$elm=new HtmlLink("lnk-".$this->identifier."-".$size);
67 67
 			$elm->fromArray($element);
68
-		}else if($element instanceof HtmlLink){
68
+		}else if ($element instanceof HtmlLink) {
69 69
 			$elm=$element;
70
-		}else{
71
-			$elm=new HtmlLink("lnk-".$this->identifier."-".$size,$href,$element);
72
-			if(isset($glyph)){
70
+		}else {
71
+			$elm=new HtmlLink("lnk-".$this->identifier."-".$size, $href, $element);
72
+			if (isset($glyph)) {
73 73
 				$elm->wrapContentWithGlyph($glyph);
74 74
 			}
75 75
 		}
76
-		$elm->wrap("<li>","</li>");
76
+		$elm->wrap("<li>", "</li>");
77 77
 		$this->content[]=$elm;
78 78
 		$elm->setProperty($this->attr, $this->getHref($size));
79 79
 		return $elm;
80 80
 	}
81 81
 
82
-	public function setActive($index=null){
83
-		if(!isset($index)){
82
+	public function setActive($index=null) {
83
+		if (!isset($index)) {
84 84
 			$index=sizeof($this->content)-1;
85 85
 		}
86
-		$li=new HtmlBsDoubleElement("","li");
86
+		$li=new HtmlBsDoubleElement("", "li");
87 87
 		$li->setClass("active");
88 88
 		$li->setContent($this->content[$index]->getContent());
89 89
 		$this->content[$index]=$li;
90 90
 	}
91 91
 
92
-	public function addElements($elements){
93
-		foreach ( $elements as $element ) {
92
+	public function addElements($elements) {
93
+		foreach ($elements as $element) {
94 94
 			$this->addElement($element);
95 95
 		}
96 96
 		return $this;
97 97
 	}
98 98
 
99
-	public function fromArray($array){
99
+	public function fromArray($array) {
100 100
 		$array=parent::fromArray($array);
101 101
 		$this->addElements($array);
102 102
 		return $array;
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 	 * @param string $separator
109 109
 	 * @return string
110 110
 	 */
111
-	public function getHref($index=null,$separator="/"){
112
-		if(!isset($index)){
111
+	public function getHref($index=null, $separator="/") {
112
+		if (!isset($index)) {
113 113
 			$index=sizeof($this->content);
114 114
 		}
115
-		if($this->absolutePaths===true){
115
+		if ($this->absolutePaths===true) {
116 116
 			return $this->_hrefFunction($this->content[$index]);
117
-		}else{
118
-			return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1));
117
+		}else {
118
+			return $this->root.implode($separator, array_slice(array_map(function($e) {return $this->_hrefFunction($e); }, $this->content), $this->startIndex, $index+1));
119 119
 		}
120 120
 	}
121 121
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 * @see \Ajax\bootstrap\html\BaseHtml::compile()
125 125
 	 */
126 126
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
127
-		if($this->autoActive){
127
+		if ($this->autoActive) {
128 128
 			$this->setActive();
129 129
 		}
130 130
 		return parent::compile($js, $view);
@@ -142,19 +142,19 @@  discard block
 block discarded – undo
142 142
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
143 143
 	 */
144 144
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
145
-		foreach ($this->content as $element){
146
-			$element->on($event,$jsCode,$stopPropagation,$preventDefault);
145
+		foreach ($this->content as $element) {
146
+			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
147 147
 		}
148 148
 		return $this;
149 149
 	}
150 150
 
151 151
 	public function setAutoActive($autoActive) {
152
-		$this->autoActive = $autoActive;
152
+		$this->autoActive=$autoActive;
153 153
 		return $this;
154 154
 	}
155 155
 
156 156
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
157
-		foreach ($this->content as $element){
157
+		foreach ($this->content as $element) {
158 158
 			$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
159 159
 		}
160 160
 		return $this;
@@ -167,18 +167,18 @@  discard block
 block discarded – undo
167 167
 	 * @param string $attr the html attribute used to build the elements url
168 168
 	 * @return HtmlBreadcrumbs
169 169
 	 */
170
-	public function autoGetOnClick($targetSelector){
171
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
170
+	public function autoGetOnClick($targetSelector) {
171
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
172 172
 	}
173 173
 
174
-	public function contentAsString(){
175
-		if($this->autoActive){
174
+	public function contentAsString() {
175
+		if ($this->autoActive) {
176 176
 			$this->setActive();
177 177
 		}
178 178
 		return parent::contentAsString();
179 179
 	}
180 180
 
181
-	public function getElement($index){
181
+	public function getElement($index) {
182 182
 		return $this->content[$index];
183 183
 	}
184 184
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 * @param mixed $glyph
188 188
 	 * @param int $index
189 189
 	 */
190
-	public function addGlyph($glyph,$index=0){
190
+	public function addGlyph($glyph, $index=0) {
191 191
 		$elm=$this->getElement($index);
192 192
 		return $elm->wrapContentWithGlyph($glyph);
193 193
 	}
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
 	 * @param Dispatcher $dispatcher the request dispatcher
198 198
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
199 199
 	 */
200
-	public function fromDispatcher($dispatcher,$startIndex=0){
200
+	public function fromDispatcher($dispatcher, $startIndex=0) {
201 201
 		$this->startIndex=$startIndex;
202 202
 		$params=$dispatcher->getParams();
203 203
 		$action=$dispatcher->getActionName();
204 204
 		$items=array($dispatcher->getControllerName());
205
-		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
205
+		if (\sizeof($params)>0 || \strtolower($action)!="index") {
206 206
 			$items[]=$action;
207
-			foreach ($params as $p){
208
-				if(\is_object($p)===false)
207
+			foreach ($params as $p) {
208
+				if (\is_object($p)===false)
209 209
 				$items[]=$p;
210 210
 			}
211 211
 		}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
220 220
 	 */
221 221
 	public function setHrefFunction($_hrefFunction) {
222
-		$this->_hrefFunction = $_hrefFunction;
222
+		$this->_hrefFunction=$_hrefFunction;
223 223
 		return $this;
224 224
 	}
225 225
 
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlProgressbar.php 3 patches
Doc Comments   +16 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,6 +19,9 @@  discard block
 block discarded – undo
19 19
 	protected $style="";
20 20
 	protected $styleLimits=null;
21 21
 
22
+	/**
23
+	 * @param string $identifier
24
+	 */
22 25
 	public function __construct($identifier, $style="info", $value=0, $max=100, $min=0) {
23 26
 		parent::__construct($identifier);
24 27
 		$this->_template=include 'templates/tplProgressbar.php';
@@ -28,6 +31,9 @@  discard block
 block discarded – undo
28 31
 		$this->setStyle($style);
29 32
 	}
30 33
 
34
+	/**
35
+	 * @param boolean $value
36
+	 */
31 37
 	public function setActive($value) {
32 38
 		if(is_array($this->content)){
33 39
 			foreach ($this->content as $pb){
@@ -42,6 +48,9 @@  discard block
 block discarded – undo
42 48
 		return $this;
43 49
 	}
44 50
 
51
+	/**
52
+	 * @param boolean $value
53
+	 */
45 54
 	public function setStriped($value) {
46 55
 		if(is_array($this->content)){
47 56
 			foreach ($this->content as $pb){
@@ -56,6 +65,9 @@  discard block
 block discarded – undo
56 65
 		return $this;
57 66
 	}
58 67
 
68
+	/**
69
+	 * @param boolean $value
70
+	 */
59 71
 	public function showCaption($value) {
60 72
 		if(is_array($this->content)){
61 73
 			foreach ($this->content as $pb){
@@ -113,6 +125,9 @@  discard block
 block discarded – undo
113 125
 		return $this->isStacked;
114 126
 	}
115 127
 
128
+	/**
129
+	 * @param boolean $isStacked
130
+	 */
116 131
 	public function setIsStacked($isStacked) {
117 132
 		$this->isStacked=$isStacked;
118 133
 		return $this;
@@ -121,7 +136,7 @@  discard block
 block discarded – undo
121 136
 	/**
122 137
 	 * define the progressbar style
123 138
 	 * avaible values : "success","info","warning","danger"
124
-	 * @param string|int $cssStyle
139
+	 * @param string $cssStyle
125 140
 	 * @return \Ajax\bootstrap\html\HtmlProgressbar default : ""
126 141
 	 */
127 142
 	public function setStyle($cssStyle) {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 	}
30 30
 
31 31
 	public function setActive($value) {
32
-		if(is_array($this->content)){
33
-			foreach ($this->content as $pb){
32
+		if (is_array($this->content)) {
33
+			foreach ($this->content as $pb) {
34 34
 				$pb->setActive($value);
35 35
 			}
36
-		}else{
36
+		}else {
37 37
 			if ($value===true)
38 38
 				$this->active="active";
39 39
 			else
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	public function setStriped($value) {
46
-		if(is_array($this->content)){
47
-			foreach ($this->content as $pb){
46
+		if (is_array($this->content)) {
47
+			foreach ($this->content as $pb) {
48 48
 				$pb->setStriped($value);
49 49
 			}
50
-		}else{
50
+		}else {
51 51
 			if ($value===true)
52 52
 				$this->striped="progress-bar-striped";
53 53
 			else
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 	}
58 58
 
59 59
 	public function showCaption($value) {
60
-		if(is_array($this->content)){
61
-			foreach ($this->content as $pb){
60
+		if (is_array($this->content)) {
61
+			foreach ($this->content as $pb) {
62 62
 				$pb->showCaption($value);
63 63
 			}
64
-		}else{
64
+		}else {
65 65
 			if ($value===true)
66 66
 				$this->caption="%value%%";
67 67
 			else
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		$progressBar->setStriped($this->striped!=="" || $progressBar->isStriped());
82 82
 		$progressBar->setActive($this->active==="active" || $progressBar->isActive());
83 83
 		if (is_array($this->content)===false) {
84
-			$this->content=array ();
84
+			$this->content=array();
85 85
 		}
86 86
 		$this->content []=$progressBar;
87 87
 	}
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * @return \Ajax\bootstrap\html\HtmlProgressbar default : ""
126 126
 	 */
127 127
 	public function setStyle($cssStyle) {
128
-		return $this->setMemberCtrl($this->style,CssRef::getStyle($cssStyle, "progress-bar"), CssRef::Styles("progress-bar"));
128
+		return $this->setMemberCtrl($this->style, CssRef::getStyle($cssStyle, "progress-bar"), CssRef::Styles("progress-bar"));
129 129
 	}
130 130
 
131 131
 	/*
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
 	 */
135 135
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
136 136
 		$actualStyle=$this->style;
137
-		if(isset($this->styleLimits)&& JArray::isAssociative($this->styleLimits)){
138
-			foreach ($this->styleLimits as $k=>$v){
137
+		if (isset($this->styleLimits) && JArray::isAssociative($this->styleLimits)) {
138
+			foreach ($this->styleLimits as $k=>$v) {
139 139
 				$actualStyle=$k;
140
-				if($v>$this->value)
140
+				if ($v>$this->value)
141 141
 					break;
142 142
 			}
143 143
 		}
Please login to merge, or discard this patch.
Braces   +21 added lines, -17 removed lines patch added patch discarded remove patch
@@ -33,11 +33,12 @@  discard block
 block discarded – undo
33 33
 			foreach ($this->content as $pb){
34 34
 				$pb->setActive($value);
35 35
 			}
36
-		}else{
37
-			if ($value===true)
38
-				$this->active="active";
39
-			else
40
-				$this->active="";
36
+		} else{
37
+			if ($value===true) {
38
+							$this->active="active";
39
+			} else {
40
+							$this->active="";
41
+			}
41 42
 		}
42 43
 		return $this;
43 44
 	}
@@ -47,11 +48,12 @@  discard block
 block discarded – undo
47 48
 			foreach ($this->content as $pb){
48 49
 				$pb->setStriped($value);
49 50
 			}
50
-		}else{
51
-			if ($value===true)
52
-				$this->striped="progress-bar-striped";
53
-			else
54
-				$this->striped="";
51
+		} else{
52
+			if ($value===true) {
53
+							$this->striped="progress-bar-striped";
54
+			} else {
55
+							$this->striped="";
56
+			}
55 57
 		}
56 58
 		return $this;
57 59
 	}
@@ -61,11 +63,12 @@  discard block
 block discarded – undo
61 63
 			foreach ($this->content as $pb){
62 64
 				$pb->showCaption($value);
63 65
 			}
64
-		}else{
65
-			if ($value===true)
66
-				$this->caption="%value%%";
67
-			else
68
-				$this->caption='<span class="sr-only">%value%% Complete (%style%)</span>';
66
+		} else{
67
+			if ($value===true) {
68
+							$this->caption="%value%%";
69
+			} else {
70
+							$this->caption='<span class="sr-only">%value%% Complete (%style%)</span>';
71
+			}
69 72
 		}
70 73
 		return $this;
71 74
 	}
@@ -137,8 +140,9 @@  discard block
 block discarded – undo
137 140
 		if(isset($this->styleLimits)&& JArray::isAssociative($this->styleLimits)){
138 141
 			foreach ($this->styleLimits as $k=>$v){
139 142
 				$actualStyle=$k;
140
-				if($v>$this->value)
141
-					break;
143
+				if($v>$this->value) {
144
+									break;
145
+				}
142 146
 			}
143 147
 		}
144 148
 		$this->style=$actualStyle;
Please login to merge, or discard this patch.
Ajax/Bootstrap.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 	 * @param string $tagName container tagName
270 270
 	 * @return HtmlListgroup
271 271
 	 */
272
-	public function htmlListgroup($identifier,$items=array(),$tagName="ul"){
273
-		$listGroup=new HtmlListgroup($identifier,$tagName);
272
+	public function htmlListgroup($identifier, $items=array(), $tagName="ul") {
273
+		$listGroup=new HtmlListgroup($identifier, $tagName);
274 274
 		$listGroup->addItems($items);
275 275
 		return $this->addHtmlComponent($listGroup);
276 276
 	}
@@ -295,8 +295,8 @@  discard block
 block discarded – undo
295 295
 	 * @param string $onClick
296 296
 	 * @return HtmlSplitbutton
297 297
 	 */
298
-	public function htmlSplitbutton($identifier,$value="", $items=array(), $cssStyle="btn-default", $onClick=NULL) {
299
-		return $this->addHtmlComponent(new HtmlSplitbutton($identifier, $value, $items, $cssStyle,$onClick));
298
+	public function htmlSplitbutton($identifier, $value="", $items=array(), $cssStyle="btn-default", $onClick=NULL) {
299
+		return $this->addHtmlComponent(new HtmlSplitbutton($identifier, $value, $items, $cssStyle, $onClick));
300 300
 	}
301 301
 
302 302
 	/**
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	 * @param string $identifier
305 305
 	 * @return HtmlInputgroup
306 306
 	 */
307
-	public function htmlInputgroup($identifier){
307
+	public function htmlInputgroup($identifier) {
308 308
 		return $this->addHtmlComponent(new HtmlInputgroup($identifier));
309 309
 	}
310 310
 
@@ -316,8 +316,8 @@  discard block
 block discarded – undo
316 316
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
317 317
 	 * @return HtmlBreadcrumbs
318 318
 	 */
319
-	public function htmlBreadcrumbs($identifier,$elements=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
320
-		return $this->addHtmlComponent(new HtmlBreadcrumbs($identifier,$elements,$autoActive,$startIndex,$hrefFunction));
319
+	public function htmlBreadcrumbs($identifier, $elements=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
320
+		return $this->addHtmlComponent(new HtmlBreadcrumbs($identifier, $elements, $autoActive, $startIndex, $hrefFunction));
321 321
 	}
322 322
 
323 323
 	/**
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
 	 * @param int $active The active page
330 330
 	 * @return HtmlPagination
331 331
 	 */
332
-	public function htmlPagination($identifier,$from=1,$to=1,$active=NULL,$countVisible=NULL){
333
-		return $this->addHtmlComponent(new HtmlPagination($identifier,$from,$to,$active,$countVisible));
332
+	public function htmlPagination($identifier, $from=1, $to=1, $active=NULL, $countVisible=NULL) {
333
+		return $this->addHtmlComponent(new HtmlPagination($identifier, $from, $to, $active, $countVisible));
334 334
 	}
335 335
 
336 336
 	/**
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	 * @param int $numCols
342 342
 	 * @return HtmlGridSystem
343 343
 	 */
344
-	public function htmlGridSystem($identifier,$numRows=1,$numCols=NULL){
345
-		return $this->addHtmlComponent(new HtmlGridSystem($identifier,$numRows,$numCols));
344
+	public function htmlGridSystem($identifier, $numRows=1, $numCols=NULL) {
345
+		return $this->addHtmlComponent(new HtmlGridSystem($identifier, $numRows, $numCols));
346 346
 	}
347 347
 }
348 348
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/html/PropertyWrapper.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -7,6 +7,9 @@
 block discarded – undo
7 7
 
8 8
 class PropertyWrapper {
9 9
 
10
+	/**
11
+	 * @param \Ajax\JsUtils $js
12
+	 */
10 13
 	public static function wrap($input, $js=NULL, $separator=' ', $valueQuote='"') {
11 14
 		$output="";
12 15
 		if (is_string($input)) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 				$value1=reset($input);
18 18
 				if (is_object($value1)) {
19 19
 					$output=PropertyWrapper::wrapObjects($input, $js, $separator=' ');
20
-				} else
20
+				}else
21 21
 					$output=PropertyWrapper::wrapStrings($input, $separator=' ', $valueQuote='"');
22 22
 			}
23 23
 		}
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
 
27 27
 	public static function wrapStrings($input, $separator=' ', $valueQuote='"') {
28 28
 		if (JArray::isAssociative($input)===true) {
29
-			$result=implode($separator, array_map(function ($v, $k) use($valueQuote) {
29
+			$result=implode($separator, array_map(function($v, $k) use($valueQuote) {
30 30
 				return $k.'='.$valueQuote.$v.$valueQuote;
31 31
 			}, $input, array_keys($input)));
32
-		} else {
32
+		}else {
33 33
 			$result=implode($separator, array_values($input));
34 34
 		}
35 35
 		return $result;
36 36
 	}
37 37
 
38 38
 	public static function wrapObjects($input, $js=NULL, $separator=' ') {
39
-		return implode($separator, array_map(function ($v) use($js) {
39
+		return implode($separator, array_map(function($v) use($js) {
40 40
 			return $v->compile($js);
41 41
 		}, $input));
42 42
 	}
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,8 +17,9 @@  discard block
 block discarded – undo
17 17
 				$value1=reset($input);
18 18
 				if (is_object($value1)) {
19 19
 					$output=PropertyWrapper::wrapObjects($input, $js, $separator=' ');
20
-				} else
21
-					$output=PropertyWrapper::wrapStrings($input, $separator=' ', $valueQuote='"');
20
+				} else {
21
+									$output=PropertyWrapper::wrapStrings($input, $separator=' ', $valueQuote='"');
22
+				}
22 23
 			}
23 24
 		}
24 25
 		return $output;
@@ -37,10 +38,11 @@  discard block
 block discarded – undo
37 38
 
38 39
 	public static function wrapObjects($input, $js=NULL, $separator=' ') {
39 40
 		return implode($separator, array_map(function ($v) use($js) {
40
-			if (is_object($v))
41
-				return $v->compile($js);
42
-			else
43
-				return $v;
41
+			if (is_object($v)) {
42
+							return $v->compile($js);
43
+			} else {
44
+							return $v;
45
+			}
44 46
 		}, $input));
45 47
 	}
46 48
 }
47 49
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/Semantic.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 			foreach ($icons as $icon=>$size){
37 37
 				$group->addIcon($icon,$size);
38 38
 			}
39
-		}else{
39
+		} else{
40 40
 			foreach ($icons as $icon){
41 41
 				$group->addIcon($icon);
42 42
 			}
Please login to merge, or discard this patch.
Doc Comments   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @param string $attachTo
43 43
 	 * @param string|array $params
44
-	 * @return $this
44
+	 * @return common\components\SimpleComponent
45 45
 	 */
46 46
 	public function generic($attachTo=NULL, $params=NULL) {
47 47
 		return $this->addComponent(new GenericComponent($this->js), $attachTo, $params);
@@ -50,16 +50,22 @@  discard block
 block discarded – undo
50 50
 	 *
51 51
 	 * @param string $attachTo
52 52
 	 * @param string|array $params
53
-	 * @return $this
53
+	 * @return common\components\SimpleComponent
54 54
 	 */
55 55
 	public function popup($attachTo=NULL, $params=NULL) {
56 56
 		return $this->addComponent(new Popup($this->js), $attachTo, $params);
57 57
 	}
58 58
 
59
+	/**
60
+	 * @param string $attachTo
61
+	 */
59 62
 	public function dropdown($attachTo=NULL, $params=NULL) {
60 63
 		return $this->addComponent(new Dropdown($this->js), $attachTo, $params);
61 64
 	}
62 65
 
66
+	/**
67
+	 * @param string $attachTo
68
+	 */
63 69
 	public function accordion($attachTo=NULL, $params=NULL) {
64 70
 		return $this->addComponent(new Accordion($this->js), $attachTo, $params);
65 71
 	}
@@ -220,7 +226,7 @@  discard block
 block discarded – undo
220 226
 
221 227
 	/**
222 228
 	 * @param string $identifier
223
-	 * @param number $niveau
229
+	 * @param integer $niveau
224 230
 	 * @param mixed $content
225 231
 	 * @param string $type
226 232
 	 */
@@ -239,7 +245,6 @@  discard block
 block discarded – undo
239 245
 	/**
240 246
 	 * Return a new Seamntic Html Breadcrumb
241 247
 	 * @param string $identifier
242
-	 * @param array $elements
243 248
 	 * @param boolean $autoActive sets the last element's class to <b>active</b> if true. default : true
244 249
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
245 250
 	 * @return HtmlBreadcrumb
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @param string $identifier
83 83
 	 * @param string $icon
84 84
 	 */
85
-	public function htmlIcon($identifier,$icon){
85
+	public function htmlIcon($identifier, $icon) {
86 86
 		return $this->addHtmlComponent(new HtmlIcon($identifier, $icon));
87 87
 	}
88 88
 
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 	 * @param string $size
92 92
 	 * @param array $icons
93 93
 	 */
94
-	public function htmlIconGroups($identifier,$size="",$icons=array()){
95
-		$group=new HtmlIconGroups($identifier,$size);
96
-		if(JArray::isAssociative($icons)){
97
-			foreach ($icons as $icon=>$size){
98
-				$group->add($icon,$size);
94
+	public function htmlIconGroups($identifier, $size="", $icons=array()) {
95
+		$group=new HtmlIconGroups($identifier, $size);
96
+		if (JArray::isAssociative($icons)) {
97
+			foreach ($icons as $icon=>$size) {
98
+				$group->add($icon, $size);
99 99
 			}
100
-		}else{
101
-			foreach ($icons as $icon){
100
+		}else {
101
+			foreach ($icons as $icon) {
102 102
 				$group->add($icon);
103 103
 			}
104 104
 		}
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 	 * @param array $elements
111 111
 	 * @param boolean $asIcons
112 112
 	 */
113
-	public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){
114
-		return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements,$asIcons));
113
+	public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) {
114
+		return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons));
115 115
 	}
116 116
 
117 117
 	/**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 * @param string $identifier
120 120
 	 * @param string $content
121 121
 	 */
122
-	public function htmlContainer($identifier,$content=""){
122
+	public function htmlContainer($identifier, $content="") {
123 123
 		return $this->addHtmlComponent(new HtmlContainer($identifier, $content));
124 124
 	}
125 125
 
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	 * @param string $identifier
128 128
 	 * @param string $content
129 129
 	 */
130
-	public function htmlDivider($identifier,$content="",$tagName="div"){
131
-		return $this->addHtmlComponent(new HtmlDivider($identifier, $content,$tagName));
130
+	public function htmlDivider($identifier, $content="", $tagName="div") {
131
+		return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName));
132 132
 	}
133 133
 
134 134
 	/**
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 	 * @param string $content
137 137
 	 * @param string $tagName
138 138
 	 */
139
-	public function htmlLabel($identifier,$content="",$tagName="div"){
140
-		return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$tagName));
139
+	public function htmlLabel($identifier, $content="", $tagName="div") {
140
+		return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $tagName));
141 141
 	}
142 142
 
143 143
 	/**
@@ -145,24 +145,24 @@  discard block
 block discarded – undo
145 145
 	 * @param array $items
146 146
 	 * @return Ajax\semantic\html\collections\HtmlMenu
147 147
 	 */
148
-	public function htmlMenu($identifier,$items=array()){
149
-		return $this->addHtmlComponent(new HtmlMenu($identifier,$items));
148
+	public function htmlMenu($identifier, $items=array()) {
149
+		return $this->addHtmlComponent(new HtmlMenu($identifier, $items));
150 150
 	}
151 151
 
152 152
 	/**Adds an icon menu
153 153
 	 * @param string $identifier
154 154
 	 * @param array $items icons
155 155
 	 */
156
-	public function htmlIconMenu($identifier,$items=array()){
157
-		return $this->addHtmlComponent(new HtmlIconMenu($identifier,$items));
156
+	public function htmlIconMenu($identifier, $items=array()) {
157
+		return $this->addHtmlComponent(new HtmlIconMenu($identifier, $items));
158 158
 	}
159 159
 
160 160
 	/**Adds an labeled icon menu
161 161
 	 * @param string $identifier
162 162
 	 * @param array $items icons
163 163
 	 */
164
-	public function htmlLabeledIconMenu($identifier,$items=array()){
165
-		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier,$items));
164
+	public function htmlLabeledIconMenu($identifier, $items=array()) {
165
+		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier, $items));
166 166
 	}
167 167
 
168 168
 	/**
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 	 * @param string $value
171 171
 	 * @param array $items
172 172
 	 */
173
-	public function htmlDropdown($identifier, $value="", $items=array()){
174
-		return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items));
173
+	public function htmlDropdown($identifier, $value="", $items=array()) {
174
+		return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items));
175 175
 	}
176 176
 
177 177
 	/**
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 	 * @param string $identifier
180 180
 	 * @param string $content
181 181
 	 */
182
-	public function htmlMessage($identifier, $content=""){
183
-		return $this->addHtmlComponent(new HtmlMessage($identifier,$content));
182
+	public function htmlMessage($identifier, $content="") {
183
+		return $this->addHtmlComponent(new HtmlMessage($identifier, $content));
184 184
 	}
185 185
 
186 186
 	/**
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 	 * @param string $identifier
189 189
 	 * @param string $content
190 190
 	 */
191
-	public function htmlSegment($identifier, $content=""){
192
-		return $this->addHtmlComponent(new HtmlSegment($identifier,$content));
191
+	public function htmlSegment($identifier, $content="") {
192
+		return $this->addHtmlComponent(new HtmlSegment($identifier, $content));
193 193
 	}
194 194
 
195 195
 	/**
@@ -197,16 +197,16 @@  discard block
 block discarded – undo
197 197
 	 * @param string $identifier
198 198
 	 * @param array $items the segments
199 199
 	 */
200
-	public function htmlSegmentGroups($identifier, $items=array()){
201
-		return $this->addHtmlComponent(new HtmlSegmentGroups($identifier,$items));
200
+	public function htmlSegmentGroups($identifier, $items=array()) {
201
+		return $this->addHtmlComponent(new HtmlSegmentGroups($identifier, $items));
202 202
 	}
203 203
 
204 204
 	/**
205 205
 	 * @param string $identifier
206 206
 	 * @param mixed $content
207 207
 	 */
208
-	public function htmlPopup(BaseHtml $container,$identifier,$content){
209
-		return $this->addHtmlComponent(new HtmlPopup($container,$identifier,$content));
208
+	public function htmlPopup(BaseHtml $container, $identifier, $content) {
209
+		return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content));
210 210
 	}
211 211
 
212 212
 	/**
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
 	 * @param boolean $createCols
217 217
 	 * @param boolean $implicitRows
218 218
 	 */
219
-	public function htmlGrid($identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
220
-		return $this->addHtmlComponent(new HtmlGrid($identifier,$numRows,$numCols,$createCols,$implicitRows));
219
+	public function htmlGrid($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) {
220
+		return $this->addHtmlComponent(new HtmlGrid($identifier, $numRows, $numCols, $createCols, $implicitRows));
221 221
 	}
222 222
 
223 223
 	/**
@@ -226,16 +226,16 @@  discard block
 block discarded – undo
226 226
 	 * @param mixed $content
227 227
 	 * @param string $type
228 228
 	 */
229
-	public function htmlHeader($identifier,$niveau=1,$content=NULL,$type="page"){
230
-		return $this->addHtmlComponent(new HtmlHeader($identifier,$niveau,$content,$type));
229
+	public function htmlHeader($identifier, $niveau=1, $content=NULL, $type="page") {
230
+		return $this->addHtmlComponent(new HtmlHeader($identifier, $niveau, $content, $type));
231 231
 	}
232 232
 
233
-	public function htmlInput($identifier,$type="text",$value="",$placeholder=""){
234
-		return $this->addHtmlComponent(new HtmlInput($identifier,$type,$value,$placeholder));
233
+	public function htmlInput($identifier, $type="text", $value="", $placeholder="") {
234
+		return $this->addHtmlComponent(new HtmlInput($identifier, $type, $value, $placeholder));
235 235
 	}
236 236
 
237
-	public function htmlList($identifier,$items=array()){
238
-		return $this->addHtmlComponent(new HtmlList($identifier,$items));
237
+	public function htmlList($identifier, $items=array()) {
238
+		return $this->addHtmlComponent(new HtmlList($identifier, $items));
239 239
 	}
240 240
 
241 241
 	/**
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
247 247
 	 * @return HtmlBreadcrumb
248 248
 	 */
249
-	public function htmlBreadcrumb( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
250
-		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier,$items,$autoActive,$startIndex,$hrefFunction));
249
+	public function htmlBreadcrumb($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
250
+		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier, $items, $autoActive, $startIndex, $hrefFunction));
251 251
 	}
252 252
 
253 253
 	/**
@@ -264,8 +264,8 @@  discard block
 block discarded – undo
264 264
 	 * @param string $identifier
265 265
 	 * @return HtmlAccordion
266 266
 	 */
267
-	public function htmlAccordionMenu($identifier,$items=array()) {
268
-		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier,$items));
267
+	public function htmlAccordionMenu($identifier, $items=array()) {
268
+		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier, $items));
269 269
 	}
270 270
 
271 271
 	/**
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	 * @param string $identifier
274 274
 	 * @param array $elements
275 275
 	 */
276
-	public function htmlForm($identifier,$elements=array()) {
277
-		return $this->addHtmlComponent(new HtmlForm($identifier,$elements));
276
+	public function htmlForm($identifier, $elements=array()) {
277
+		return $this->addHtmlComponent(new HtmlForm($identifier, $elements));
278 278
 	}
279 279
 }
280 280
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/base/HtmlBsDoubleElement.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,19 +23,19 @@
 block discarded – undo
23 23
 		return $this;
24 24
 	}
25 25
 
26
-	public function addGlyph($glyphicon,$before=true){
26
+	public function addGlyph($glyphicon, $before=true) {
27 27
 		$glyph=new HtmlGlyphicon("");
28 28
 		$glyph->setGlyphicon($glyphicon);
29
-		$this->addContent($glyph,$before);
29
+		$this->addContent($glyph, $before);
30 30
 		return $this;
31 31
 	}
32 32
 
33
-	public function wrapContentWithGlyph($glyphBefore,$glyphAfter=""){
33
+	public function wrapContentWithGlyph($glyphBefore, $glyphAfter="") {
34 34
 		$before=HtmlGlyphicon::getGlyphicon($glyphBefore)."&nbsp;";
35 35
 		$after="";
36
-		if($glyphAfter!==""){
36
+		if ($glyphAfter!=="") {
37 37
 			$after="&nbsp;".HtmlGlyphicon::getGlyphicon($glyphAfter);
38 38
 		}
39
-		return $this->wrapContent($before,$after);
39
+		return $this->wrapContent($before, $after);
40 40
 	}
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/html/HtmlDoubleElement.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
 		return $this->content;
28 28
 	}
29 29
 
30
-	public function addContent($content,$before=false) {
30
+	public function addContent($content, $before=false) {
31 31
 		if (is_array($this->content)===false) {
32
-			if(isset($this->content))
33
-				$this->content=array ($this->content);
32
+			if (isset($this->content))
33
+				$this->content=array($this->content);
34 34
 			else
35 35
 				$this->content=array();
36 36
 		}
37
-		if($before)
38
-			array_unshift($this->content,$content);
37
+		if ($before)
38
+			array_unshift($this->content, $content);
39 39
 		else
40 40
 			$this->content []=$content;
41 41
 		return $this;
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 		parent::run($js);
50 50
 		if ($this->content instanceof HtmlDoubleElement) {
51 51
 			$this->content->run($js);
52
-		} else if (is_array($this->content)) {
53
-			foreach ( $this->content as $itemContent ) {
52
+		}else if (is_array($this->content)) {
53
+			foreach ($this->content as $itemContent) {
54 54
 				if ($itemContent instanceof HtmlDoubleElement) {
55 55
 					$itemContent->run($js);
56 56
 				}
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,15 +29,17 @@
 block discarded – undo
29 29
 
30 30
 	public function addContent($content,$before=false) {
31 31
 		if (is_array($this->content)===false) {
32
-			if(isset($this->content))
33
-				$this->content=array ($this->content);
34
-			else
35
-				$this->content=array();
32
+			if(isset($this->content)) {
33
+							$this->content=array ($this->content);
34
+			} else {
35
+							$this->content=array();
36
+			}
37
+		}
38
+		if($before) {
39
+					array_unshift($this->content,$content);
40
+		} else {
41
+					$this->content []=$content;
36 42
 		}
37
-		if($before)
38
-			array_unshift($this->content,$content);
39
-		else
40
-			$this->content []=$content;
41 43
 		return $this;
42 44
 	}
43 45
 
Please login to merge, or discard this patch.