{template "head.html"}

<body scroll="no" style="overflow: hidden;" class="page-sidebar-closed-hide-logo page-admin-all page-content-white page-header-fixed page-sidebar-fixed ">
<style>.page-content {padding:0px !important;} </style>
<div class="page-header navbar navbar-fixed-top">
    <div class="page-header-inner ">
        <div class="page-logo">
            <a href="{SITE_URL}" target="_block"><img src="{THEME_PATH}assets/logo.png" alt="logo" class="logo-default" /> </a>
        </div>
        <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
            <span></span>
        </a>
        <div class="top-menu my-top-left pull-left">
            <ul class="nav navbar-nav pull-left fc-all-menu-top ">
                {loop $top $t}
                <li id="dr_menu_top_{$t.id}" class="dropdown {if $t.id==$first}open{/if}">
                    <a class="dropdown-toggle popovers" href="javascript:Mlink('{$t.id}', '{$t.left_id}', '{$t.link_id}', '{$t.url}');">
                        <i class="{$t.icon}"></i>
                        <br>
                        <i class="top-txt-menu">{dr_lang($t.name)}</i>
                    </a>
                </li>
                {/loop}
            </ul>
        </div>
        <div class="top-menu my-top-right">
            <ul class="nav navbar-nav pull-right">
                {if $is_mobile}
                <li class="dropdown fc-mini-menu-top">
                    <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                        <i class="fa fa-bars"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-default fc_mini_menu_top">
                        {loop $top $t}
                        <li>
                            <a id="dr_mini_menu_top_{$t.id}" class="dr_mini_menu_top {if $t.id==$first}open{/if}" href="javascript:Mlink('{$t.id}', '{$t.left_id}', '{$t.link_id}', '{$t.url}');">
                                <i class="{$t.icon}"></i> {dr_lang($t.name)}
                            </a>
                        </li>
                        {/loop}
                    </ul>
                </li>
                {$mstring}
                {/if}
                {if count($ci->site_info) > 1}
                <li class="dropdown dropdown-extended dropdown-tasks">
                    <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                        <i class="fa fa-share-alt"></i>
                        <span class="badge badge-default"> {count($ci->site_info)} </span>
                        <br>
                        <i class="top-txt-menu">{dr_lang('多站')}</i>
                    </a>
                    <ul class="dropdown-menu extended tasks">
                        <li>
                            <ul class="dropdown-menu-list scroller" style="height:400px;" data-handle-color="#637283">
                                {loop $ci->site_info $i $t}
                                {if \Phpcmf\Service::M('auth')->_check_site($i)}
                                <li>
                                    <a href="javascript:;" onclick="dr_select_site('{$i}')" title="{$t.SITE_NAME}" {if SITE_ID == $i}style="color:red"{/if}>
                                        <p style="margin: 0">{dr_strcut($t.SITE_NAME, 30)}</p>
                                        <p style="margin: 0;font-size: 10px;margin-top: -4px;">{dr_cms_domain_name($t.SITE_URL)}</p>
                                    </a>
                                </li>
                                {/if}
                                {/loop}
                            </ul>
                        </li>
                    </ul>
                </li>
                {/if}
                {if $is_mobile}
                <li class="dropdown">
                    <a href="javascript:;"  class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                        <i class="fa fa-wrench"></i>
                        <br>
                        <i class="top-txt-menu">{dr_lang('账号')}</i>
                    </a>
                    {else}
                <li class="dropdown dropdown-user">
                    <a style="margin-right: -10px;height: 70px;" href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                        <img alt="{$admin['username']}" class="img-circle" src="{dr_avatar($admin.uid)}" />
                        <span style="padding-top: 10px;" class="username username-hide-on-mobile"> {dr_strcut($admin['username'], 8)} </span>
                        <i class="fa fa-angle-down"></i>
                    </a>
                    {/if}
                    <ul class="dropdown-menu dropdown-menu-default">
                        <li><a href="{dr_url('api/alogin', ['id'=>$admin.uid])}" target="_blank"><i class="fa fa-user"></i> {dr_lang('用户中心')} </a></li>
                        <li><a href="{dr_url('api/my')}" target="right"><i class="fa fa-edit"></i> {dr_lang('修改资料')} </a></li>
                        <li><a href="{dr_url('api/admin_min')}"><i class="fa fa-retweet"></i> {dr_lang('简化模式')}</a></li>
                        <li><a href="javascript:;" onClick="dr_logout('{dr_url('login/out')}');"><i class="fa fa-user-times"></i> {dr_lang('退出系统')}</a></li>
                        <li class="divider"> </li>
                        {if $ci->_is_admin_auth('cache/index')}
                        <li><a href="{dr_url('cache/index')}" target="right"><i class="fa fa-cogs"></i> {dr_lang('系统更新')}</a></li>
                        {/if}
                        {if $ci->_is_admin_auth('check/index')}
                        <li><a href="{dr_url('check/index')}" target="right"><i class="fa fa-wrench"></i> {dr_lang('系统体检')}</a></li>
                        {/if}
                        <li><a href="javascript:dr_update_cache_all();" target="right"><i class="fa fa-refresh"></i> {dr_lang('更新缓存')}</a></li>
                        <li><a href="javascript:dr_update_cache_data();" target="right"><i class="fa fa-trash"></i> {dr_lang('更新数据')}</a></li>
                        {if $admin.adminid==1}
                        <li class="divider"> </li>
                        <li><a href="{dr_url('error/index')}" target="right"><i class="fa fa-shield"></i> {dr_lang('系统错误')}</a></li>
                        <li><a href="{dr_url('content/index', ['p'=>1, 'page'=>1])}" target="right"><i class="fa fa-code"></i> {dr_lang('执行SQL')}</a></li>
                        {/if}
                        {if $is_search_help}
                        <li><a href="http://help.xunruicms.com" target="_blank"><i class="fa fa-book"></i> {dr_lang('帮助手册')}</a></li>
                        {/if}
                    </ul>
                </li>
                {if !$is_mobile}
                <li class="dropdown dropdown-quick-sidebar-toggler">
                    <a href="javascript:;" class="dropdown-toggle">
                        <i class="fa fa-angle-double-right" style="margin-top: 10px;"></i>
                    </a>
                </li>
                {/if}
            </ul>
        </div>
    </div>
