<!doctype html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><?= lang('Dashboard'); ?></title>
    <link rel="stylesheet" href="<?= asset('dash/themes/material/easyui.css'); ?>">
    <link rel="stylesheet" href="<?= asset('dash/themes/icon.css'); ?>">
    <link rel="stylesheet" href="<?= asset('dash/themes/color.css'); ?>">
    <link rel="stylesheet" href="<?= asset('dash/libs/tree/style.min.css'); ?>">
    <link rel="stylesheet" href="<?= asset('dash/themes/scroll.css'); ?>">
    <link rel="stylesheet" href="<?= asset('dash/themes/framework.css'); ?>">
    <script type="text/javascript" src="<?= asset('dash/jquery.min.js'); ?>"></script>
</head>
<body class="cv-fixed-global">
<div id="cv_top_nav_tabs" class="easyui-tabs cv-top-nav" data-options="tabHeight:42,pill:'true',toolPosition:'left',tools:'#cv-nav-tools',border:'false'" style="width: 100%;height: 100%;">
    <?php foreach ($menus as $menu):?>
        <div title="<?= $menu['symbol']; ?>" href="<?= $menu['route']; ?>"></div>
    <?php endforeach;?>
</div>
<div id="cv-nav-tools">
    <div class="cv-dashboard-brand">
        <img src="<?= asset('dash/img/dash_brand.png'); ?>">
    </div>
</div>
<div id="cv_shortcut">
    <a href="">欢迎，<?php if (!empty(trim($user['true_name']))):?><?= $user['true_name']; ?><?php else:?><?= $user['username']; ?><?php endif;?></a>
    <a href="javascript:logout();">退出管理</a>
    <a href="<?= request()->domain().request()->root().'/'; ?>" target="_blank">网站首页</a>
</div>
<script type="text/javascript" src="<?= asset('dash/jquery.easyui.min.js'); ?>"></script>
<script type="text/javascript" src="<?= asset('dash/locale/easyui-lang-zh_CN.js'); ?>"></script>
<script type="text/javascript" src="<?= asset('dash/libs/layer/layer.js'); ?>"></script>
<script type="text/javascript" src="<?= asset('dash/libs/tree/jstree.min.js'); ?>"></script>
<script type="text/javascript" src="<?= asset('dash/framework.js'); ?>"></script>
<script type="text/javascript">
    var topNavTabs = $('#cv_top_nav_tabs');
    function updateArchiveTab() {
        var categoryTab = topNavTabs.tabs('getTab','内容管理');
        topNavTabs.tabs('update', {
            tab: categoryTab,
            options: {
                href: '<?= url('dash/panel/archive'); ?>'
            }
        });
    }

    function updateRenderTab() {
        var renderTab = topNavTabs.tabs('getTab','主题渲染');
        topNavTabs.tabs('update', {
            tab: renderTab,
            options: {
                href: '<?= url('dash/panel/render'); ?>'
            }
        });
    }

    function logout() {
        $.ajax({
            url: '<?= url('dash/manager/logout'); ?>',
            type:'POST',
            dataType: 'json',
            success: function (response) {
                window.location.href=response.red;
            }
        })
    }
</script>
</body>
</html>