<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <title>{fc_lang('%s后台中心', SITE_NAME)}</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="{THEME_PATH}admin/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="{THEME_PATH}admin/css/font-awesome/css/font-awesome.css"rel="stylesheet" type="text/css" />
    <link href="{THEME_PATH}admin/css/table_form.css" rel="stylesheet"  />
    <link href="{THEME_PATH}admin/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
    <link href="{THEME_PATH}admin/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="{THEME_PATH}admin/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" />
    <link href="{THEME_PATH}admin/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
    <link href="{THEME_PATH}admin/global/plugins/jquery-notific8/jquery.notific8.min.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN THEME GLOBAL STYLES -->
    <link href="{THEME_PATH}admin/global/css/components-rounded.min.css" rel="stylesheet" id="style_components" type="text/css" />
    <link href="{THEME_PATH}admin/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
    <link href="{THEME_PATH}admin/my.css" rel="stylesheet" type="text/css" />
    <!-- END THEME GLOBAL STYLES -->
    <!-- BEGIN THEME LAYOUT STYLES -->
    <link href="{THEME_PATH}admin/layouts/layout/css/layout.min.css" rel="stylesheet" type="text/css" />
    <!-- END THEME LAYOUT STYLES -->
    <!--[if lt IE 9]>
    <script src="{THEME_PATH}admin/global/plugins/respond.min.js"></script>
    <script src="{THEME_PATH}admin/global/plugins/excanvas.min.js"></script>
    <![endif]-->
    <!-- BEGIN CORE PLUGINS -->
    <script src="{THEME_PATH}admin/global/plugins/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">var dr_index = 1;var siteurl = "{SITE_PATH}{SELF}";var memberpath = "{MEMBER_PATH}";var sys_theme = "{THEME_PATH}admin/";</script>
    <script src="{THEME_PATH}js/{SITE_LANGUAGE}.js" type="text/javascript"></script>
    <script src="{THEME_PATH}js/jquery-ui.min.js" type="text/javascript"></script>
    <script src="{THEME_PATH}js/jquery.cookie.js" type="text/javascript"></script>
    <link rel="stylesheet" href="{THEME_PATH}js/ui-dialog.css">
    <script type="text/javascript" src="{THEME_PATH}js/dialog-plus.js"></script>
    <script type="text/javascript" src="{THEME_PATH}js/jquery.artDialog.js?skin=default"></script>
    <script src="{THEME_PATH}js/validate.js" type="text/javascript"></script>
    <script src="{THEME_PATH}js/admin.js" type="text/javascript"></script>
    <script src="{THEME_PATH}js/dayrui.js" type="text/javascript"></script>
    <script src="{THEME_PATH}admin/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="{THEME_PATH}admin/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
    <script src="{THEME_PATH}admin/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <script src="{THEME_PATH}admin/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
    <script src="{THEME_PATH}admin/global/plugins/jquery.scrollTo.min.js" type="text/javascript"></script>
    <script src="{THEME_PATH}admin/global/plugins/jquery-notific8/jquery.notific8.min.js" type="text/javascript"></script>
    <!-- END CORE PLUGINS -->
    <!-- BEGIN THEME GLOBAL SCRIPTS -->
    <script src="{THEME_PATH}admin/global/scripts/app.min.js" type="text/javascript"></script>
    <!-- END THEME GLOBAL SCRIPTS -->
    <!-- BEGIN THEME LAYOUT SCRIPTS -->
    <script src="{THEME_PATH}admin/layouts/layout/scripts/layout.js" type="text/javascript"></script>
    <script src="{THEME_PATH}admin/layouts/layout/scripts/demo.min.js" type="text/javascript"></script>
    <script src="{THEME_PATH}admin/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var left_menu = {json_encode($left)};
        function init_iframe() {
            if ($("#_left_menu").offset().top != $("#_right_menu").offset().top) {
                $(".my_top_module").remove();
                $("#select_top_module").show();
            }
        }
        $(function(){
            init_iframe();
            if ($(window).width() <= 800) {
                alert("你的浏览器太小，推荐使用1024以上浏览器");
            }
            wSize();

            $("#sitelist li").click(function(){
                var id=$(this).attr('id');
                art.dialog.confirm("<font color=red><b>{fc_lang('是否要切换站点？')}</b></font>", function(){
                    // ajax提交验证
                    $.ajax({type: "POST",dataType:"json", url: "{dr_url('site/select')}", data: {id: id},
                        success: function(data) {
                            if (data.status == 1) {
                                //验证成功
                                dr_tips(data.code, 3, 1);
                                setTimeout('top.location.reload(true)', 2000);
                            } else {
                                dr_tips(data.code, 5);
                            }
                            return true;
                        },
                        error: function(HttpRequest, ajaxOptions, thrownError) {

                        }
                    });
                    return true;
                });
            });
        });
        function getSidebarScrollHeight(){
            var $el = $("#left"),
                    $w = $(window),
                    $nav = $("#navigation");
            var height = $w.height();

            if(($nav.hasClass("navbar-fixed-top") && $w.scrollTop() == 0) || $w.scrollTop() == 0) height -= 40;

            if($el.hasClass("sidebar-fixed") || $el.hasClass("mobile-show")){
                $el.height(height);
            }
        }
        // 隐藏和现实左侧菜单按钮
        function hideNav(){


        }
        // 强制隐藏左侧菜单按钮
        function hideNavShow(){
            var body = $('body');
            var sidebar = $('.page-sidebar');
            var sidebarMenu = $('.page-sidebar-menu');
            $(".sidebar-search", sidebar).removeClass("open");

            body.addClass("page-sidebar-closed");
            sidebarMenu.addClass("page-sidebar-menu-closed");
            if (body.hasClass("page-sidebar-fixed")) {
                sidebarMenu.trigger("mouseleave");
            }
            if ($.cookie) {
                $.cookie('sidebar_closed', '1');
            }

           // $(window).trigger('resize');
        }
        // 强制显示左侧菜单按钮
        function hideNavHide(){
            return;
            var body = $('body');
            var sidebar = $('.page-sidebar');
            var sidebarMenu = $('.page-sidebar-menu');
            $(".sidebar-search", sidebar).removeClass("open");

            body.removeClass("page-sidebar-closed");
            sidebarMenu.removeClass("page-sidebar-menu-closed");
            if ($.cookie) {
                $.cookie('sidebar_closed', '0');
            }

            //$(window).trigger('resize');
        }

        if(!Array.prototype.map)
            Array.prototype.map = function(fn,scope) {
                var result = [],ri = 0;
                for (var i = 0,n = this.length; i < n; i++){
                    if(i in this){
                        result[ri++]  = fn.call(scope ,this[i],i,this);
                    }
                }
                return result;
            };

        var getWindowSize = function(){
            return ["Height","Width"].map(function(name){
                return window["inner"+name] ||
                        document.compatMode === "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ]
            });
        }
        window.onload = function (){

            if (!window.applicationCache) {
                alert("你的浏览器不支持HTML5，推荐使用Chrome或IE高版本浏览器");
                return false;
            }
            if(!+"\v1" && !document.querySelector) {
                alert("你的浏览器不支持HTML5，推荐使用Chrome或IE高版本浏览器");
                return false;
            } else {
                window.onresize = resize;
            }
            function resize() {
                wSize();
                return false;
            }
        }
        function wSize(){
            var str=getWindowSize();
            var strs= new Array(); //定义一数组
            strs=str.toString().split(","); //字符分割
            var heights = strs[0]-80,Body = $('body');$('#rightMain').height(heights);
        }
        function _M(mid, sid, url, name) {

        }
        function fn(i, url) {

            $("#rightMain").attr('src', url);
            $("#rightMain").attr("url", url);

            $('.i-t').removeClass('active');
            $('#fn_'+i).addClass('active');
            $(".dr_link").attr('class', 'dr_link nav-item');

            // 移动端隐藏菜单
            if ($(window).width() <= 824) {
                $('.page-sidebar').removeClass("in");
                $('.page-sidebar').attr("aria-expanded", "false");
            }
        }
        function _MP(id, url) {

            $("#rightMain").attr('src', url);
            $("#rightMain").attr("url", url);

            var fid = $("#_MP_"+id).attr("fid");

            $(".dr_left").attr('class', 'dr_left nav-item');
            $(".dr_link").attr('class', 'dr_link nav-item');
            $("#_MP_"+id).addClass('active open');
            $("#D_M_"+fid).addClass('active open');

            if (url.indexOf('http') == -1) {
                dr_loading();
            }

            // 移动端隐藏菜单
            if ($(window).width() <= 824) {
                $('.page-sidebar').removeClass("in");
                $('.page-sidebar').attr("aria-expanded", "false");
            }
        }
        function _MAP(mid, tid, url) {
            $(".my_top").removeClass('open');
            //$("#select_top_module").addClass('open');
            $("#select_my_top_"+tid).addClass('open');
            $("#my_top_"+tid).addClass('open');
            $(".page-sidebar-menu").html(left_menu[tid]);
            _MP(mid, url);


        }
        function logout(){
            if (confirm("{fc_lang('您确定要退出吗？')}"))
                top.location = '{dr_url("login/logout")}';
            return false;
        }
        function dr_get_map() {
        }
        function dr_clear_map() {
        }
        function dr_loading() {
        }
        function dr_set_color_value(v) {

        }
        function dr_add_menu() {
            $.ajax({
                type: "GET",
                cache: false,
                url: "{dr_url('api/menu')}&v="+encodeURIComponent($("#rightMain").attr("url")),
                dataType: "text",
                success: function (res) {
                   if (!res) {
                       dr_tips('{fc_lang("操作成功")}',3, 1);
                   } else {
                       dr_tips(res);
                   }
                },
                error: function (xhr, ajaxOptions, thrownError) {
                }
            });
        }
    </script>
    <style>
    .page-content {
        padding:0 !important;
        background-color: #f5f5f5;
    }
    </style>