</div>

<div class="clearfix"> </div>

<div class="page-container">
    <div class="page-sidebar-wrapper">

        <div class="page-sidebar navbar-collapse collapse">
            <ul class="page-sidebar-menu  page-header-fixed  page-sidebar-menu-light" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" style="padding-top: 20px">
                <li class="sidebar-toggler-wrapper hide">
                    <div class="sidebar-toggler">
                        <span></span>
                    </div>
                </li>

                <li class="sidebar-search-wrapper hidden-xs hidden-sm">
                    <form class="sidebar-search" id="mysearchform">
                        <a href="javascript:;" class="remove">
                            <i class="fa fa-close"></i>
                        </a>
                        <div class="input-group">
                            {if $is_search_help}
                            <input type="text" id="mysearchform_kw" class="form-control" placeholder="{dr_lang('搜索帮助...')}">
                            <span class="input-group-btn">
                                <a href="javascript:;" class="btn submit">
                                    <i class="fa fa-search"></i>
                                </a>
                            </span>
                            {/if}
                        </div>
                    </form>
                </li>

                {$string}

            </ul>
        </div>
    </div>
    <div class="page-content-wrapper">
        <div class="page-content index-content">

            <div class="page-toolbar fc-mb-left-menu">

            </div>

            <iframe name="right" id="right_page" src="{dr_url('home/main')}&cache={SYS_TIME}" url="{dr_url('home/main')}&cache={SYS_TIME}" frameborder="false" scrolling="auto" style="border:none; margin-bottom:0px;" width="100%" height="auto" allowtransparency="true"></iframe>

        </div>
    </div>

    <!-- BEGIN QUICK SIDEBAR -->
    {if !$is_mobile}
    <a href="javascript:;" class="page-quick-sidebar-toggler">
        <i class="fa fa-angle-double-left"></i>
    </a>
    <div class="page-quick-sidebar-wrapper" data-close-on-body-click="false">
        <div class="page-quick-sidebar">
            <?php $notice = \Phpcmf\Service::M('auth')->admin_notice();?>
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="javascript:;" data-target="#quick_sidebar_tab_1" data-toggle="tab"> {dr_lang('快速导航')}</a>
                </li>
                <li>
                    <a href="javascript:;" data-target="#quick_sidebar_tab_2" data-toggle="tab"> {dr_lang('系统提醒')}{if $notice}&nbsp;<span class="badge badge-success">{dr_count($notice)}</span>{/if}</a>
                </li>
                <li>
                    <a href="{SITE_URL}" target="_blank" class="dropdown-toggle"> {dr_lang('访问前台')}</a>
                </li>
            </ul>
            <div class="tab-content">

                <div class="tab-pane active page-quick-sidebar-nav" id="quick_sidebar_tab_1">
                    <h3 class="list-heading">{dr_lang('快捷链接')}</h3>
                    <div class="scroller" style="max-height:300px;" data-handle-color="#637283">
                        <div class="admin-usermenu" id="dr_admin_usermenu">
                            {loop $admin.usermenu $t}
                            <a class="btn {if $t.color && $t.color!='default'}{$t.color}{else}btn-default{/if}" {if $t.target} target="_blank" {else} onclick="dr_hide_left_tab()" target="right" {/if} href="{$t.url}"> {$t.name} </a>
                            {/loop}
                        </div>
                        <div class="theme-option">
                            <button type="button" onclick="dr_add_menu()" class="btn blue-madison"> <i class="fa fa-plus"></i> {dr_lang('将此页面加入到快捷菜单')} </button>
                        </div>
                    </div>
                    <h3 class="list-heading margin-top-30">{dr_lang('历史访问')}</h3>
                    <div class="scroller" style="max-height:350px;" data-handle-color="#637283">
                        <div class="admin-usermenu" id="dr_history_usermenu">
                            {loop $admin.history $t}
                            <a class="btn btn-default" target="right" onclick="dr_hide_left_tab()" href="{trim($t.url)}"> {$t.name} </a>
                            {/loop}
                        </div>
                        <div class="theme-option">
                            <button type="button" onclick="dr_clear_menu()" class="btn red"> <i class="fa fa-trash"></i> {dr_lang('清空历史访问记录')} </button>
                        </div>
                    </div>
                </div>
                <div class="tab-pane page-quick-sidebar-alerts" id="quick_sidebar_tab_2">
                    {if $notice}
                    <ul class="feeds list-items">
                        {loop $notice $t}
                        <li>
                            <div class="col1" style="padding-top: 2px;padding-left: 3px;">
                                <div class="cont">
                                    <div class="cont-col1 user-avatar">
                                        <a target="right" onclick="dr_hide_left_tab()" href="{dr_url('api/notice', array('id' => $t.id))}"><img style="height: 25px!important;" src="{dr_avatar($t.uid)}" /></a>
                                    </div>
                                    <div class="cont-col2">
                                        <div class="desc"><a style="color: #c1cbd0" target="right" onclick="dr_hide_left_tab()" href="{dr_url('api/notice', array('id' => $t.id))}">{$t.msg}</a></div>
                                    </div>
                                </div>
                            </div>
                            <div class="col2">
                                <div class="date"> {dr_fdate($t.inputtime)} </div>
                            </div>
                        </li>
                        {/loop}
                    </ul>
                    {/if}

                </div>
            </div>
        </div>
    </div>
    {/if}
    <!-- END QUICK SIDEBAR -->

