<%@ page language="C#" autoeventwireup="true" inherits="ims.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" /><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body class="waiting" onbeforeunload="confirmExit(event);">
    <div class="hide"><div class="loadbar"><div></div><div></div><div></div><div></div><div></div></div></div>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="sm" runat="server" EnablePageMethods="true" OnAsyncPostBackError="AsyncError">
            <CompositeScript Path="js/msajax.js" ScriptMode="Release">
                <Scripts>
                    <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" /><asp:ScriptReference Name="MicrosoftAjax.js" /><asp:ScriptReference Name="MicrosoftAjaxWebForms.js" />
                </Scripts>
            </CompositeScript>
        </asp:ScriptManager>
        <asp:HiddenField runat="server" ID="hfName" />
        <div class="msgarea monly">若需编辑版式，请在电脑上操作！</div>
        <div id="body">
            <div class="pconly">
            <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 id="divMode" class="mtop_s">
                <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>
            </div>
            <asp:UpdatePanel ID="upBtns" RenderMode="Block" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Button ID="btnSave" runat="server" OnClientClick="return doValidate();" ToolTip="保存当前的表单版式" Text="保存" OnClick="Save" CssClass="btn pconly" />
                    <asp:Button ID="btnAdd" runat="server" OnClientClick="return toAddNew();" Text="添加版式" OnClick="AddNew" CssClass="btn pconly" />
                    <input type="button" runat="server" id="btnManage" value="管理版式" onserverclick="toManage" class="btn" />
                    <input type="button" onclick="toBack();" value="返回" class="btn" />
                    <input type="button" value="帮助" class="btn pconly" onclick="showHelp();" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <div id="rightBar" class="pconly">
            <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>
        <div class="hidden clear"></div>

        <ims:Pop runat="server" ID="manage" Title="管理版式" ShowOkButton="false" CustomButtonB_Text="设置扫码输入" CustomButtonB_OnClick="ShowPop('scan_popup');" CustomButtonA_Text="设置保存后动作" CustomButtonA_OnClick="ShowPop('act_popup');"  HelpSubject="editLayoutManage" CanelButtonText="关闭" OnClientUpdated="setBtnSave();" Width="420">
            <ContentTemplate>
                <table class="normal" id="layouts">
                    <tr><th>版式</th><th style="width:32px">默认</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" runat="server" onserverclick="ToAddRule">添加规则</a></div>
                    </div>
                </fieldset>
                <asp:CheckBox runat="server" ID="cbDisChange" Text="禁止普通用户切换版式" onclick="switchChange();" />
            </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="rule" OnClientUpdated="setTimeout(initRule,0);" OnOkClick="SaveRule" HideOnOkClientClick="false">
            <ContentTemplate>
                <fieldset><legend>以下情况使用：<asp:DropDownList runat="server" ID="ddlAll"></asp:DropDownList></legend>
                    <div id="rulediv" class="notfocus">
                        <asp:CheckBox runat="server" ID="cbRoles" Text="角色：" /><asp:TextBox runat="server" ID="tbRoles" acfid="RoleName" chars=";；、,，" ToolTip="输入角色名。多项之间以逗号、分号或顿号分隔"></asp:TextBox>
                        <asp:RadioButtonList runat="server" ID="rblOpera" CssClass="rblCond" RepeatLayout="Flow" RepeatDirection="Horizontal"><asp:ListItem Value="And">并且</asp:ListItem><asp:ListItem Value="Or" Selected="True">或者</asp:ListItem></asp:RadioButtonList>
                        <asp:CheckBox runat="server" ID="cbDevice" Text="设备：" /><asp:DropDownList runat="server" ID="ddlDevice"><asp:ListItem Value="PC">电脑</asp:ListItem><asp:ListItem Value="Mobile" Selected="True">移动设备</asp:ListItem></asp:DropDownList>
                    </div>
                </fieldset>
            </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="act" Width="400" OnClientUpdated="posUrlBox();" HideOnOkClientClick="false" OnOkClick="SaveActionSetting" CustomCss="notfocus">
            <ContentTemplate>
                <fieldset><legend>新建时，保存后的动作：</legend>
                    <asp:RadioButtonList runat="server" ID="actsAdd" RepeatDirection="Vertical" RepeatColumns="1" RepeatLayout="UnorderedList" CssClass="acts">
                        <asp:ListItem Value="0" Selected="True">由操作者决定</asp:ListItem>
                        <asp:ListItem Value="2">新建</asp:ListItem>
                        <asp:ListItem Value="3">返回</asp:ListItem>
                        <asp:ListItem Value="4">浏览</asp:ListItem>
                        <asp:ListItem Value="5">跳转到：</asp:ListItem>
                    </asp:RadioButtonList><asp:TextBox runat="server" ID="tbUrlAdd" title="输入目标地址" Width="240" /><i title="查看解释" onclick="What('redirect')" class="what"></i>
                </fieldset>
                <fieldset class="mtop_n"><legend>编辑时，保存后的动作：</legend>
                    <asp:RadioButtonList runat="server" ID="actsEdit" RepeatDirection="Vertical" RepeatColumns="1" RepeatLayout="UnorderedList" CssClass="acts">
                        <asp:ListItem Value="0" Selected="True">由操作者决定</asp:ListItem>
                        <asp:ListItem Value="2">新建</asp:ListItem>
                        <asp:ListItem Value="3">返回</asp:ListItem>
                        <asp:ListItem Value="4">浏览</asp:ListItem>
                        <asp:ListItem Value="5">跳转到：</asp:ListItem>
                    </asp:RadioButtonList><asp:TextBox runat="server" ID="tbUrlEdit" title="输入目标地址" Width="240" /><i title="查看解释" onclick="What('redirect')" class="what"></i>
                </fieldset>
            </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="scan" OnOkClick="SaveScanset" HelpSubject="EditScan">
            <ContentTemplate>
                扫码输入：<asp:DropDownList runat="server" ID="ddlScan"></asp:DropDownList>
                <div class="sepline"></div>
                <asp:CheckBox runat="server" ID="cbScan" Text="扫码后自动保存" />
            </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>