@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | private function afterInsert($item) { |
63 | - if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
|
64 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
65 | - else { |
|
63 | + if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) { |
|
64 | + $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
65 | + } else { |
|
66 | 66 | $this->setSecondary(); |
67 | 67 | } |
68 | 68 | return $item; |
@@ -77,8 +77,9 @@ discard block |
||
77 | 77 | public function addItem($item) { |
78 | 78 | $number=$item; |
79 | 79 | $item=parent::addItem($this->getItemToInsert($item)); |
80 | - if(\is_int($number)) |
|
81 | - $item->setProperty("data-page", $number); |
|
80 | + if(\is_int($number)) { |
|
81 | + $item->setProperty("data-page", $number); |
|
82 | + } |
|
82 | 83 | return $this->afterInsert($item); |
83 | 84 | } |
84 | 85 | |
@@ -151,10 +152,11 @@ discard block |
||
151 | 152 | } |
152 | 153 | |
153 | 154 | public function setSecondary($value=true) { |
154 | - if($value) |
|
155 | - $this->addToProperty("class", "secondary"); |
|
156 | - else |
|
157 | - $this->removePropertyValue("class", "secondary"); |
|
155 | + if($value) { |
|
156 | + $this->addToProperty("class", "secondary"); |
|
157 | + } else { |
|
158 | + $this->removePropertyValue("class", "secondary"); |
|
159 | + } |
|
158 | 160 | return $this; |
159 | 161 | } |
160 | 162 | |
@@ -174,8 +176,9 @@ discard block |
||
174 | 176 | $this->apply(function (HtmlDoubleElement &$item) { |
175 | 177 | $item->setTagName("a"); |
176 | 178 | }); |
177 | - if ($vertical === true) |
|
178 | - $this->setVertical(); |
|
179 | + if ($vertical === true) { |
|
180 | + $this->setVertical(); |
|
181 | + } |
|
179 | 182 | return $this->addToProperty("class", "tabular"); |
180 | 183 | } |
181 | 184 | |
@@ -204,10 +207,11 @@ discard block |
||
204 | 207 | */ |
205 | 208 | public function fromDatabaseObject($object, $function) { |
206 | 209 | $return=$function($object); |
207 | - if (\is_array($return)) |
|
208 | - $this->addItems($return); |
|
209 | - else |
|
210 | - $this->addItem($return); |
|
210 | + if (\is_array($return)) { |
|
211 | + $this->addItems($return); |
|
212 | + } else { |
|
213 | + $this->addItem($return); |
|
214 | + } |
|
211 | 215 | } |
212 | 216 | |
213 | 217 | /** |
@@ -240,8 +244,9 @@ discard block |
||
240 | 244 | } |
241 | 245 | |
242 | 246 | public function run(JsUtils $js){ |
243 | - if($this->identifier!=="" && !isset($this->_bsComponent)) |
|
244 | - $this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false); |
|
247 | + if($this->identifier!=="" && !isset($this->_bsComponent)) { |
|
248 | + $this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false); |
|
249 | + } |
|
245 | 250 | $result= parent::run($js); |
246 | 251 | return $result->setItemSelector(".item"); |
247 | 252 | } |