<%@ Page Language="C#" AutoEventWireup="true" Inherits="PowerEasy.Module.General.WebSite.Admin.Index"
    EnableViewState="false" CodeBehind="Index.aspx.cs" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />  
    <title id="AdminPageTitle" runat="server"></title>
</head>
<script language="javascript" src="<%#BasePath%>Admin/JS/AdminIndex.js" type="text/javascript"></script>
<script language="javascript" src="<%#BasePath%>Admin/JS/FrameTab.js" type="text/javascript"></script>
<script language="javascript" src="<%#BasePath%>JS/jquery.cookie.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    setStyleSheetPath("<%=StyleSheetPath%>");
    setBasePath("<%= BasePath %>", "<%= PowerEasy.Foundation.SiteConfig.SiteOption.ManageDir %>");
    setAdminName("<%= PowerEasy.Foundation.PEContext.Current.Admin.AdminName %>");
    setCheckNewVersionJSUrl("<%= CheckNewVersionJSUrl %>");
    function gouser() {
        jQuery.post('Profile/WidSeting.aspx', "<?xml version='1.0' encoding='utf-8'?><root><type>User</type></root>", function(s) {
            if (jQuery("status", s).text() == "ok") {
                window.open('../user/default.aspx');
            }
            else {
                alert(jQuery("body", s).text());
            }
        });
    }

    function GetWindowScreen() {
        jQuery.cookie('ClientScreenHeight', window.screen.height);
        jQuery.cookie('ClientScreenWidth', window.screen.width);
    }
    GetWindowScreen();
    SetCurrentUrl("ScreenShot/Quick.aspx");
</script>

