main-sidebar.php 4.31 KB
<?php
use yii\widgets\Menu;
?>
<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <?php

        $items = [
            ['label' => 'Заказы', 'url' => ['/orders/index'], 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-shopping-cart"></i> <span>{label}</span></a>'],
            [
                'label' => 'eCommerce',
                'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-barcode"></i> <span>{label}</span></a>',
                'url' => ['/product/manage'],
                'items' => [
                    ['label' => 'Товары', 'url' => ['/product/manage']],
                    ['label' => 'Категории', 'url' => ['/category']],
                    ['label' => 'Бренды', 'url' => ['/brand']],
                    ['label' => 'Характеристики', 'url' => ['/rubrication/tax-group']],
                    ['label' => 'Единицы измерения', 'url' => ['/product/product-unit']],
                    ['label' => 'Статистика импорта', 'url' => ['/product/manage/import-stat']],
                ]
            ],
            [
                'label' => 'Слайдер/Банеры',
                'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-barcode"></i> <span>{label}</span></a>',
                'items' => [
                    ['label' => 'Слайдер', 'url' => ['/slider/index']],
                    ['label' => 'Банер', 'url' => ['/banner/index']],
                ]
            ],
            [
                'label' => 'Характеристики',
                'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>',
                'url' => ['/rubrication/tax-group'],
                'items' => [
                    ['label' => 'Характеристики', 'url' => ['/rubrication/tax-group']],
                    ['label' => 'Зависимости', 'url' => ['/relation/manage']]
                ]
            ],
            ['label' => 'Текстовые страницы', 'url' => ['/page/index']],
            ['label' => 'Статьи', 'url' => ['/articles/index']],
            ['label' => 'Акции', 'url' => ['/event/index']],
            [
                'label' => 'SEO',
                'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>',
                'items' => [
                    ['label' => 'URL', 'url' => ['/seo/index']],
                    ['label' => 'Шаблоны', 'url' => ['/seo-category/index']]
                ]
            ],
            ['label' => 'Фон', 'url' => ['/bg/index']],
            ['label' => 'Подписка', 'url' => ['/subscribe/index']],
            ['label' => 'Пользователи', 'url' => ['/customer/index']],
            ['label' => 'Группы пользователей', 'url' => ['/group/index']],
            [
                'label' => 'Настройка ролей',
                'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-search"></i> <span>{label}</span></a>',
                'items' => [
                    ['label' => 'Администраторы', 'url' => ['/user/index']],
                    ['label' => 'управление ролями', 'url' => ['/permit/access/role']],
                    ['label' => 'управление правами доступа', 'url' => ['/permit/access/permission']]
                ]
            ],



        ];


        if (Yii::$app->user->isGuest) {
            array_push($items,
                ['label' => 'Signup', 'url' => ['/admin/site/signup']], ['label' => 'Login', 'url' => ['/admin/site/login']]
            );
        } else {
            array_push($items,
                ['label' => 'Logout (' . Yii::$app->user->identity->username . ')','url'=>'/admin/site/logout']
            );
        }
        echo Menu::widget([
            'options' => ['class' => 'sidebar-menu'],
            'submenuTemplate' => "\n<ul class='treeview-menu'>\n{items}\n</ul>\n",

            'items' =>$items,

        ]);
        ?>
        <!-- sidebar menu: : style can be found in sidebar.less -->

    </section>
    <!-- /.sidebar -->
</aside>