<%@ page language="C#" autoeventwireup="true" inherits="ims.web.editLayout, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="editLayout">
<head runat="server"><title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body class="waiting" onbeforeunload="confirmExit();">
    <div class="hide"><img src="images/loading.gif" />处理中，请稍候 …</div>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="sm" runat="server" EnablePageMethods="true" OnAsyncPostBackError="AsyncError" />
        <asp:HiddenField runat="server" ID="hfName" />
        <div id="body">
            <table><tr>
                <td class="vbottom">
                    <span id="layoutTitle" runat="server"></span>
                    <asp:UpdatePanel ID="layoutList" RenderMode="Inline" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
                        <ContentTemplate><span runat="server" id="spanddl">：<asp:DropDownList runat="server" ID="ddlLayouts" AutoPostBack="true" onfocus="setOldValue();" onchange="return layoutsChanged();" OnSelectedIndexChanged="ddlLayoutsChanged"></asp:DropDownList></span></ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr></table>
            <asp:UpdatePanel ID="content" RenderMode="Block" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional" />
            <div class="mtop_s" id="divMode">
                <asp:RadioButton runat="server" ID="rbEdit" GroupName="mode" Text="编辑模式" Checked="true" onclick="changeMode();" />
                <asp:RadioButton runat="server" ID="rbDrag" GroupName="mode" Text="拖拽模式" onclick="changeMode();" />
            </div>
            <asp:UpdatePanel ID="upBtns" RenderMode="Block" runat="server" UpdateMode="Conditional" class="bigger">
                <ContentTemplate>
                    <asp:Button ID="btnSave" runat="server" OnClientClick="return doValidate();" AccessKey="S" ToolTip="保存当前的表单版式&#13;快捷键：Alt+S" Text="保存" OnClick="Save" CssClass="btn" />
                    <asp:Button ID="btnAdd" runat="server" OnClientClick="return toAddNew();" Text="添加版式" OnClick="AddNew" CssClass="btn" />
                    <input type="button" runat="server" id="btnManage" value="管理版式" onserverclick="toManage" class="btn" />
                    <input type="button" accesskey="B" onclick="toBack();" value="返回" class="btn" />
                    <input type="button" value="帮助" class="btn" onclick="showHelp();" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <div id="rightBar">
            <ul>
	            <li><a href="#divFields">字段</a></li>
	            <li><a href="#tabTemplets">表</a></li>
            </ul>
            <asp:UpdatePanel ID="divFields" RenderMode="Block" runat="server" UpdateMode="Conditional" />
            <asp:UpdatePanel ID="tabTemplets" RenderMode="Block" runat="server" UpdateMode="Conditional" />
        </div>

        <ims:Pop runat="server" ID="manage" Title="管理版式" ShowOkButton="false" HelpSubject="editLayoutManage" OnClientUpdated="setBtnSave();" CanelButtonText="关闭" Width="420" CustomCss="noline" ShowProgress="false">
            <ContentTemplate>
                <table class="normal" id="layouts">
                    <tr><th>版 式</th><th style="width:60px">设为默认</th><th style="width:32px">更名</th><th style="width:32px">编辑</th><th style="width:32px">删除</th></tr>
                    <asp:PlaceHolder runat="server" ID="phLayouts"></asp:PlaceHolder>
                </table>
                <fieldset class="mtop_n mbottom_s"><legend>默认版式规则</legend>
                    <div class="padbox">
                        <ol runat="server" id="olRules" class="olRules"></ol>
                        <div class="right"><a href="#" id="aAddRule" onclick="return toAddRule();" runat="server" onserverclick="ToAddRule" class="u">添加规则</a></div>
                    </div>
                </fieldset>
                <asp:CheckBox runat="server" ID="cbDisChange" Text="禁止普通用户切换版式" onclick="switchChange();" />
            </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="rule" ShowProgress="false" CustomCss="noline" OnClientUpdated="setTimeout(initRule,0);" OnOkClick="SaveRule" HideOnOkClientClick="false">
            <ContentTemplate>
                <table class="fixedLayout">
                    <tr><td class="ruleKey">指定角色：</td><td><asp:TextBox runat="server" ID="tbRoles" TextMode="MultiLine" Rows="3" Width="99%" acfid="RoleName" chars=";；,，、" ToolTip="输入角色名。多项之间以逗号、分号或顿号分隔"></asp:TextBox></td></tr>
                    <tr><td class="ruleKey">默认版式：</td><td><asp:DropDownList runat="server" ID="ddlAll"></asp:DropDownList></td></tr>
                </table>
            </ContentTemplate>
        </ims:Pop>
        <asp:Button runat="server" ID="btnOpera" OnClick="OperaLayout" CssClass="hide" />
    <script src="js/comm.js"></script><script src="js/editLayout.js"></script>
    </form>
</body>
</html>