@@ -49,8 +49,9 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function setStyle($value) { |
| 52 | - foreach ( $this->elements as $element ) |
|
| 53 | - $element->setStyle($value); |
|
| 52 | + foreach ( $this->elements as $element ) { |
|
| 53 | + $element->setStyle($value); |
|
| 54 | + } |
|
| 54 | 55 | } |
| 55 | 56 | |
| 56 | 57 | private function dropdownAsButton($bt) { |
@@ -76,23 +77,25 @@ discard block |
||
| 76 | 77 | } elseif (is_string($element)) { |
| 77 | 78 | $result=new HtmlButton($this->identifier."-button-".$iid,$element); |
| 78 | 79 | } |
| 79 | - if($result instanceof HtmlButton) |
|
| 80 | - $this->elements[]=$result; |
|
| 80 | + if($result instanceof HtmlButton) { |
|
| 81 | + $this->elements[]=$result; |
|
| 82 | + } |
|
| 81 | 83 | return $result; |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | 86 | private function _addArrayElement(array $element,int $iid){ |
| 85 | - if (array_key_exists("glyph", $element)) |
|
| 86 | - $bt=new HtmlGlyphButton($this->identifier."-button-".$iid); |
|
| 87 | - elseif (array_key_exists("btnCaption", $element)) { |
|
| 88 | - if (array_key_exists("split", $element)) |
|
| 89 | - $bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid); |
|
| 90 | - else{ |
|
| 87 | + if (array_key_exists("glyph", $element)) { |
|
| 88 | + $bt=new HtmlGlyphButton($this->identifier."-button-".$iid); |
|
| 89 | + } elseif (array_key_exists("btnCaption", $element)) { |
|
| 90 | + if (array_key_exists("split", $element)) { |
|
| 91 | + $bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid); |
|
| 92 | + } else{ |
|
| 91 | 93 | $bt=new HtmlDropdown($this->identifier."-dropdown-".$iid); |
| 92 | 94 | $this->dropdownAsButton($bt); |
| 93 | 95 | } |
| 94 | - } else |
|
| 95 | - $bt=new HtmlButton($this->identifier."-button-".$iid); |
|
| 96 | + } else { |
|
| 97 | + $bt=new HtmlButton($this->identifier."-button-".$iid); |
|
| 98 | + } |
|
| 96 | 99 | $bt->fromArray($element); |
| 97 | 100 | return $bt; |
| 98 | 101 | } |
@@ -115,8 +118,9 @@ discard block |
||
| 115 | 118 | public function setAlignment($value) { |
| 116 | 119 | if (is_int($value)) { |
| 117 | 120 | $value=CssRef::alignment("btn-group")[$value]; |
| 118 | - } else |
|
| 119 | - $value="btn-group-".$value; |
|
| 121 | + } else { |
|
| 122 | + $value="btn-group-".$value; |
|
| 123 | + } |
|
| 120 | 124 | if (strstr($value, "justified")) { |
| 121 | 125 | foreach ( $this->elements as $element ) { |
| 122 | 126 | $element->wrap('<div class="btn-group" role="group">', '</div>'); |
@@ -131,9 +135,9 @@ discard block |
||
| 131 | 135 | * @return HtmlButton |
| 132 | 136 | */ |
| 133 | 137 | public function getElement($index) { |
| 134 | - if (is_int($index)) |
|
| 135 | - return $this->elements[$index]; |
|
| 136 | - else { |
|
| 138 | + if (is_int($index)) { |
|
| 139 | + return $this->elements[$index]; |
|
| 140 | + } else { |
|
| 137 | 141 | $elm=$this->getElementById($index, $this->elements); |
| 138 | 142 | return $elm; |
| 139 | 143 | } |