@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | private function afterInsert($item) { |
| 61 | - if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
|
| 62 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 63 | - else { |
|
| 61 | + if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) { |
|
| 62 | + $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 63 | + } else { |
|
| 64 | 64 | $this->setSecondary(); |
| 65 | 65 | } |
| 66 | 66 | return $item; |
@@ -146,10 +146,11 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | public function setSecondary($value=true) { |
| 149 | - if($value) |
|
| 150 | - $this->addToProperty("class", "secondary"); |
|
| 151 | - else |
|
| 152 | - $this->removePropertyValue("class", "secondary"); |
|
| 149 | + if($value) { |
|
| 150 | + $this->addToProperty("class", "secondary"); |
|
| 151 | + } else { |
|
| 152 | + $this->removePropertyValue("class", "secondary"); |
|
| 153 | + } |
|
| 153 | 154 | } |
| 154 | 155 | |
| 155 | 156 | public function setVertical() { |
@@ -168,8 +169,9 @@ discard block |
||
| 168 | 169 | $this->apply(function (HtmlDoubleElement &$item) { |
| 169 | 170 | $item->setTagName("a"); |
| 170 | 171 | }); |
| 171 | - if ($vertical === true) |
|
| 172 | - $this->setVertical(); |
|
| 172 | + if ($vertical === true) { |
|
| 173 | + $this->setVertical(); |
|
| 174 | + } |
|
| 173 | 175 | return $this->addToProperty("class", "tabular"); |
| 174 | 176 | } |
| 175 | 177 | |
@@ -198,10 +200,11 @@ discard block |
||
| 198 | 200 | */ |
| 199 | 201 | public function fromDatabaseObject($object, $function) { |
| 200 | 202 | $return=$function($object); |
| 201 | - if (\is_array($return)) |
|
| 202 | - $this->addItems($return); |
|
| 203 | - else |
|
| 204 | - $this->addItem($return); |
|
| 203 | + if (\is_array($return)) { |
|
| 204 | + $this->addItems($return); |
|
| 205 | + } else { |
|
| 206 | + $this->addItem($return); |
|
| 207 | + } |
|
| 205 | 208 | } |
| 206 | 209 | |
| 207 | 210 | /** |
@@ -17,12 +17,15 @@ discard block |
||
| 17 | 17 | parent::__construct($identifier, "a"); |
| 18 | 18 | $this->setClass("item"); |
| 19 | 19 | $this->setContent($content); |
| 20 | - if($value!==NULL) |
|
| 21 | - $this->setData($value); |
|
| 22 | - if($image!==NULL) |
|
| 23 | - $this->asMiniAvatar($image); |
|
| 24 | - if($description!==NULL) |
|
| 25 | - $this->setDescription($description); |
|
| 20 | + if($value!==NULL) { |
|
| 21 | + $this->setData($value); |
|
| 22 | + } |
|
| 23 | + if($image!==NULL) { |
|
| 24 | + $this->asMiniAvatar($image); |
|
| 25 | + } |
|
| 26 | + if($description!==NULL) { |
|
| 27 | + $this->setDescription($description); |
|
| 28 | + } |
|
| 26 | 29 | } |
| 27 | 30 | |
| 28 | 31 | public function setDescription($description){ |
@@ -39,8 +42,9 @@ discard block |
||
| 39 | 42 | |
| 40 | 43 | public function asOption(){ |
| 41 | 44 | $this->tagName="option"; |
| 42 | - if($this->getProperty("data-value")!==null) |
|
| 43 | - $this->setProperty("value", $this->getProperty("data-value")); |
|
| 45 | + if($this->getProperty("data-value")!==null) { |
|
| 46 | + $this->setProperty("value", $this->getProperty("data-value")); |
|
| 47 | + } |
|
| 44 | 48 | } |
| 45 | 49 | |
| 46 | 50 | /** |
@@ -47,8 +47,9 @@ |
||
| 47 | 47 | if($item instanceof HtmlSemDoubleElement){ |
| 48 | 48 | $comp=$item->compile($js); |
| 49 | 49 | $bs=$item->run($js); |
| 50 | - if(isset($bs)) |
|
| 51 | - $this->params['onShow']=$bs->getScript(); |
|
| 50 | + if(isset($bs)) { |
|
| 51 | + $this->params['onShow']=$bs->getScript(); |
|
| 52 | + } |
|
| 52 | 53 | $item=$comp; |
| 53 | 54 | } |
| 54 | 55 | }); |