Completed
Push — master ( 525ea5...e3c757 )
by Jean-Christophe
03:48
created
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/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/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
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.
Spacing   +6 added lines, -6 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 $viewName
46 46
 	 * @param $params The parameters to pass to the view
47 47
 	 */
48
-	public function renderViewPanel(JsUtils $js,$title,$initialController, $viewName, $params=array()) {
49
-		return $this->addPanel($title, $js->renderContent($initialController, $viewName,$params));
48
+	public function renderViewPanel(JsUtils $js, $title, $initialController, $viewName, $params=array()) {
49
+		return $this->addPanel($title, $js->renderContent($initialController, $viewName, $params));
50 50
 	}
51 51
 
52 52
 		/**
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 	 * @param string $action a Phalcon action
59 59
 	 * @param array $params
60 60
 	 */
61
-	public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){
62
-		return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params));
61
+	public function forwardPanel(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) {
62
+		return $this->addPanel($title, $js->forward($initialController, $controller, $action, $params));
63 63
 	}
64 64
 
65 65
 	public function run(JsUtils $js) {
66
-		foreach ( $this->content as $content ) {
66
+		foreach ($this->content as $content) {
67 67
 			$content->run($js);
68 68
 		}
69 69
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlButton.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @return \Ajax\bootstrap\html\HtmlButton
72 72
 	 */
73 73
 	public function setActive() {
74
-		return $this->addToPropertyCtrl("class", "active", array (
74
+		return $this->addToPropertyCtrl("class", "active", array(
75 75
 				"active"
76 76
 		));
77 77
 	}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @return \Ajax\bootstrap\html\HtmlButton
82 82
 	 */
83 83
 	public function setDisabled() {
84
-		return $this->addToPropertyCtrl("class", "disabled", array (
84
+		return $this->addToPropertyCtrl("class", "disabled", array(
85 85
 				"disabled"
86 86
 		));
87 87
 	}
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function fromArray($array) {
111 111
 		$array=parent::fromArray($array);
112
-		foreach ( $array as $key => $value ) {
112
+		foreach ($array as $key => $value) {
113 113
 			$this->setProperty($key, $value);
114 114
 		}
115 115
 		return $array;
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlButtongroups.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @return HtmlButtongroups default : ""
35 35
 	 */
36 36
 	public function setSize($size) {
37
-		foreach ( $this->elements as $element ) {
37
+		foreach ($this->elements as $element) {
38 38
 			$element->setSize($size);
39 39
 		}
40 40
 		if (is_int($size)) {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	public function setStyle($value) {
47
-		foreach ( $this->elements as $element )
47
+		foreach ($this->elements as $element)
48 48
 			$element->setStyle($value);
49 49
 	}
50 50
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	public function addElement($element) {
65 65
 		$result=$element;
66 66
 		$iid=sizeof($this->elements)+1;
67
-		if (($element instanceof HtmlDropdown)||($element instanceof HtmlSplitbutton)) {
67
+		if (($element instanceof HtmlDropdown) || ($element instanceof HtmlSplitbutton)) {
68 68
 			$this->addExistingDropDown($element);
69 69
 			$this->elements[]=$element;
70 70
 		} elseif ($element instanceof HtmlButton) {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 				else
79 79
 					$bt=new HtmlDropdown($this->identifier."-dropdown-".$iid);
80 80
 				$this->dropdownAsButton($bt);
81
-			} else
81
+			}else
82 82
 				$bt=new HtmlButton($this->identifier."-button-".$iid);
83 83
 			$bt->fromArray($element);
84 84
 			$this->elements[]=$bt;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 
95 95
 	public function addElements($elements) {
96
-		foreach ( $elements as $element ) {
96
+		foreach ($elements as $element) {
97 97
 			$this->addElement($element);
98 98
 		}
99 99
 		return $this;
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 	public function setAlignment($value) {
111 111
 		if (is_int($value)) {
112 112
 			$value=CssRef::alignment("btn-group")[$value];
113
-		} else
113
+		}else
114 114
 			$value="btn-group-".$value;
115 115
 		if (strstr($value, "justified")) {
116
-			foreach ( $this->elements as $element ) {
116
+			foreach ($this->elements as $element) {
117 117
 				$element->wrap('<div class="btn-group" role="group">', '</div>');
118 118
 			}
119 119
 		}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
145 145
 	 */
146 146
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
147
-		foreach ( $this->elements as $element ) {
147
+		foreach ($this->elements as $element) {
148 148
 			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
149 149
 		}
150 150
 		return $this;
Please login to merge, or discard this patch.
Braces   +20 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,8 +44,9 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	public function setStyle($value) {
47
-		foreach ( $this->elements as $element )
48
-			$element->setStyle($value);
47
+		foreach ( $this->elements as $element ) {
48
+					$element->setStyle($value);
49
+		}
49 50
 	}
50 51
 
51 52
 	private function dropdownAsButton($bt) {
@@ -70,16 +71,18 @@  discard block
 block discarded – undo
70 71
 		} elseif ($element instanceof HtmlButton) {
71 72
 			$this->elements[]=$element;
72 73
 		} elseif (is_array($element)) {
73
-			if (array_key_exists("glyph", $element))
74
-				$bt=new HtmlGlyphButton($this->identifier."-button-".$iid);
75
-			elseif (array_key_exists("btnCaption", $element)) {
76
-				if (array_key_exists("split", $element))
77
-					$bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid);
78
-				else
79
-					$bt=new HtmlDropdown($this->identifier."-dropdown-".$iid);
74
+			if (array_key_exists("glyph", $element)) {
75
+							$bt=new HtmlGlyphButton($this->identifier."-button-".$iid);
76
+			} elseif (array_key_exists("btnCaption", $element)) {
77
+				if (array_key_exists("split", $element)) {
78
+									$bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid);
79
+				} else {
80
+									$bt=new HtmlDropdown($this->identifier."-dropdown-".$iid);
81
+				}
80 82
 				$this->dropdownAsButton($bt);
81
-			} else
82
-				$bt=new HtmlButton($this->identifier."-button-".$iid);
83
+			} else {
84
+							$bt=new HtmlButton($this->identifier."-button-".$iid);
85
+			}
83 86
 			$bt->fromArray($element);
84 87
 			$this->elements[]=$bt;
85 88
 			$result=$bt;
@@ -110,8 +113,9 @@  discard block
 block discarded – undo
110 113
 	public function setAlignment($value) {
111 114
 		if (is_int($value)) {
112 115
 			$value=CssRef::alignment("btn-group")[$value];
113
-		} else
114
-			$value="btn-group-".$value;
116
+		} else {
117
+					$value="btn-group-".$value;
118
+		}
115 119
 		if (strstr($value, "justified")) {
116 120
 			foreach ( $this->elements as $element ) {
117 121
 				$element->wrap('<div class="btn-group" role="group">', '</div>');
@@ -126,9 +130,9 @@  discard block
 block discarded – undo
126 130
 	 * @return HtmlButton
127 131
 	 */
128 132
 	public function getElement($index) {
129
-		if (is_int($index))
130
-			return $this->elements[$index];
131
-		else {
133
+		if (is_int($index)) {
134
+					return $this->elements[$index];
135
+		} else {
132 136
 			$elm=$this->getElementById($index, $this->elements);
133 137
 			return $elm;
134 138
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlButtontoolbar.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	public function addElement($element) {
24 24
 		if ($element instanceof HtmlButtongroups) {
25 25
 			$this->elements []=$element;
26
-		} else {
26
+		}else {
27 27
 			$this->getLastButtonGroup()->addElement($element);
28 28
 		}
29 29
 	}
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
 		$element=null;
79 79
 		$i=0;
80 80
 		if (is_int($index)) {
81
-			$elements=array ();
82
-			foreach ( $this->elements as $group ) {
81
+			$elements=array();
82
+			foreach ($this->elements as $group) {
83 83
 				$elements=array_merge($elements, $group->getElements());
84 84
 			}
85 85
 			if ($index<sizeof($elements)) {
86 86
 				$element=$elements [$index];
87 87
 			}
88
-		} else {
89
-			while ( $element==null&&$i<sizeof($this->elements) ) {
88
+		}else {
89
+			while ($element==null && $i<sizeof($this->elements)) {
90 90
 				$element=$this->elements [$i]->getElement($index);
91 91
 				$i++;
92 92
 			}
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	private function getLastButtonGroup() {
47 47
 		$nb=sizeof($this->elements);
48
-		if ($nb>0)
49
-			$bg=$this->elements [$nb-1];
50
-		else {
48
+		if ($nb>0) {
49
+					$bg=$this->elements [$nb-1];
50
+		} else {
51 51
 			$bg=new HtmlButtongroups($this->identifier."-buttongroups-".$nb);
52 52
 			$this->elements []=$bg;
53 53
 		}
@@ -65,8 +65,9 @@  discard block
 block discarded – undo
65 65
 	public function getLastGroup() {
66 66
 		$bg=null;
67 67
 		$nb=sizeof($this->elements);
68
-		if ($nb>0)
69
-			$bg=$this->elements [$nb-1];
68
+		if ($nb>0) {
69
+					$bg=$this->elements [$nb-1];
70
+		}
70 71
 		return $bg;
71 72
 	}
72 73
 
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlCarousel.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
  * @version 1.001
17 17
  */
18 18
 class HtmlCarousel extends BaseHtml {
19
-	protected $indicators=array ();
20
-	protected $slides=array ();
19
+	protected $indicators=array();
20
+	protected $slides=array();
21 21
 	protected $leftControl="";
22 22
 	protected $rightControl="";
23 23
 	protected $_base="";
24
-	protected $_glyphs=array ();
24
+	protected $_glyphs=array();
25 25
 
26 26
 	public function __construct($identifier, $images=NULL) {
27 27
 		parent::__construct($identifier);
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	}
39 39
 
40 40
 	public function setBase($_base) {
41
-		foreach ($this->slides as $slide){
41
+		foreach ($this->slides as $slide) {
42 42
 			$imgSrc=$slide->getImageSrc();
43 43
 			$slide->setImageSrc(str_replace($this->_base.$imgSrc, $_base.$imgSrc, $imgSrc));
44 44
 		}
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 
95 95
 	public function addImage($imageSrc, $imageAlt="", $caption=NULL, $description=NULL) {
96
-		if(is_array($imageSrc)){
97
-			$this->addImage($imageSrc[0],@$imageSrc[1],@$imageSrc[2],@$imageSrc[3]);
98
-		}else{
96
+		if (is_array($imageSrc)) {
97
+			$this->addImage($imageSrc[0], @$imageSrc[1], @$imageSrc[2], @$imageSrc[3]);
98
+		}else {
99 99
 			$image=new HtmlCarouselItem("item-".$this->identifier);
100 100
 			$image->setImageSrc($this->_base.$imageSrc);
101 101
 			$image->setImageAlt($imageAlt);
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function fromArray($array) {
120 120
 		if (is_array($array) && sizeof($array)>0) {
121
-			foreach ( $array as $value ) {
121
+			foreach ($array as $value) {
122 122
 				if (is_array($value)) {
123 123
 					$this->addImage($value ["src"], @$value ["alt"], @$value ["caption"], @$value ["description"]);
124
-				} else {
124
+				}else {
125 125
 					$this->addImage($value);
126 126
 				}
127 127
 			}
Please login to merge, or discard this patch.
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,27 +75,30 @@
 block discarded – undo
75 75
 	}
76 76
 
77 77
 	private function getGlyph($sens="left") {
78
-		if (array_key_exists($sens, $this->_glyphs))
79
-			return $this->_glyphs [$sens];
78
+		if (array_key_exists($sens, $this->_glyphs)) {
79
+					return $this->_glyphs [$sens];
80
+		}
80 81
 		return "glyphicon-chevron-".$sens;
81 82
 	}
82 83
 
83 84
 	public function setRightGlyph($glyphicon) {
84 85
 		$glyphs=CssRef::glyphIcons();
85
-		if (array_search($glyphicon, $glyphs)!==false)
86
-			$this->_glyphs ["right"]=$glyphicon;
86
+		if (array_search($glyphicon, $glyphs)!==false) {
87
+					$this->_glyphs ["right"]=$glyphicon;
88
+		}
87 89
 	}
88 90
 
89 91
 	public function setLeftGlyph($glyphicon) {
90 92
 		$glyphs=CssRef::glyphIcons();
91
-		if (array_search($glyphicon, $glyphs)!==false)
92
-			$this->_glyphs ["left"]=$glyphicon;
93
+		if (array_search($glyphicon, $glyphs)!==false) {
94
+					$this->_glyphs ["left"]=$glyphicon;
95
+		}
93 96
 	}
94 97
 
95 98
 	public function addImage($imageSrc, $imageAlt="", $caption=NULL, $description=NULL) {
96 99
 		if(is_array($imageSrc)){
97 100
 			$this->addImage($imageSrc[0],@$imageSrc[1],@$imageSrc[2],@$imageSrc[3]);
98
-		}else{
101
+		} else{
99 102
 			$image=new HtmlCarouselItem("item-".$this->identifier);
100 103
 			$image->setImageSrc($this->_base.$imageSrc);
101 104
 			$image->setImageAlt($imageAlt);
Please login to merge, or discard this patch.