Skip to content

Commit

Permalink
added GoToSiteMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jun 19, 2017
1 parent e854622 commit 84ab189
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/config/hisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
]),
],
],
],
Expand Down
30 changes: 30 additions & 0 deletions src/menus/GoToSiteMenu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/*
* Dashboard Plugin for HiPanel
*
* @link https://github.com/hiqdev/hipanel-module-dashboard
* @package hipanel-module-dashboard
* @license BSD-3-Clause
* @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
*/

namespace hipanel\modules\dashboard\menus;

use Yii;

class ReturnSiteMenu extends \hiqdev\yii2\menus\Menu
{
public $url;

public function items()
{
return [
'return-site' => [
'label' => Yii::t('hipanel:dashboard', 'Go to site'),
'url' => $this->url,
'icon' => 'fa-fw fa-home',
],
];
}
}

0 comments on commit 84ab189

Please sign in to comment.