Completed
Pull Request — master (#2)
by Antoine
03:05
created
Ajax/JsUtils.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,8 +45,9 @@
 block discarded – undo
45 45
 
46 46
 	protected function _setDi($di) {
47 47
 		$this->_di=$di;
48
-		if ($this->js!=null&&$di!=null)
49
-			$this->js->setDi($di);
48
+		if ($this->js!=null&&$di!=null) {
49
+					$this->js->setDi($di);
50
+		}
50 51
 	}
51 52
 
52 53
 	/**
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 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) {
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	 * @return string
383 383
 	 */
384 384
 	public function addClass($element='this', $class='', $immediatly=false) {
385
-		return $this->js->_genericCallValue('addClass',$element, $class, $immediatly);
385
+		return $this->js->_genericCallValue('addClass', $element, $class, $immediatly);
386 386
 	}
387 387
 	
388 388
 	/**
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
 	 * @param boolean $immediatly defers the execution if set to false
393 393
 	 * @return string
394 394
 	 */
395
-	public function after($to, $element, $immediatly=false){
396
-		return $this->js->_genericCallElement('after',$to, $element, $immediatly);
395
+	public function after($to, $element, $immediatly=false) {
396
+		return $this->js->_genericCallElement('after', $to, $element, $immediatly);
397 397
 	}
398 398
 	
399 399
 	/**
@@ -403,8 +403,8 @@  discard block
 block discarded – undo
403 403
 	 * @param boolean $immediatly defers the execution if set to false
404 404
 	 * @return string
405 405
 	 */
406
-	public function before($to, $element, $immediatly=false){
407
-		return $this->js->_genericCallElement('before',$to, $element, $immediatly);
406
+	public function before($to, $element, $immediatly=false) {
407
+		return $this->js->_genericCallElement('before', $to, $element, $immediatly);
408 408
 	}
409 409
 	
410 410
 	/**
@@ -424,8 +424,8 @@  discard block
 block discarded – undo
424 424
 	 * @param string $value
425 425
 	 * @param boolean $immediatly defers the execution if set to false
426 426
 	 */
427
-	public function val($element='this',$value='',$immediatly=false){
428
-		return $this->js->_genericCallValue('val',$element,$value,$immediatly);
427
+	public function val($element='this', $value='', $immediatly=false) {
428
+		return $this->js->_genericCallValue('val', $element, $value, $immediatly);
429 429
 	}
430 430
 
431 431
 	/**
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	 * @param boolean $immediatly defers the execution if set to false
436 436
 	 */
437 437
 	public function html($element='this', $value='', $immediatly=false) {
438
-		return $this->js->_genericCallValue('html',$element, $value, $immediatly);
438
+		return $this->js->_genericCallValue('html', $element, $value, $immediatly);
439 439
 	}
440 440
 	// --------------------------------------------------------------------
441 441
 	/**
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 * @return string
461 461
 	 */
462 462
 	public function append($to, $element, $immediatly=false) {
463
-		return $this->js->_genericCallElement('append',$to, $element, $immediatly);
463
+		return $this->js->_genericCallElement('append', $to, $element, $immediatly);
464 464
 	}
465 465
 
466 466
 	/**
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 	 * @return string
472 472
 	 */
473 473
 	public function prepend($to, $element, $immediatly=false) {
474
-		return $this->js->_genericCallElement('prepend',$to, $element, $immediatly);
474
+		return $this->js->_genericCallElement('prepend', $to, $element, $immediatly);
475 475
 	}
476 476
 	// --------------------------------------------------------------------
477 477
 	/**
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 	 * @return string
523 523
 	 */
524 524
 	public function removeClass($element='this', $class='', $immediatly=false) {
525
-		return $this->js->_genericCall('removeClass',$element, $class, $immediatly);
525
+		return $this->js->_genericCall('removeClass', $element, $class, $immediatly);
526 526
 	}
527 527
 	// --------------------------------------------------------------------
528 528
 	/**
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 	 * @return string
584 584
 	 */
585 585
 	public function toggleClass($element='this', $class='', $immediatly=false) {
586
-		return $this->js->_genericCallValue('toggleClass',$element, $class, $immediatly);
586
+		return $this->js->_genericCallValue('toggleClass', $element, $class, $immediatly);
587 587
 	}
588 588
 
589 589
 	/**
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 	 */
631 631
 	public function compile($view=NULL, $view_var='script_foot', $script_tags=TRUE) {
632 632
 		$bs=$this->_bootstrap;
633
-		if (isset($bs)&&isset($view)) {
633
+		if (isset($bs) && isset($view)) {
634 634
 			$bs->compileHtml($this, $view);
635 635
 		}
636 636
 		return $this->js->_compile($view, $view_var, $script_tags);
@@ -710,27 +710,27 @@  discard block
 block discarded – undo
710 710
 				$json_result=$result->result_array();
711 711
 			} elseif (is_array($result)) {
712 712
 				$json_result=$result;
713
-			} else {
713
+			}else {
714 714
 				return $this->_prep_args($result);
715 715
 			}
716
-		} else {
716
+		}else {
717 717
 			return 'null';
718 718
 		}
719 719
 		return $this->_create_json($json_result, $match_array_type);
720 720
 	}
721 721
 
722 722
 	private function _create_json($json_result, $match_array_type) {
723
-		$json=array ();
723
+		$json=array();
724 724
 		$_is_assoc=TRUE;
725
-		if (!is_array($json_result)&&empty($json_result)) {
725
+		if (!is_array($json_result) && empty($json_result)) {
726 726
 			show_error("Generate JSON Failed - Illegal key, value pair.");
727 727
 		} elseif ($match_array_type) {
728 728
 			$_is_assoc=$this->_is_associative_array($json_result);
729 729
 		}
730
-		foreach ( $json_result as $k => $v ) {
730
+		foreach ($json_result as $k => $v) {
731 731
 			if ($_is_assoc) {
732 732
 				$json[]=$this->_prep_args($k, TRUE).':'.$this->generate_json($v, $match_array_type);
733
-			} else {
733
+			}else {
734 734
 				$json[]=$this->generate_json($v, $match_array_type);
735 735
 			}
736 736
 		}
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
 	 * @return type
746 746
 	 */
747 747
 	public function _is_associative_array($arr) {
748
-		foreach ( array_keys($arr) as $key => $val ) {
748
+		foreach (array_keys($arr) as $key => $val) {
749 749
 			if ($key!==$val) {
750 750
 				return TRUE;
751 751
 			}
@@ -764,11 +764,11 @@  discard block
 block discarded – undo
764 764
 			return 'null';
765 765
 		} elseif (is_bool($result)) {
766 766
 			return ($result===TRUE) ? 'true' : 'false';
767
-		} elseif (is_string($result)||$is_key) {
768
-			return '"'.str_replace(array (
769
-					'\\',"\t","\n","\r",'"','/'
770
-			), array (
771
-					'\\\\','\\t','\\n',"\\r",'\"','\/'
767
+		} elseif (is_string($result) || $is_key) {
768
+			return '"'.str_replace(array(
769
+					'\\', "\t", "\n", "\r", '"', '/'
770
+			), array(
771
+					'\\\\', '\\t', '\\n', "\\r", '\"', '\/'
772 772
 			), $result).'"';
773 773
 		} elseif (is_scalar($result)) {
774 774
 			return $result;
@@ -783,8 +783,8 @@  discard block
 block discarded – undo
783 783
 	 * @param string $jsCallback javascript code to execute after the request
784 784
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
785 785
 	 */
786
-	public function get($url, $responseElement="", $params="{}", $jsCallback=NULL,$hasLoader=true) {
787
-		return $this->js->_get($url, $params, $responseElement, $jsCallback, NULL, $hasLoader,true);
786
+	public function get($url, $responseElement="", $params="{}", $jsCallback=NULL, $hasLoader=true) {
787
+		return $this->js->_get($url, $params, $responseElement, $jsCallback, NULL, $hasLoader, true);
788 788
 	}
789 789
 
790 790
 	/**
@@ -794,8 +794,8 @@  discard block
 block discarded – undo
794 794
 	 * @param string $method Method used
795 795
 	 * @param string $jsCallback javascript code to execute after the request
796 796
 	 */
797
-	public function json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document",$immediatly=false) {
798
-		return $this->js->_json($url, $method, $params, $jsCallback, $attr, $context,$immediatly);
797
+	public function json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document", $immediatly=false) {
798
+		return $this->js->_json($url, $method, $params, $jsCallback, $attr, $context, $immediatly);
799 799
 	}
800 800
 
801 801
 	/**
@@ -805,8 +805,8 @@  discard block
 block discarded – undo
805 805
 	 * @param string $url the request address
806 806
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get")
807 807
 	 */
808
-	public function jsonOn($event,$element, $url,$parameters=array()) {
809
-		return $this->js->_jsonOn($event, $element, $url,$parameters);
808
+	public function jsonOn($event, $element, $url, $parameters=array()) {
809
+		return $this->js->_jsonOn($event, $element, $url, $parameters);
810 810
 	}
811 811
 	
812 812
 	/**
@@ -850,8 +850,8 @@  discard block
 block discarded – undo
850 850
 	 * @param string $url the request url
851 851
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get")
852 852
 	 */
853
-	public function jsonArrayOn($event,$element,$maskSelector, $url,$parameters=array()) {
854
-		return $this->js->_jsonArrayOn($event,$element,$maskSelector, $url, $parameters);
853
+	public function jsonArrayOn($event, $element, $maskSelector, $url, $parameters=array()) {
854
+		return $this->js->_jsonArrayOn($event, $element, $maskSelector, $url, $parameters);
855 855
 	}
856 856
 
857 857
 	/**
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 	 * @param string $jsCallback javascript code to execute after the request
864 864
 	 * @param string $attr the html attribute added to the request
865 865
 	 */
866
-	public function getDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL,$attr="id") {
866
+	public function getDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL, $attr="id") {
867 867
 		return $this->js->_get($url, $params, $responseElement, $jsCallback, $attr, false);
868 868
 	}
869 869
 
@@ -901,8 +901,8 @@  discard block
 block discarded – undo
901 901
 	 * @param string $jsCallback javascript code to execute after the request
902 902
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
903 903
 	 */
904
-	public function post($url, $responseElement="", $params="{}", $jsCallback=NULL,$hasLoader=true) {
905
-		return $this->js->_post($url, $params, $responseElement, $jsCallback, NULL, $hasLoader,true);
904
+	public function post($url, $responseElement="", $params="{}", $jsCallback=NULL, $hasLoader=true) {
905
+		return $this->js->_post($url, $params, $responseElement, $jsCallback, NULL, $hasLoader, true);
906 906
 	}
907 907
 
908 908
 	/**
@@ -915,8 +915,8 @@  discard block
 block discarded – undo
915 915
 	 * @param string $jsCallback javascript code to execute after the request
916 916
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
917 917
 	 */
918
-	public function postDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL, $attr="id",$hasLoader=true) {
919
-		return $this->js->_post($url, $params, $responseElement, $jsCallback, $attr, $hasLoader,false);
918
+	public function postDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL, $attr="id", $hasLoader=true) {
919
+		return $this->js->_post($url, $params, $responseElement, $jsCallback, $attr, $hasLoader, false);
920 920
 	}
921 921
 
922 922
 	/**
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
931 931
 	 */
932 932
 	public function postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
933
-		return $this->js->_postOn($event, $element,  $url, $params, $responseElement, $parameters);
933
+		return $this->js->_postOn($event, $element, $url, $params, $responseElement, $parameters);
934 934
 	}
935 935
 
936 936
 	/**
@@ -954,8 +954,8 @@  discard block
 block discarded – undo
954 954
 	 * @param string $jsCallback javascript code to execute after the request
955 955
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
956 956
 	 */
957
-	public function postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL,$hasLoader=true) {
958
-		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, NULL, $hasLoader,true);
957
+	public function postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $hasLoader=true) {
958
+		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, NULL, $hasLoader, true);
959 959
 	}
960 960
 
961 961
 	/**
@@ -968,8 +968,8 @@  discard block
 block discarded – undo
968 968
 	 * @param string $attr the html attribute added to the request
969 969
 	 * @param boolean $hasLoader true for showing ajax loader. default : true
970 970
 	 */
971
-	public function postFormDeferred($url, $form, $responseElement, $validation=false, $jsCallback=NULL,$attr="id",$hasLoader=true) {
972
-		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader,false);
971
+	public function postFormDeferred($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true) {
972
+		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader, false);
973 973
 	}
974 974
 
975 975
 	/**
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
984 984
 	 */
985 985
 	public function postFormOn($event, $element, $url, $form, $responseElement="", $parameters=array()) {
986
-		return $this->js->_postFormOn($event,$element, $url, $form, $responseElement, $parameters);
986
+		return $this->js->_postFormOn($event, $element, $url, $form, $responseElement, $parameters);
987 987
 	}
988 988
 
989 989
 	/**
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 
1074 1074
 	public function setCDNs($cdns) {
1075 1075
 		if (is_array($cdns)===false) {
1076
-			$cdns=array (
1076
+			$cdns=array(
1077 1077
 					$cdns
1078 1078
 			);
1079 1079
 		}
@@ -1084,9 +1084,9 @@  discard block
 block discarded – undo
1084 1084
 		$hasJQuery=false;
1085 1085
 		$hasJQueryUI=false;
1086 1086
 		$hasBootstrap=false;
1087
-		$result=array ();
1088
-		foreach ( $this->cdns as $cdn ) {
1089
-			switch(get_class($cdn)) {
1087
+		$result=array();
1088
+		foreach ($this->cdns as $cdn) {
1089
+			switch (get_class($cdn)) {
1090 1090
 				case "Ajax\lib\CDNJQuery":
1091 1091
 					$hasJQuery=true;
1092 1092
 					$result[0]=$cdn;
@@ -1104,10 +1104,10 @@  discard block
 block discarded – undo
1104 1104
 		if ($hasJQuery===false) {
1105 1105
 			$result[0]=new CDNJQuery("x");
1106 1106
 		}
1107
-		if ($hasJQueryUI===false&&isset($this->_ui)) {
1107
+		if ($hasJQueryUI===false && isset($this->_ui)) {
1108 1108
 			$result[1]=new CDNGuiGen("x", $template);
1109 1109
 		}
1110
-		if ($hasBootstrap===false&&isset($this->_bootstrap)) {
1110
+		if ($hasBootstrap===false && isset($this->_bootstrap)) {
1111 1111
 			$result[2]=new CDNBootstrap("x");
1112 1112
 		}
1113 1113
 		ksort($result);
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 			$this->_setDi($di);
1122 1122
 		}
1123 1123
 	}
1124
-} else {
1124
+}else {
1125 1125
 	class JsUtils extends _JsUtils {
1126 1126
 
1127 1127
 		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 2 patches
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.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 
37 37
 	public function getTab($index) {
38
-		if ($index>0&&$index<sizeof($this->tabs))
39
-			return $this->tabs [$index];
38
+		if ($index>0&&$index<sizeof($this->tabs)) {
39
+					return $this->tabs [$index];
40
+		}
40 41
 	}
41 42
 
42 43
 	public function show($index) {
@@ -52,8 +53,9 @@  discard block
 block discarded – undo
52 53
 	 */
53 54
 	public function onShow($index, $jsCode) {
54 55
 		$tab=$this->getTab($index);
55
-		if (isset($tab))
56
-			return $tab->onShow($jsCode);
56
+		if (isset($tab)) {
57
+					return $tab->onShow($jsCode);
58
+		}
57 59
 	}
58 60
 
59 61
 	/**
@@ -64,8 +66,9 @@  discard block
 block discarded – undo
64 66
 	 */
65 67
 	public function onShown($index, $jsCode) {
66 68
 		$tab=$this->getTab($index);
67
-		if (isset($tab))
68
-			return $tab->onShown($jsCode);
69
+		if (isset($tab)) {
70
+					return $tab->onShown($jsCode);
71
+		}
69 72
 	}
70 73
 
71 74
 	/**
@@ -76,8 +79,9 @@  discard block
 block discarded – undo
76 79
 	 */
77 80
 	public function onHide($index, $jsCode) {
78 81
 		$tab=$this->getTab($index);
79
-		if (isset($tab))
80
-			return $tab->onShow($jsCode);
82
+		if (isset($tab)) {
83
+					return $tab->onShow($jsCode);
84
+		}
81 85
 	}
82 86
 
83 87
 	/**
@@ -88,7 +92,8 @@  discard block
 block discarded – undo
88 92
 	 */
89 93
 	public function onHidden($index, $jsCode) {
90 94
 		$tab=$this->getTab($index);
91
-		if (isset($tab))
92
-			return $tab->onShow($jsCode);
95
+		if (isset($tab)) {
96
+					return $tab->onShow($jsCode);
97
+		}
93 98
 	}
94 99
 }
95 100
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlAccordion.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		$this->setClass("panel-group");
20 20
 		$this->setRole("tablist");
21 21
 		$this->setProperty("aria-multiselectable", "true");
22
-		$this->content=array ();
22
+		$this->content=array();
23 23
 	}
24 24
 
25 25
 	public function addPanel($title, $content) {
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 	 * @param string $action a Phalcon action
46 46
 	 * @param $params The parameters to pass to the view
47 47
 	 */
48
-	public function renderContentPanel($title,$view, $controller, $action, $params=NULL) {
49
-		$template=$view->getRender($controller, $action, $params, function ($view) {
48
+	public function renderContentPanel($title, $view, $controller, $action, $params=NULL) {
49
+		$template=$view->getRender($controller, $action, $params, function($view) {
50 50
 			$view->setRenderLevel(View::LEVEL_ACTION_VIEW);
51 51
 		});
52 52
 		return $this->addPanel($title, $template);
@@ -59,19 +59,19 @@  discard block
 block discarded – undo
59 59
 	 * @param string $controller a Phalcon controller
60 60
 	 * @param string $action a Phalcon action
61 61
 	 */
62
-	public function forwardPanel($title,$initialController,$controller,$action){
63
-		$dispatcher = $initialController->dispatcher;
62
+	public function forwardPanel($title, $initialController, $controller, $action) {
63
+		$dispatcher=$initialController->dispatcher;
64 64
 		$dispatcher->setControllerName($controller);
65 65
 		$dispatcher->setActionName($action);
66 66
 		$dispatcher->dispatch();
67
-		$template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(),$dispatcher->getParams(), function ($view) {
67
+		$template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(), $dispatcher->getParams(), function($view) {
68 68
 			$view->setRenderLevel(View::LEVEL_ACTION_VIEW);
69 69
 		});
70 70
 		return $this->addPanel($title, $template);
71 71
 	}
72 72
 
73 73
 	public function run(JsUtils $js) {
74
-		foreach ( $this->content as $content ) {
74
+		foreach ($this->content as $content) {
75 75
 			$content->run($js);
76 76
 		}
77 77
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,8 @@
 block discarded – undo
77 77
 	}
78 78
 
79 79
 	public function getPanel($index) {
80
-		if ($index<sizeof($this->content))
81
-			return $this->content [$index];
80
+		if ($index<sizeof($this->content)) {
81
+					return $this->content [$index];
82
+		}
82 83
 	}
83 84
 }
84 85
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlAlert.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 
45 45
 	public function addCloseButton() {
46 46
 		$button=new HtmlButton("close-".$this->identifier);
47
-		$button->setProperties(array (
47
+		$button->setProperties(array(
48 48
 				"class" => "close",
49 49
 				"data-dismiss" => "alert",
50 50
 				"aria-label" => "close"
51 51
 		));
52 52
 		$button->setValue('<span aria-hidden="true">&times;</span>');
53
-		$this->addToPropertyCtrl("class", "alert-dismissible", array (
53
+		$this->addToPropertyCtrl("class", "alert-dismissible", array(
54 54
 				"alert-dismissible"
55 55
 		));
56 56
 		$this->button=$button;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::compile()
80 80
 	 */
81 81
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
82
-		if ($this->closeable&&$this->button==="") {
82
+		if ($this->closeable && $this->button==="") {
83 83
 			$this->addCloseButton();
84 84
 		}
85 85
 		return parent::compile($js, $view);
Please login to merge, or discard this patch.