diff --git a/zin/wg/nav/v1.php b/zin/wg/nav/v1.php index 83527ec3e0..fc80475202 100755 --- a/zin/wg/nav/v1.php +++ b/zin/wg/nav/v1.php @@ -9,11 +9,10 @@ class nav extends wg public function onBuildItem($item) { - if(!($item instanceof item)) $item = item(set($item)); return actionItem ( set('name', 'nav'), - inherit($item) + inherit($item instanceof item ? $item : (item(set($item)))) ); } diff --git a/zin/wg/toolbar/v1.php b/zin/wg/toolbar/v1.php index 2d8ad4ba57..8e4d5f1771 100644 --- a/zin/wg/toolbar/v1.php +++ b/zin/wg/toolbar/v1.php @@ -7,10 +7,13 @@ class toolbar extends wg protected function onBuildItem($item) { - if (isset($item['type']) && $item['type'] === 'divider') return div()->addClass('toolbar-divider'); + $item = ($item instanceof item) ? $item : (item(set($item))); + $type = $item->prop('type'); - if(!($item instanceof item)) $item = item(set($item)); - return btn( + if($type === 'divider') return div(setClass('toolbar-divider')); + + return btn + ( setClass('toolbar-item'), inherit($item) ); @@ -19,7 +22,8 @@ class toolbar extends wg protected function build() { $items = $this->prop('items'); - return div( + return div + ( setClass('toolbar'), set($this->props->skip(array_keys(static::getDefinedProps()))), is_array($items) ? array_map(array($this, 'onBuildItem'), $items) : null,