Completed
Push — master ( b3a3fe...f04c22 )
by Jean-Christophe
04:06
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/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.
Ajax/bootstrap/html/HtmlBreadcrumbs.php 2 patches
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 		if(is_array($element)){
68 68
 			$elm=new HtmlLink("lnk-".$this->identifier."-".$size);
69 69
 			$elm->fromArray($element);
70
-		}else if($element instanceof HtmlLink){
70
+		} else if($element instanceof HtmlLink){
71 71
 			$elm=$element;
72
-		}else{
72
+		} else{
73 73
 			$elm=new HtmlLink("lnk-".$this->identifier."-".$size,$href,$element);
74 74
 			if(isset($glyph)){
75 75
 				$elm->wrapContentWithGlyph($glyph);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		}
117 117
 		if($this->absolutePaths===true){
118 118
 			return $this->_hrefFunction($this->content[$index]);
119
-		}else{
119
+		} else{
120 120
 			return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),0,$index+1));
121 121
 		}
122 122
 	}
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 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=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;
@@ -166,18 +166,18 @@  discard block
 block discarded – undo
166 166
 	 * @param string $targetSelector the target of the get
167 167
 	 * @return HtmlBreadcrumbs
168 168
 	 */
169
-	public function autoGetOnClick($targetSelector){
170
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
169
+	public function autoGetOnClick($targetSelector) {
170
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
171 171
 	}
172 172
 
173
-	public function contentAsString(){
174
-		if($this->autoActive){
173
+	public function contentAsString() {
174
+		if ($this->autoActive) {
175 175
 			$this->setActive();
176 176
 		}
177 177
 		return parent::contentAsString();
178 178
 	}
179 179
 
180
-	public function getElement($index){
180
+	public function getElement($index) {
181 181
 		return $this->content[$index];
182 182
 	}
183 183
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 * @param mixed $glyph
187 187
 	 * @param int $index
188 188
 	 */
189
-	public function addGlyph($glyph,$index=0){
189
+	public function addGlyph($glyph, $index=0) {
190 190
 		$elm=$this->getElement($index);
191 191
 		return $elm->wrapContentWithGlyph($glyph);
192 192
 	}
@@ -197,7 +197,7 @@  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(JsUtils $js,$dispatcher,$startIndex=0){
200
+	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) {
201 201
 		$this->startIndex=$startIndex;
202 202
 		return $this->addElements($js->fromDispatcher($dispatcher));
203 203
 	}
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
210 210
 	 */
211 211
 	public function setHrefFunction($_hrefFunction) {
212
-		$this->_hrefFunction = $_hrefFunction;
212
+		$this->_hrefFunction=$_hrefFunction;
213 213
 		return $this;
214 214
 	}
215 215
 
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.