@@ -87,6 +87,9 @@ |
||
| 87 | 87 | $this->addItem($function($object)); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + /** |
|
| 91 | + * @param \Closure $callBack |
|
| 92 | + */ |
|
| 90 | 93 | public function apply($callBack){ |
| 91 | 94 | foreach ($this->content as $item){ |
| 92 | 95 | $callBack($item); |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | $item=$itemO; |
| 58 | 58 | } |
| 59 | 59 | $item=parent::addItem($item); |
| 60 | - if(!$item instanceof HtmlMenu) |
|
| 61 | - $item->addToPropertyCtrl("class", "item",array("item")); |
|
| 62 | - else{ |
|
| 60 | + if(!$item instanceof HtmlMenu) { |
|
| 61 | + $item->addToPropertyCtrl("class", "item",array("item")); |
|
| 62 | + } else{ |
|
| 63 | 63 | $this->setSecondary(); |
| 64 | 64 | } |
| 65 | 65 | return $item; |
@@ -129,8 +129,9 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | public function asTab($vertical=false){ |
| 131 | 131 | $this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");}); |
| 132 | - if($vertical===true) |
|
| 133 | - $this->setVertical(); |
|
| 132 | + if($vertical===true) { |
|
| 133 | + $this->setVertical(); |
|
| 134 | + } |
|
| 134 | 135 | return $this->addToProperty("class", "tabular"); |
| 135 | 136 | } |
| 136 | 137 | |
@@ -156,10 +157,11 @@ discard block |
||
| 156 | 157 | */ |
| 157 | 158 | public function fromDatabaseObject($object, $function) { |
| 158 | 159 | $return=$function($object); |
| 159 | - if(\is_array($return)) |
|
| 160 | - $this->addItems($return); |
|
| 161 | - else |
|
| 162 | - $this->addItem($return); |
|
| 160 | + if(\is_array($return)) { |
|
| 161 | + $this->addItems($return); |
|
| 162 | + } else { |
|
| 163 | + $this->addItem($return); |
|
| 164 | + } |
|
| 163 | 165 | } |
| 164 | 166 | |
| 165 | 167 | /** |