115 lines
5.7 KiB
HTML
115 lines
5.7 KiB
HTML
|
<!-- lv1 -->
|
||
|
<ul class="layui-nav layui-nav-tree layui-parents-nav">
|
||
|
{foreach $rules as $rule}
|
||
|
{php}
|
||
|
if(!strpos($rule['name'],'/')){
|
||
|
$ruleName = $rule['name'].'/index';
|
||
|
$controller = strtolower($rule['name']);
|
||
|
}else{
|
||
|
$ruleName = $rule['name'];
|
||
|
$controller = substr($rule['name'],0,strpos($rule['name'],'/'));
|
||
|
}
|
||
|
$controller = str_replace('manager.', '', $controller);
|
||
|
{/php}
|
||
|
{if $controller == 'content'}
|
||
|
{if !empty($menus)}
|
||
|
<li class="layui-nav-item layui-lv1 {if $controller == $current}layui-this{/if}">
|
||
|
<a href="javascript:;" title="{$rule.title}" class="one">
|
||
|
<cite>{$rule['title']}</cite>
|
||
|
</a>
|
||
|
<!-- lv2 -->
|
||
|
<ul class="layui-nav-child">
|
||
|
{foreach $menus as $menu}
|
||
|
{if isset($menu['children']) && count($menu['children'])}
|
||
|
<li class="layui-nav-item layui-lv2 {if $categoryId == $menu['id']}layui-this{/if}">
|
||
|
<a
|
||
|
{if $menu['parent_show'] > 0 || $menu['manager'] == 'page'}
|
||
|
href="{:url('manager.content/'.$menu['manager'],['category_id' => $menu['id']])}"
|
||
|
{else /}
|
||
|
href="javascript:;"
|
||
|
{/if}
|
||
|
class="one {if $categoryId == $menu['id']}active{/if}">
|
||
|
<cite>{$menu.title}</cite>
|
||
|
</a>
|
||
|
<!-- lv3 -->
|
||
|
<ul class="layui-nav-child">
|
||
|
{foreach $menu['children'] as $child}
|
||
|
{if $child.backend_show }
|
||
|
{if isset($child['children']) && count($child['children'])}
|
||
|
<li class="layui-nav-item layui-lv3 {if $categoryId == $child['id']}layui-this{/if}">
|
||
|
<a
|
||
|
{if $child['parent_show'] > 0 || $child['manager'] == 'page'}
|
||
|
href="{:url('manager.content/'.$child['manager'],['category_id' => $child['id']])}"
|
||
|
{else/}
|
||
|
href="javascript:;"
|
||
|
{/if}
|
||
|
class="one {if $categoryId == $child['id']}active{/if}">
|
||
|
<cite>{$child.title}</cite>
|
||
|
</a>
|
||
|
<!-- lv4 -->
|
||
|
<ul class="layui-nav-child">
|
||
|
{foreach $child['children'] as $chil}
|
||
|
{if $chil.backend_show}
|
||
|
<li class="layui-nav-item layui-lv4 {if $categoryId == $chil['id']}layui-this{/if}">
|
||
|
<a href="{:url('manager.content/'.$chil['manager'],['category_id' => $chil['id']])}" class="two">
|
||
|
<cite>{$chil.title}</cite>
|
||
|
</a>
|
||
|
</li>
|
||
|
{/if}
|
||
|
{/foreach}
|
||
|
</ul>
|
||
|
</li>
|
||
|
{else /}
|
||
|
<li class="layui-nav-item layui-lv3 {if $categoryId == $child['id']}layui-this{/if}">
|
||
|
<a href="{:url('manager.content/'.$child['manager'],['category_id' => $child['id']])}" class="two">
|
||
|
<cite>{$child.title}</cite>
|
||
|
</a>
|
||
|
</li>
|
||
|
{/if}
|
||
|
{/if}
|
||
|
{/foreach}
|
||
|
</ul>
|
||
|
</li>
|
||
|
{else /}
|
||
|
<li class="layui-nav-item layui-lv2 {if $categoryId == $menu['id']}layui-this{/if}">
|
||
|
<a href="{:url('manager.content/'.$menu['manager'],['category_id' => $menu['id']])}" class="two">
|
||
|
<cite>{$menu.title}</cite>
|
||
|
</a>
|
||
|
</li>
|
||
|
{/if}
|
||
|
{/foreach}
|
||
|
</ul>
|
||
|
</li>
|
||
|
{/if}
|
||
|
{elseif $rule['parent_id'] == 0 /}
|
||
|
<li class="layui-nav-item layui-lv1 {if $controller == $current}layui-this{/if}">
|
||
|
{if isset($rule['children']) && count($rule['children'])}
|
||
|
<a href="javascript:;" title="{$rule.title}" class="one">
|
||
|
<cite>{$rule['title']}</cite>
|
||
|
</a>
|
||
|
<!-- lv2 -->
|
||
|
<ul class="layui-nav-child">
|
||
|
{foreach $rule['children'] as $child}
|
||
|
{php}
|
||
|
if(!strpos($child['name'],'/')){
|
||
|
$childRuleName = $child['name'].'/index';
|
||
|
}else{
|
||
|
$childRuleName = $child['name'];
|
||
|
}
|
||
|
{/php}
|
||
|
<li class="layui-nav-item layui-lv2 {if $currentAction == strtolower($childRuleName)}layui-this{/if}">
|
||
|
<a href="{:url('manager.'.$childRuleName)}" class="two">
|
||
|
<cite>{$child.title}</cite>
|
||
|
</a>
|
||
|
</li>
|
||
|
{/foreach}
|
||
|
</ul>
|
||
|
{else /}
|
||
|
<a href="{:url('manager.'.$ruleName)}" class="two">
|
||
|
<cite>{$rule.title}</cite>
|
||
|
</a>
|
||
|
{/if}
|
||
|
</li>
|
||
|
{/if}
|
||
|
{/foreach}
|
||
|
</ul>
|