{template "header.html"}
{$form}
{php $uris=[]; $top=[]; $l1_has_child=[]; $l2_has_child=[]; $sib_ids=[];} {loop $menu_data $t} {php $t.pid == 0 && $top[] = $t.id;} {php dr_in_array($t.pid, (array)$top) && $l1_has_child[$t.pid]=1;} {php $t.pid && !dr_in_array($t.pid, (array)$top) && $l2_has_child[$t.pid]=1;} {php $sib_ids[$t.pid][] = $t.id;} {/loop} {loop $menu_data $t} {php $menu_level = $t.pid == 0 ? 1 : (dr_in_array($t.pid, (array)$top) ? 2 : 3);} {php $menu_top_id = $menu_level == 1 ? $t.id : ($menu_level == 2 ? $t.pid : $t.tid);} {php $has_l3_child = $menu_level == 2 && !empty($l2_has_child[$t.id]);} {php $show_link = ($menu_level == 1 && !empty($l1_has_child[$t.id])) || $has_l3_child;} {php $sibs = isset($sib_ids[$t.pid]) ? $sib_ids[$t.pid] : [];} {php $is_last_sib = $sibs && $sibs[count($sibs)-1] == $t.id;} {php $auth_self = $t.uri ? '.zsg'.$t.id : '.dr-auth-noset';} {php $auth_link = $t.uri ? '.zsg'.$t.id.', .menu'.$t.id : '.menu'.$t.id;} {php $auth_dataset = $show_link ? $auth_link : ($t.uri ? '.zsg'.$t.id : '.menu'.$t.id);} {if $show_link} {else} {/if} {/loop}
Id {dr_lang('菜单名称')} {dr_lang('增')} {dr_lang('改')} {dr_lang('删')}
{php $ikey=0;} {loop $module_auth $dir $t} {loop $t.auth $uri $name} {if !dr_in_array($uri.'index', $uris)} {php $ikey++;} {/if} {/loop}
Id {$t.name} {dr_lang('增')} {dr_lang('改')} {dr_lang('删')}
{$ikey} {$name} - {$uri}index
{/loop}
{template "footer.html"}