</head>
<body scroll="no" style="overflow:hidden" class="page-sidebar-closed-hide-logo page-content-white page-header-fixed page-sidebar-fixed page-footer-fixed">

<div class="page-header navbar navbar-fixed-top">
    <div class="page-header-inner ">
        <div class="page-logo">
            <a href="{SITE_URL}" style="padding-top: 10px;" target="_blank"><img src="{THEME_PATH}logo.png" /> </a>
        </div>

        <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a>
        <div id="_left_menu" class="top-menu pull-left">

            <ul class="nav navbar-nav pull-left">
                {php $i=1;}
                {loop $top $t}
                <li class="{if strpos($t.mark, 'module')===0}my_top_module{/if} my_top dropdown {if $i}open{/if}" id="my_top_{$t.id}">
                    <a class="dropdown-toggle myname popovers" data-container="body" data-trigger="hover"  href="javascript:_MAP('{$t.link.id}', '{$t.link.tid}', '{$t.link.url}');">
                        <i class="{$t.icon}"></i>
                        <br>
                        <i class="top-txt-menu">{fc_lang($t.name)}</i>
                    </a>
                </li>
                {php $i=0;}
                {/loop}
            </ul>
        </div>
        <div id="_right_menu" class="top-menu">

            <ul class="nav navbar-nav pull-right">

                <li class="dropdown dropdown-dark">
                    <a href="{SITE_URL}" target="_blank" class="dropdown-toggle popovers top-link" data-container="body" data-trigger="hover" data-placement="bottom" data-content="{fc_lang('网站首页')}">
                        <i class="fa fa-home" style="font-size: 21px;"></i>
                    </a>
                </li>

                {if count($mysite)>1}
                <li id="dr_select_site" class=" dropdown dropdown-extended dropdown-notification ">
                    <a href="javascript:;" class="dropdown-toggle popovers top-link" data-container="body" data-trigger="hover" data-placement="bottom" data-content="{fc_lang('站点切换')}" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                        <i class="icon-globe"></i>
                    </a>

                    <ul class="dropdown-menu">
                        <li class="external">
                            <h3>{fc_lang('可管理%s个站点', '<span class="bold">'.count($mysite).'</span>')}</h3>
                        </li>
                        <li>
                            <ul id="sitelist" class="dropdown-menu-list scroller" style="height: 300px;" data-handle-color="#637283">
                                {loop $mysite $sid $name}
                                <li id="{$sid}">
                                    <a href="javascript:;">
                                        {if $sid==SITE_ID}<span class="time" style="background:none"><i class="fa fa-check-square"></i></span>{/if}
                                        <span class="details"> {$name} </span>
                                    </a>
                                </li>
                                {/loop}

                            </ul>
                        </li>
                    </ul>
                </li>
                {/if}





                <li class="dropdown dropdown-dark">
                    <a class="dropdown-toggle popovers top-link" data-container="body" data-trigger="hover" data-placement="bottom" data-content="{fc_lang('更新全站缓存')}" href="{dr_url('home/cache')}" target="right"><i class="fa fa-refresh"></i></a>
                </li>

                <li class="dropdown dropdown-user">
                    <a href="javascript:;" style=" height: 70px;" class="dropdown-toggle top-link" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                        <img alt="{$admin['username']}" class="img-circle" src="{dr_avatar($admin.uid)}" />
                        <i class="fa fa-angle-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-default">
                        <li><a href="{SITE_URL}" target="_blank"><i class="fa fa-home"></i> {fc_lang('网站首页')} </a></li>
                        <li><a href="javascript:;" onClick="logout();"><i class="fa fa-sign-in"></i> {fc_lang('退出系统')}</a></li>
                        <li class="divider"> </li>

                        <li><a href="{dr_url('home/clear')}" target="right"><i class="fa fa-trash"></i> {fc_lang('更新数据')}</a></li>

                        <li><a href="{dr_url('home/dbcache')}" target="right"><i class="fa fa-database"></i> {fc_lang('更新表结构')}</a></li>
                        <li><a href="{dr_url('home/cache')}" target="right"><i class="fa fa-refresh"></i> {fc_lang('更新全站缓存')}</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>

<div class="clearfix"> </div>
<div class="page-container">
    <div class="page-sidebar-wrapper">
        <div class="page-sidebar navbar-collapse collapse">


                <div class="page-sidebar navbar-collapse collapse" style="padding-top:45px">

            <ul class="page-sidebar-menu page-sidebar-menu-fixed page-header-fixed" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" style="padding-top:0px">


            {reset($left)}

            </ul>


        </div>
    </div>

    <div class="page-content-wrapper">

        <div class="page-content">


            <iframe name="right" id="rightMain" 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>
    <a href="javascript:;" class="page-quick-sidebar-toggler">
        <i class="icon-login"></i>
    </a>
</div>

</body>
</html>