</div>
<script>
    // 关闭栏
    function dr_hide_left_tab() {
        $(".page-quick-sidebar-toggler").click();
    }
    // 添加快捷菜单
    function dr_add_menu() {
        var index = layer.load(2, {
            shade: [0.3,'#fff'], //0.1透明度的白色背景
            time: 5000
        });
        $.ajax({
            type: "GET",
            url: admin_file+"?c=api&m=menu&v="+encodeURIComponent($("#right_page").attr("url")),
            dataType: "json",
            success: function (json) {
                layer.close(index);
                dr_tips(json.code, json.msg);
                if (json.code == 1) {
                    parent.$('#dr_admin_usermenu').html(json.data);
                }
            },
            error: function(HttpRequest, ajaxOptions, thrownError) {
                dr_ajax_admin_alert_error(HttpRequest, ajaxOptions, thrownError);
            }
        });
    }

    // 删除历史菜单
    function dr_clear_menu() {
        var index = layer.load(2, {
            shade: [0.3,'#fff'], //0.1透明度的白色背景
            time: 5000
        });
        $.ajax({
            type: "GET",
            url: admin_file+"?c=api&m=clear_history",
            dataType: "json",
            success: function (json) {
                layer.close(index);
                dr_tips(json.code, json.msg);
                if (json.code == 1) {
                    $('#dr_history_usermenu').html('');
                }
            },
            error: function(HttpRequest, ajaxOptions, thrownError) {
                dr_ajax_admin_alert_error(HttpRequest, ajaxOptions, thrownError);
            }
        });
    }

</script>
</body>
</html>