From 84ab1891859fcb0701aa2a9bc619da77cd9430c4 Mon Sep 17 00:00:00 2001 From: Andrii Vasyliev Date: Mon, 19 Jun 2017 13:10:46 +0200 Subject: [PATCH] added GoToSiteMenu --- src/config/hisite.php | 11 +++++++++-- src/menus/GoToSiteMenu.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/menus/GoToSiteMenu.php diff --git a/src/config/hisite.php b/src/config/hisite.php index 81cd799..bd34f1f 100644 --- a/src/config/hisite.php +++ b/src/config/hisite.php @@ -19,12 +19,19 @@ 'container' => [ 'definitions' => [ \hiqdev\thememanager\menus\AbstractSidebarMenu::class => [ - 'add' => [ + 'add' => array_filter([ 'dashboard' => [ 'menu' => \hipanel\modules\dashboard\menus\SidebarMenu::class, 'where' => 'first', ], - ], + 'return-site' => empty($params['hipanel.siteUrl']) ? null : [ + 'menu' => [ + 'class' => \hipanel\modules\dashboard\menus\GoToSiteMenu::class, + 'url' => $params['hipanel.siteUrl'], + ], + 'where' => 'last', + ], + ]), ], ], ], diff --git a/src/menus/GoToSiteMenu.php b/src/menus/GoToSiteMenu.php new file mode 100644 index 0000000..8bed750 --- /dev/null +++ b/src/menus/GoToSiteMenu.php @@ -0,0 +1,30 @@ + [ + 'label' => Yii::t('hipanel:dashboard', 'Go to site'), + 'url' => $this->url, + 'icon' => 'fa-fw fa-home', + ], + ]; + } +}