<body id="Indexbody" onload="onload();">
    <form id="myform" runat="server">
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td colspan="5">
                <div id="content">
                    <ul id="ChannelMenuItems" runat="server">
                    </ul>
                    <div id="SubMenu" runat="server">
                    </div>
                    <div id="Announce">
                        <a href="<%= BasePath %>" target="_blank" title="网站首页">
                            <img src="<%=BasePath%>Admin/Images/Home.gif" width="37" height="14" border="0" alt="网站首页" /></a>&nbsp;<a
                                href="#" onclick="javascript:gouser();" title="进入自己的会员中心"><img src="<%=BasePath%>Admin/Images/User.gif"
                                    width="37" height="14" border="0" alt="进入自己的会员中心" /></a>&nbsp;<a href="javascript:ShowMain('Profile/MyMessageManageGuide.aspx','Profile/MyMessageManage.aspx')" title="我的短消息" ><img
                                        src="<%=BasePath%>Admin/Images/msg.gif" width="37" height="14" border="0" alt="我的短消息" /></a>&nbsp;<a
                                            id="OpenMemorandum" href="javascript:" title="打开备忘录"><img src="<%=BasePath%>Admin/Images/memorandum.gif"
                                                width="37" height="14" border="0" alt="备忘录" /></a>&nbsp;<a href="http://tech.powereasy.net/"
                                                    target="_blank" title="PowerEasy.NET 帮助"><img src="<%=BasePath%>Admin/Images/Help.gif"
                                                        width="37" height="14" border="0" alt="帮助" /></a>&nbsp;<a href="Logout.aspx" onclick="javascript:return confirm('确定要退出吗?');"
                                                            title="安全退出"><img src="<%=BasePath%>Admin/Images/Exit.gif" width="37" height="14"
                                                                border="0" alt="安全退出" /></a></div>
                </div>
            </td>
        </tr>
        <tr style="vertical-align: top;">
            <td id="frmTitle">
                <iframe tabid="1" frameborder="0" id="left" name="left" scrolling="auto" src="<%= IndexLeftUrl %>"
                    style="width: 195px; height: 800px; visibility: inherit; z-index: 2; position: relative">
        </iframe>
            </td>
            <td onclick="switchSysBar();" class="but">
                <img id="switchPoint" src="<%=StyleSheetPath%>images/butClose.gif" alt="关闭左栏" style="border: 0px;
                    width: 12px;" />
            </td>
            <td>
                <!-- 书签浏览 -->
                <div id="FrameTabs" style="overflow: hidden;">
                    <div class="tab-right" onmouseover="this.className='tab-right tab-right-over'" onmouseout="this.className='tab-right tab-right-disabled'">
                    </div>
                    <div class="tab-left" onmouseover="this.className='tab-left tab-left-over'" onmouseout="this.className='tab-left tab-left-disabled'">
                    </div>
                    <div style="width: 8000px;" class="tab-strip-wrap">
                        <ul class="tab-strip" style="float: left;">
                            <li id="iFrameTab1" class="current"><a href="javascript:"><span id="frameTabTitle">我的工作台</span><a
                                class="closeTab"><img border="0" src="<%=StyleSheetPath%>images/tab-close.gif" /></a></a>
                            </li>
                            <li id="newFrameTab"><a title="新建标签页" href="javascript:" /></a> </li>
                        </ul>
                    </div>
                </div>
                <!-- 书签结束 -->
                <div id="main_right_frame">
                    <iframe tabid="1" frameborder="0" id="main_right" name="main_right" scrolling="yes"
                        src="<%=IndexRightUrl%>" onload="SetTabTitle(this)" style="width: 1280px; height: 800px;
                        visibility: inherit; z-index: 2; overflow-x: hidden;"></iframe>
                    <div class="clearbox2" />
                </div>
            </td>
        </tr>
    </table>
    <div style="display: none" id="iframeGuideTemplate">
        <iframe tabid="0" frameborder="0" scrolling="auto" src="about:blank" style="width: 195px;
            height: 800px; visibility: inherit; z-index: 2;"></iframe>
    </div>
    <div style="display: none" id="iframeMainTemplate">
        <iframe tabid="0" frameborder="0" scrolling="yes" src="about:blank" onload="SetTabTitle(this)"
            style="width: 1280px; height: 800px; visibility: inherit; z-index: 2; overflow-x: hidden;">
    </iframe>
    </div>

    <script type="text/javascript">
        function onload() {
            var width = document.body.clientWidth - 207;
            var lHeight = document.body.clientHeight - 78;
            var rHeight = lHeight - (jQuery("#FrameTabs").height() || 0);
            document.getElementById("main_right").style.width = width > 0 ? width : 0;
            document.getElementById("main_right").style.height = rHeight > 0 ? rHeight : 0;
            document.getElementById("left").style.height = lHeight > 0 ? lHeight : 0;
            jQuery("#FrameTabs").width(width);
            if (CheckFramesScroll) { CheckFramesScroll(); }
        }
        window.onresize = onload;
        function showWarningTips() {
            setTimeout(function () { showWarningTips2(); }, 0);
        }
    </script>

    </form>
    <div id="showPop" class="popupTips" title="提示窗口">
        <iframe id="iframe_ShowPop" width="100%" frameborder="0" height="0" scrolling="no"
            marginheight="0" marginwidth="0" style="position: absolute; top: 0px; z-index: -1;
            margin: 0px; padding: 0px; border-style: none;"></iframe>
        <dl>
            <dt><a href="javascript:" onclick="javascript:ClosePop();" title="不再提示" class="tips_close">
            </a><a href="javascript:" onclick="javascript:$('#showPop').hide('slow');" title="隐藏"
                class="tips_fold"></a>温馨提示 </dt>
            <dd id="info">
            </dd>
        </dl>
    </div>
    <div id="HelpTips" class="HelpTips" title="帮助窗口">
        <div id="HelpTitle" class="HelpTitle">
            <a href="javascript:" onclick="javascript:dosomething();" title="不再提示" class="tips_close">
            </a>
            <asp:Label ID="LblHelpTitle" runat="server" />
        </div>
        <div id="HelpInfo" class="HelpInfo">
            <img src="<%=BasePath%>Admin/Images/loading.gif" alt="正在载入......" />
        </div>
        <div id="HelpTipsb" class="HelpTipsb">
            <input name="HelpShowFalse" type="checkbox" value="true" onclick="javascript:HelpShowCheck();" />以后不再显示
            <span><a href="javascript:" onclick="$('#ly').click();HelpQuicklyShow();" style="color: #FF0000;
                position: absolute; right: 2px;">快速上手....</a></span>
        </div>
    </div>
    <div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=60); opacity: 0.5;
        background-color: #777; z-index: 1000; left: 0px; display: none;">
        <iframe id="ifly" name="ifly" src="" frameborder="0" width="100%" height="100%" scrolling="no"
            marginheight="0" marginwidth="0" style="z-index: 999; filter: chroma(color=#ffffff);"></iframe>
    </div>
    <div id="HelpQuickly" class="HelpTips" title="快速上手">
        <div id="QuicklyTitle" class="HelpTitle">
            <a href="javascript:" onclick="javascript:$('#ly').click();" title="不再提示" class="tips_close">
            </a><span>快速上手</span>
        </div>
        <div id="QuicklyInfo" class="QuicklyInfo">
            <img src="<%=BasePath%>Admin/Images/loading.gif" alt="正在载入......" />
        </div>
        <div id="QuicklyTipsb" class="HelpTipsb">
        </div>
    </div>
    <div id="Memorandum" class="HelpTips" title="备忘录">
        <div id="MemorandumTitle" class="HelpTitle">
            <a href="javascript:" onclick="javascript:$('#ly').click();" title="关闭" class="tips_close">
            </a><span>备忘录</span>
        </div>
        <div id="MemorandumInfo" class="HelpInfo" height="350px">
            <iframe id="IframeMemorandum" src="Profile/Memorandum.aspx" marginheight="0" marginwidth="0"
                frameborder="0" width="455" height="225" scrolling="no"></iframe>
            <br />
            注：在你修改了备注的内容后将会自动保存。
        </div>
    </div>
    <div id="WarningTips" class="HelpTips">
        <div id="WarningTitle" class="HelpTitle">
            <a href="javascript:" onclick="javascript:$('#WarningTips').hide();$('#bgWarning').hide();" title="关闭" class="tips_close">
            </a>
            <asp:Label ID="Label1" runat="server" Text="温馨提示" />
        </div>
        <div id="WarningInfo" class="HelpInfo">
            <p style="padding-right: 20px;line-height:160%">
                <span style="color:Blue;">注意：</span>检测到网站没有启用<a style="color: red; font-weight: bold;" href="javascript:parent.PE_FrameTab.AddNew('<%=BasePath+PowerEasy.Foundation.SiteConfig.SiteOption.ManageDir+"/" %>Configuration/LabelSecurityConfig.aspx')">标签白名单</a>，高风险的标签将不受限制。
                <br /><br />
                &nbsp;&nbsp;由于含有SuperSQL参数（SQL超级参数类型）的标签具有较高的数据库查询权限，容易产生SQL注入漏洞，属于高风险的标签，为了网站安全，请启用标签白名单，启用后系统将会禁止此类标签的运行，如要继续安全使用，有以下处理方法：
                <br />
                &nbsp;&nbsp;（1）将标签中的SuperSQL参数替换成其它类型的参数。
                <br />
                &nbsp;&nbsp;（2）如不能替换，则可以在确保标签安全的前提下将其放入白名单中。
                <br />
                <ul style="line-height: 150%;padding-left:10px;">
                    <li>开启白名单，请到“系统设置 >> 网站配置 >> <a href="javascript:parent.PE_FrameTab.AddNew('<%=BasePath+ PowerEasy.Foundation.SiteConfig.SiteOption.ManageDir+"/" 

    %>Configuration/LabelSecurityConfig.aspx')">标签安全配置</a>”进行操作。</li>
                    <li>操作白名单，请到“系统设置 >> 模板标签管理 >> <a href="javascript:parent.PE_FrameTab.AddNew('<%=BasePath+ PowerEasy.Foundation.SiteConfig.SiteOption.ManageDir+"/" 

    %>Template/LabelManage.aspx')">标签管理</a>”，把允许使用 SuperSQL 参数的标签添加至白名单中，这会使它免检查运行。</li>
                </ul>
            </p>
        </div>
        <div id="WarningTipsb" class="HelpTipsb">
            <input name="WarningShowFalse" type="checkbox" value="true" onclick="changeWarningState(this);" />以后不再显示
            <span><a href="javascript:" onclick="$('#WarningTips').hide();$('#bgWarning').hide();" style="position: absolute; right: 8px;color: #FF0000;">关闭</a></span>
        </div>
    </div>
    <div id="bgWarning" style="display: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 1000; filter: alpha(opacity=60); opacity: 0.5; background-color: #777;"></div>
    <script type="text/javascript">
        //移动窗口部份
        var posX, posY, fdiv;

        document.getElementById("HelpTitle").onmousedown = moveFloatingDiv;
        document.getElementById("MemorandumTitle").onmousedown = moveFloatingDiv;
        document.getElementById("QuicklyTitle").onmousedown = moveFloatingDiv;
        function moveFloatingDiv(e) {
            if (!e) e = window.event;  //如果是IE
            fdiv = this.parentNode;
            posX = e.clientX - parseInt(fdiv.style.left);
            posY = e.clientY - parseInt(fdiv.style.top);
            document.onmousemove = mousemove;
        }

        document.onmouseup = function() {
            document.onmousemove = null;
        }

        function mousemove(ev) {
            if (ev == null) ev = window.event; //如果是IE
            fdiv.style.left = (ev.clientX - posX) + "px";
            fdiv.style.top = (ev.clientY - posY) + "px";
        }


        //写入Cookie
        function setCookie(name, value, expires, path, domain, secure) {
            var today = new Date();
            today.setTime(today.getTime());
            if (expires) {
                expires = expires * 1000 * 60 * 60 * 24;
            }
            var expires_date = new Date(today.getTime() + (expires)); document.cookie = name + '=' + escape(value) + ((expires) ? ';expires=' + expires_date.toGMTString() : '') + ((path) ? ';path=' + path : '') + ((domain) ? ';domain=' + domain : '') + ((secure) ? ';secure' : '');
        }

        //得到Cookie
        function getCookie(name) {
            if (document.cookie.length > 0) {
                cookieStart = document.cookie.indexOf(name + "=")
                if (cookieStart != -1) {
                    cookieStart = cookieStart + name.length + 1
                    cookieEnd = document.cookie.indexOf(";", cookieStart)
                    if (cookieEnd == -1) cookieEnd = document.cookie.length
                    return unescape(document.cookie.substring(cookieStart, cookieEnd))
                }
            }
            return ""
        }

        //类哈希表保存边侧栏状态
        function Hashtable() {
            this._hash = new Object();
            this.add = function(key, value) {
                if (typeof (key) != "undefined") {
                    if (this.contains(key) == false) {
                        this._hash[key] = typeof (value) == "undefined" ? null : value;
                        return true;
                    } else {
                        return false;
                    }
                } else {
                    return false;
                }
            }
            this.remove = function(key) { delete this._hash[key]; }
            this.count = function() { var i = 0; for (var k in this._hash) { i++; } return i; }
            this.items = function(key) { return this._hash[key]; }
            this.contains = function(key) { return typeof (this._hash[key]) != "undefined"; }
            this.clear = function() { for (var k in this._hash) { delete this._hash[k]; } }
            this.tostring = function() { var output = ""; for (var k in this._hash) { if (output) output += "&"; output += k + ":" + this._hash[k]; } return output; }
        }

        var _hashtable = new Hashtable();
        function ToHashtable(string) {
            var _hashdate = string.split("&");
            for (var _kv in _hashdate) {
                kv = _hashdate[_kv].split(":");
                _hashtable.add(kv[0], kv[1]);
            }
        }

        function createSideBarCookie() {
            var key = document.getElementById("left").src.substring(document.getElementById("left").src.lastIndexOf('/') + 1, document.getElementById("left").src.lastIndexOf('.'));
            var value = "";
            if (document.getElementById("frmTitle")) {
                if (document.getElementById("frmTitle").style.display == "") {
                    value = "block";
                }
                else {
                    value = document.getElementById("frmTitle").style.display;
                }
            }
            var sideBarCookie = getCookie("PE_SideBarCookie");
            if (value) {
                ToHashtable(sideBarCookie);
                _hashtable.remove(key, value);
                _hashtable.add(key, value);
                setCookie("PE_SideBarCookie", _hashtable.tostring(), 300, "/", "", false);
            }
        }

        function initSideBarState() {
            var sideBarCooke = getCookie("PE_SideBarCookie");
            var key = document.getElementById("left").src.substring(document.getElementById("left").src.lastIndexOf('/') + 1, document.getElementById("left").src.lastIndexOf('.'));
            if (sideBarCooke && key) {
                _hashtable.clear;
                ToHashtable(sideBarCooke);
                if (_hashtable.contains(key)) {
                    changeSideBarState(_hashtable.items(key));
                }
            }
            else {
                var obj = document.getElementById("switchPoint");
                obj.alt = "关闭左栏";
                obj.src = "<%=StyleSheetPath%>Images/butClose.gif";
                document.getElementById("frmTitle").style.display = "block";
                onload();
            }
        }

        function changeSideBarState(state) {
            var obj = document.getElementById("switchPoint");
            if (state == "none") {
                obj.alt = "打开左栏";
                obj.src = "<%=StyleSheetPath%>Images/butOpen.gif";
                document.getElementById("frmTitle").style.display = "none";
                var width, height;
                width = document.body.clientWidth - 12;
                height = document.body.clientHeight - 70;
                document.getElementById("main_right").style.height = height;
                document.getElementById("main_right").style.width = width;
                document.getElementById("FrameTabs").style.width = width;
                if (CheckFramesScroll) { CheckFramesScroll(); }
            }
            else {
                obj.alt = "关闭左栏";
                obj.src = "<%=StyleSheetPath%>Images/butClose.gif";
                document.getElementById("frmTitle").style.display = "block";
                onload();
            }
        }

        function changeWarningState(obj) {
            setCookie("PE_ShowWarning", !obj.checked, 30, "/", "", false);
        }
        function showWarningTips2() {
            $("#WarningTips").css("left", (document.body.clientWidth - 500) / 2 + document.body.scrollLeft)
                .css("top", (document.body.clientHeight - 300) / 2 + document.body.scrollTop)
                .css("display", "block");
            $("#bgWarning").css("display", "block")
                .unbind().click(function () { $("#WarningTips").hide(); $(this).hide(); });
        }
    </script>

</body>
</html>
