mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-30 14:09:58 +08:00
enhance rendering menus
This commit is contained in:
parent
e71f608d18
commit
7ead22de93
@ -139,7 +139,7 @@ if (! function_exists('bs_header')) {
|
||||
|
||||
if (! function_exists('bs_menu')) {
|
||||
|
||||
function bs_menu($type, $title)
|
||||
function bs_menu($type)
|
||||
{
|
||||
$menu = require BASE_DIR."/config/menu.php";
|
||||
|
||||
@ -147,12 +147,12 @@ if (! function_exists('bs_menu')) {
|
||||
throw new InvalidArgumentException;
|
||||
}
|
||||
|
||||
$request = App::make('request');
|
||||
|
||||
foreach ($menu[$type] as $key => $value) {
|
||||
$value['title'] = trans($value['title']);
|
||||
echo ($request->is($value['link'])) ? '<li class="active">' : '<li>';
|
||||
|
||||
echo ($title == $value['title']) ? '<li class="active">' : '<li>';
|
||||
|
||||
echo '<a href="'.url($value['link']).'"><i class="fa '.$value['icon'].'"></i> <span>'.$value['title'].'</span></a></li>';
|
||||
echo '<a href="'.url($value['link']).'"><i class="fa '.$value['icon'].'"></i> <span>'.trans($value['title']).'</span></a></li>';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,21 +9,21 @@
|
||||
*/
|
||||
|
||||
$menu['user'] = array(
|
||||
['title' => 'general.dashboard', 'link' => '/user', 'icon' => 'fa-dashboard'],
|
||||
['title' => 'general.my-closet', 'link' => '/user/closet', 'icon' => 'fa-star'],
|
||||
['title' => 'general.player-manage', 'link' => '/user/player', 'icon' => 'fa-users'],
|
||||
['title' => 'general.generate-config', 'link' => '/user/config', 'icon' => 'fa-book'],
|
||||
['title' => 'general.profile', 'link' => '/user/profile', 'icon' => 'fa-user']
|
||||
['title' => 'general.dashboard', 'link' => 'user', 'icon' => 'fa-dashboard'],
|
||||
['title' => 'general.my-closet', 'link' => 'user/closet', 'icon' => 'fa-star'],
|
||||
['title' => 'general.player-manage', 'link' => 'user/player', 'icon' => 'fa-users'],
|
||||
['title' => 'general.generate-config', 'link' => 'user/config', 'icon' => 'fa-book'],
|
||||
['title' => 'general.profile', 'link' => 'user/profile', 'icon' => 'fa-user']
|
||||
);
|
||||
|
||||
$menu['admin'] = array(
|
||||
['title' => 'general.dashboard', 'link' => '/admin', 'icon' => 'fa-dashboard'],
|
||||
['title' => 'general.user-manage', 'link' => '/admin/users', 'icon' => 'fa-users'],
|
||||
['title' => 'general.player-manage', 'link' => '/admin/players', 'icon' => 'fa-gamepad'],
|
||||
['title' => 'general.customize', 'link' => '/admin/customize', 'icon' => 'fa-paint-brush'],
|
||||
['title' => 'general.score-options', 'link' => '/admin/score', 'icon' => 'fa-credit-card'],
|
||||
['title' => 'general.options', 'link' => '/admin/options', 'icon' => 'fa-cog'],
|
||||
['title' => 'general.check-update', 'link' => '/admin/update', 'icon' => 'fa-arrow-up']
|
||||
['title' => 'general.dashboard', 'link' => 'admin', 'icon' => 'fa-dashboard'],
|
||||
['title' => 'general.user-manage', 'link' => 'admin/users', 'icon' => 'fa-users'],
|
||||
['title' => 'general.player-manage', 'link' => 'admin/players', 'icon' => 'fa-gamepad'],
|
||||
['title' => 'general.customize', 'link' => 'admin/customize', 'icon' => 'fa-paint-brush'],
|
||||
['title' => 'general.score-options', 'link' => 'admin/score', 'icon' => 'fa-credit-card'],
|
||||
['title' => 'general.options', 'link' => 'admin/options', 'icon' => 'fa-cog'],
|
||||
['title' => 'general.check-update', 'link' => 'admin/update', 'icon' => 'fa-arrow-up']
|
||||
);
|
||||
|
||||
return $menu;
|
||||
|
@ -89,7 +89,7 @@
|
||||
<!-- Sidebar Menu -->
|
||||
<ul class="sidebar-menu">
|
||||
<li class="header">{{ trans('general.admin-panel') }}</li>
|
||||
{!! bs_menu('admin', $__env->yieldContent('title')) !!}
|
||||
{!! bs_menu('admin') !!}
|
||||
|
||||
<li class="header">{{ trans('general.back') }}</li>
|
||||
<li><a href="{{ url('user') }}"><i class="fa fa-user"></i> <span>{{ trans('general.user-center') }}</span></a></li>
|
||||
|
@ -87,7 +87,7 @@
|
||||
<!-- Sidebar Menu -->
|
||||
<ul class="sidebar-menu">
|
||||
<li class="header">{{ trans('general.user-center') }}</li>
|
||||
{!! bs_menu('user', $__env->yieldContent('title')) !!}
|
||||
{!! bs_menu('user') !!}
|
||||
|
||||
<li class="header">{{ trans('general.explore') }}</li>
|
||||
<li><a href="{{ url('skinlib') }}"><i class="fa fa-archive"></i> <span>{{ trans('general.skinlib') }}</span></a></li>
|
||||
|
Loading…
Reference in New Issue
Block a user