<?php
    use yii\web\UrlManager;
    
    $homeLink = [];
    /**
     * @var UrlManager $urlManagerFrontend
     */
    if ($urlManagerFrontend = \Yii::$app->get('urlManagerFrontend', false)) {
        $homeLink = [
            [
                'label'    => \Yii::t('core', 'Go to site'),
                //'url'      => $urlManagerFrontend->createUrl([ 'site/index' ]),
		'url'      => '/',

                'template' => '<a href="{url}" target="_blank"><b class="site"></b><span>{label}</span>{badge}</a>',
                'options'  => [
                    'class' => 'homepage_link',
                ],
            ],
        ];
    }
    return array_merge(
        $homeLink,
        [
            [
                'label'  => \Yii::t('core', 'Main'),
                'url'    => [ '/site/index' ],
                'active' => function () {
                    return \Yii::$app->controller->id === 'site';
                },
                'template' => '<a href="{url}"><b class="home"></b><span>{label}</span>{badge}</a>',
            ],
            [
                'label' => \Yii::t('core', 'Pages'),
                'url'   => '#',
                'template' => '<a href="#"><b class="static"></b><span>{label}</span>{badge}</a>',
                'items' => [
                    [
                        'label'  => \Yii::t('core', 'Pages'),
                        'url'    => [ '/page/index' ],
    
                    ],
                    [
                        'label'  => \Yii::t('core', 'Categories'),
                        'url'    => [ '/page-category/index' ],
    
                    ],
                    [
                        'label'  => \Yii::t('core', 'Gallery'),
                        'url'    => [ '/gallery/index' ],

                    ],
                    [
                        'label'  => \Yii::t('core', 'Partner'),
                        'url'    => [ '/partner/index' ],

                    ],
                ],
            ],
            
            
            
            
            [
                'label' => \Yii::t('core', 'SEO'),
                'url'   => '#',
                'template' => '<a href="#"><b class="seo"></b><span>{label}</span>{badge}</a>',
                'items' => [
                    [
                        'label' => \Yii::t('core', 'Seo pages'),
                        'url'   => [ '/seo/alias/index' ],
                        'icon'  => 'file-text',
                    ],
                    [
                        'label' => \Yii::t('core', 'Robots'),
                        'url'   => [ '/seo/settings/robots' ],
                        'icon'  => 'android',
                    ],
                    [
                        'label' => \Yii::t('core', 'Sitemap'),
                        'url'   => [ '/seo/sitemap/index' ],
                        'icon'  => 'map-signs',
                    ],
                ],
            ],
            [
                'label' => \Yii::t('app', 'Blog'),
                'url'   => '#',
                'template' => '<a href="#"><b class="blog"></b><span>{label}</span>{badge}</a>',
                'items' => [
                    [
                        'label' => \Yii::t('core', 'Articles'),
                        'url'   => [ '/blog-article/index' ],
                        'icon'  => 'file-text',
                    ],
                    [
                        'label' => \Yii::t('core', 'Categories'),
                        'url'   => [ '/blog-category/index' ],
                        'icon'  => 'book',
                    ],
                    [
                        'label' => \Yii::t('core', 'Tags'),
                        'url'   => [ '/blog-tag/index' ],
                        'icon'  => 'tag',
                    ],
                ],
            ],
            [
                'label' => \Yii::t('app', 'Event'),
                'url'   => '#',
                'template' => '<a href="#"><b class="blog"></b><span>{label}</span>{badge}</a>',
                'items' => [
                    [
                        'label' => \Yii::t('core', 'Articles'),
                        'url'   => [ '/event/index' ],
                        'icon'  => 'file-text',
                    ],
                    [
                        'label' => \Yii::t('core', 'Tags'),
                        'url'   => [ '/event-tag/index' ],
                        'icon'  => 'tag',
                    ],
                ],
            ],
            [
                'label' => \Yii::t('app', 'Настройки'),
                'url'   => [ '/settings' ],
                'icon'  => 'address-card-o',
                'template' => '<a href="{url}"><b class="settings"></b><span>{label}</span>{badge}</a>',
                'active' => function () {
                    return \Yii::$app->controller->id === 'settings';
                },
            ],

            [
                'label'  => \Yii::t('app', 'Slides'),
                'url'    => [ '/slide/index' ],
                'icon'   => 'file-image-o',
                'active' => function () {
                    return \Yii::$app->controller->id === 'slider';
                },
                'template' => '<a href="{url}"><b class="slider"></b><span>{label}</span>{badge}</a>',
            ],
        ]
    );