<?php

/*
 * This file is part of the Dektrium project
 *
 * (c) Dektrium project <http://github.com/dektrium>
 *
 * For the full copyright and license information, please view the LICENSE.md
 * file that was distributed with this source code.
 */

use yii\bootstrap\Nav;
use yii\widgets\Menu;

?>

<?php /*echo Nav::widget([
    'options' => [
        'class' => 'nav-tabs',
        'style' => 'margin-bottom: 15px',
    ],
    'items' => [
        [
            'label'   => Yii::t('user', 'Users'),
            'url'     => ['/user/admin/index'],
        ],
        [
            'label'   => Yii::t('user', 'Roles'),
            'url'     => ['/rbac/role/index'],
            'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
        ],
        [
            'label' => Yii::t('user', 'Permissions'),
            'url'   => ['/rbac/permission/index'],
            'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
        ],
        [
            'label' => Yii::t('user', 'Create'),
            'items' => [
                [
                    'label'   => Yii::t('user', 'New user'),
                    'url'     => ['/user/admin/create'],
                ],
                [
                    'label' => Yii::t('user', 'New role'),
                    'url'   => ['/rbac/role/create'],
                    'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
                ],
                [
                    'label' => Yii::t('user', 'New permission'),
                    'url'   => ['/rbac/permission/create'],
                    'visible' => isset(Yii::$app->extensions['dektrium/yii2-rbac']),
                ],
            ],
        ],
    ],
]) */?>
<?php
$items = [];
$items[] = ['label' => Yii::t('app', 'Cabinet'),  'url' => ['/cabinet'], 'active' => in_array(Yii::$app->controller->id, ['cabinet', 'cancellations'])];

if(Yii::$app->user->can('admin')){
    $items[] = ['label' => Yii::t('app', 'Lots ID'), 'url' => ['/lots/index'], 'active' => in_array(Yii::$app->controller->id,  ['lots', 'cancellations'])];
}
$items[] = ['label' => Yii::t('app', 'Auctions'),  'url' => ['/auctions/index'], 'active' => in_array(Yii::$app->controller->id, ['auctions', 'cancellations'])];

Yii::$app->user->can('admin') ? $url = '/bidding/index' : $url = '/bidding/view';
$items[] = ['label' => Yii::t('app', 'Bidding ID'),  'url' => [$url], 'active' => in_array(Yii::$app->controller->id, ['bidding', 'cancellations'])];

?>


