|
|
|
@ -15,7 +15,8 @@ $model = new SearchForm();
|
|
|
|
|
<!-- Sidebar user panel --> |
|
|
|
|
<div class="user-panel"> |
|
|
|
|
<div class="pull-left image"> |
|
|
|
|
<img src="<?= Yii::$app->avatar->show(Yii::$app->user->identity->user->username) ?>" class="img-circle" alt="<?= Yii::$app->user->identity->user->username ?>"/>
|
|
|
|
|
<img src="<?= Yii::$app->avatar->show(Yii::$app->user->identity->user->username) ?>" class="img-circle"
|
|
|
|
|
alt="<?= Yii::$app->user->identity->user->username ?>"/>
|
|
|
|
|
</div> |
|
|
|
|
<div class="pull-left info"> |
|
|
|
|
<p><?= Yii::$app->user->identity->user->username ?></p>
|
|
|
|
@ -61,7 +62,8 @@ $model = new SearchForm();
|
|
|
|
|
'label' => Yii::t('dashboard', 'Dashboard'), |
|
|
|
|
'icon' => 'dashboard', |
|
|
|
|
'url' => ['/site/index'], |
|
|
|
|
'active' => $this->context->id == '/site/index'], |
|
|
|
|
'active' => $this->context->id == '/site/index' |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('user', 'Users'), |
|
|
|
@ -71,22 +73,53 @@ $model = new SearchForm();
|
|
|
|
|
'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('UserManagement'), |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
['label' => Yii::t('user', 'Access Rules'), 'icon' => 'lock', 'items' => [ |
|
|
|
|
['label' => Yii::t('user', 'Roles'), 'icon' => 'caret-right', 'url' => ['/role/index'], 'active' => \Yii::$app->controller->getUniqueId() == 'role'], |
|
|
|
|
['label' => Yii::t('user', 'Permissions'), 'icon' => 'caret-right', 'url' => ['/permission/index'], 'active' => \Yii::$app->controller->getUniqueId() == 'permission'], |
|
|
|
|
], 'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('UserManagement')], |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('user', 'Access Rules'), |
|
|
|
|
'icon' => 'lock', |
|
|
|
|
'items' => [ |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('user', 'Roles'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/role/index'], |
|
|
|
|
'active' => \Yii::$app->controller->getUniqueId() == 'role' |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('user', 'Permissions'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/permission/index'], |
|
|
|
|
'active' => \Yii::$app->controller->getUniqueId() == 'permission' |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('UserManagement') |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('menu', 'Menu'), |
|
|
|
|
'icon' => 'bars', 'url' => ['/menu/index'], |
|
|
|
|
'icon' => 'bars', |
|
|
|
|
'url' => ['/menu/index'], |
|
|
|
|
'active' => $this->context->id == 'menu', |
|
|
|
|
'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('MenuManagement'), |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
['label' => Yii::t('main', 'Modules'), 'icon' => 'cubes', 'items' => [ |
|
|
|
|
['label' => Yii::t('main', 'Modules'), 'icon' => 'caret-right', 'url' => ['/module/list'], 'active' => \Yii::$app->controller->action->getUniqueId() == 'module/list'], |
|
|
|
|
['label' => Yii::t('main', 'Find modules'), 'icon' => 'caret-right', 'url' => ['/module/search'], 'active' => \Yii::$app->controller->action->getUniqueId() == 'module/search'], |
|
|
|
|
], 'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('ModuleManagement')], |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('main', 'Modules'), |
|
|
|
|
'icon' => 'cubes', |
|
|
|
|
'items' => [ |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('main', 'Modules'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/module/list'], |
|
|
|
|
'active' => \Yii::$app->controller->action->getUniqueId() == 'module/list' |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('main', 'Find modules'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/module/search'], |
|
|
|
|
'active' => \Yii::$app->controller->action->getUniqueId() == 'module/search' |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('ModuleManagement') |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
/*[ |
|
|
|
|
'label' => Yii::t('pages', 'Pages'), |
|
|
|
@ -95,31 +128,80 @@ $model = new SearchForm();
|
|
|
|
|
'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('PagesManagement'), |
|
|
|
|
],*/ |
|
|
|
|
|
|
|
|
|
['label' => Yii::t('post', 'Posts'), 'icon' => 'newspaper-o', 'items' => array_merge( |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('post', 'Posts'), |
|
|
|
|
'icon' => 'newspaper-o', |
|
|
|
|
'items' => array_merge( |
|
|
|
|
array_map(function (\core\entities\post\PostType $type) { |
|
|
|
|
return ['label' => $type->plural, 'icon' => 'caret-right', 'items' => [ |
|
|
|
|
['label' => Yii::t('post', 'Categories'), 'icon' => 'caret-right', 'url' => ['/post/category', 'tid' => $type->id], 'active' => \Yii::$app->controller->getUniqueId() == 'post/category' && \Yii::$app->request->get('tid') == $type->id], |
|
|
|
|
['label' => $type->plural, 'icon' => 'caret-right', 'url' => ['/post/post', 'tid' => $type->id], 'active' => \Yii::$app->controller->getUniqueId() == 'post/post' && \Yii::$app->request->get('tid') == $type->id], |
|
|
|
|
['label' => Yii::t('post', 'Tags'), 'icon' => 'caret-right', 'url' => ['/post/tag', 'tid' => $type->id], 'active' => \Yii::$app->controller->getUniqueId() == 'post/tag' && \Yii::$app->request->get('tid') == $type->id], |
|
|
|
|
]]; |
|
|
|
|
return [ |
|
|
|
|
'label' => $type->plural, |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'items' => [ |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('post', 'Categories'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/post/category', 'tid' => $type->id], |
|
|
|
|
'active' => \Yii::$app->controller->getUniqueId() == 'post/category' && \Yii::$app->request->get('tid') == $type->id |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'label' => $type->plural, |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/post/post', 'tid' => $type->id], |
|
|
|
|
'active' => \Yii::$app->controller->getUniqueId() == 'post/post' && \Yii::$app->request->get('tid') == $type->id |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('post', 'Tags'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/post/tag', 'tid' => $type->id], |
|
|
|
|
'active' => \Yii::$app->controller->getUniqueId() == 'post/tag' && \Yii::$app->request->get('tid') == $type->id |
|
|
|
|
], |
|
|
|
|
] |
|
|
|
|
]; |
|
|
|
|
}, \core\entities\post\PostType::find()->all()), |
|
|
|
|
[['label' => Yii::t('post', 'Comments'), 'icon' => 'caret-right', 'url' => ['/post/comment'], 'active' => \Yii::$app->controller->getUniqueId() == 'post/comment']], |
|
|
|
|
[['label' => Yii::t('post', 'Types'), 'icon' => 'caret-right', 'url' => ['/post/type'], 'active' => \Yii::$app->controller->getUniqueId() == 'post/type']] |
|
|
|
|
), 'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('PostManagement')], |
|
|
|
|
[ |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('post', 'Comments'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/post/comment'], |
|
|
|
|
'active' => \Yii::$app->controller->getUniqueId() == 'post/comment' |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('post', 'Types'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/post/type'], |
|
|
|
|
'active' => \Yii::$app->controller->getUniqueId() == 'post/type' |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
), |
|
|
|
|
'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('PostManagement') |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('slider', 'Slider'), |
|
|
|
|
'icon' => 'retweet', 'url' => ['/slider/index'], |
|
|
|
|
'icon' => 'retweet', |
|
|
|
|
'url' => ['/slider/index'], |
|
|
|
|
'active' => $this->context->id == 'slider', |
|
|
|
|
'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('SliderManagement'), |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
['label' => Yii::t('main', 'Settings'), 'icon' => 'cog', 'items' => [ |
|
|
|
|
['label' => Yii::t('main', 'Settings List'), 'icon' => 'caret-right', 'url' => ['/settings/list/index'], 'active' => \Yii::$app->controller->getUniqueId() == 'settings/list'], |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('main', 'Settings'), |
|
|
|
|
'icon' => 'cog', |
|
|
|
|
'items' => [ |
|
|
|
|
[ |
|
|
|
|
'label' => Yii::t('main', 'Settings List'), |
|
|
|
|
'icon' => 'caret-right', |
|
|
|
|
'url' => ['/settings/list/index'], |
|
|
|
|
'active' => \Yii::$app->controller->getUniqueId() == 'settings/list' |
|
|
|
|
], |
|
|
|
|
//['label' => Yii::t('main', 'Find modules'), 'icon' => 'caret-right', 'url' => ['/module/search'], 'active' => \Yii::$app->controller->action->getUniqueId() == 'module/search'], |
|
|
|
|
], 'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('SettingsManagement')], |
|
|
|
|
], |
|
|
|
|
'visible' => \Yii::$app->user->can('admin') || \Yii::$app->user->can('SettingsManagement') |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
], Yii::$app->params['adminMenu']), |
|
|
|
|
], (isset(Yii::$app->params['adminMenu']) && is_array(Yii::$app->params['adminMenu']) ? Yii::$app->params['adminMenu'] : [])), |
|
|
|
|
] |
|
|
|
|
) ?> |
|
|
|
|
|
|
|
|
|