<%@ page language="C#" autoeventwireup="true" inherits="admin_label_AssistantLabel, DianCMS" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>


<%@ Import Namespace="D.BLL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>模型辅助标签</title>
    <link id="CssName" rel="stylesheet" type="text/css" runat="server" />
    <script type="text/javascript" src="../../js/<%=B_Lang.getLang() %>/label.js"></script>
    <script src="../../js/Common.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        var api = frameElement.api, W = api.opener;
        function Select(obj, Id, Name) {
            DianCMS_$(obj + "Name").value = Name;
            DianCMS_$(obj + "Id").value = Id;
        }

        function ListLayout(obj, Id) {
            var TypeCount = document.getElementsByName(obj.id);
            var p = 0;
            if (navigator.appName == "Microsoft Internet Explorer") {
                p = 1;
            }
            for (var i = p; i < TypeCount.length; i++) {
                if (TypeCount[i].checked) {
                    var DivType = eval("Layout_" + Id + "_1");
                    if (TypeCount[i].value == "div") {
                        DivType.style.display = "";
                        Direction(Id);
                    }
                    else {
                        DivType.style.display = "none";
                    }
                }
            }
        }

        function Direction(Id) {
            var DivType2 = eval("Layout_" + Id + "_2");
            var DivType3 = eval("Layout_" + Id + "_3");
            var c = document.getElementsByName("RadDirectionList_" + Id + "");
            var p = 0;
            if (navigator.appName == "Microsoft Internet Explorer") {
                p = 1;
            }
            for (var i = p; i < c.length; i++) {
                if (c[i].checked) {
                    if (c[i].value == "H") {
                        DivType2.style.display = "none";
                        DivType3.style.display = "none";
                    }
                    else {
                        DivType2.style.display = "";
                        DivType3.style.display = "";
                    }
                }
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table class="border" cellspacing="1" cellpadding="0" width="99%" border="0" align="center" style="margin-top:5px;">
                <tr>
                    <td class="bqleft">
                        相关内容关联模型：
                    </td>
                    <td class="bqright" height="28">
                        <asp:CheckBoxList ID="CheckModel" runat="server" RepeatDirection="Horizontal" RepeatColumns="4"
                            AutoPostBack="True" OnSelectedIndexChanged="CheckModel_SelectedIndexChanged">
                        </asp:CheckBoxList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        调用数据：
                    </td>
                    <td class="bqright" height="28">
                        <asp:TextBox ID="txtInfoNum" runat="server" CssClass="in1" Rows="30" Text="10" Columns="10"></asp:TextBox>
                        条 如果为0则显示所有数据
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        布局方式：
                    </td>
                    <td class="bqright" height="28">
                        <asp:RadioButtonList ID="Layout" runat="server" RepeatDirection="Horizontal" onclick="ListLayout(this,'1')">
                            <asp:ListItem Value="table" Selected="True">普通表格</asp:ListItem>
                            <asp:ListItem Value="div">Div+Css</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr style="display: none" id="Layout_1_1">
                    <td class="bqleft">
                        排列方式：
                    </td>
                    <td class="bqright" height="28">
                        <asp:RadioButtonList ID="RadDirectionList_1" runat="server" RepeatDirection="Horizontal"
                            onclick="Direction('1')">
                            <asp:ListItem Value="H" Selected="True">横向排列</asp:ListItem>
                            <asp:ListItem Value="V">纵向排列</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr id="Layout_1_2">
                    <td class="bqleft">
                        内容列表列数：
                    </td>
                    <td class="bqright" height="28">
                        <asp:TextBox ID="txtColumn" runat="server" CssClass="in1" Rows="30" Text="1" Columns="10"></asp:TextBox>
                    </td>
                </tr>
                <tr id="Layout_1_3" style="display: none">
                    <td class="bqleft">
                        列控制代码：
                    </td>
                    <td class="bqright" height="28">
                        &lt;<asp:TextBox ID="txtDivRepP" runat="server" Text="p" Columns="4" CssClass="in1"></asp:TextBox>
                        id="<asp:TextBox ID="txtDivRepId" runat="server" Columns="4" CssClass="in1"></asp:TextBox>"
                        class="<asp:TextBox ID="txtDivRepClass" runat="server" Columns="4" CssClass="in1"></asp:TextBox>"&gt;
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        引用样式：
                    </td>
                    <td class="bqright" height="28">
                        <asp:DropDownList ID="DropStyle" runat="server">
                            <asp:ListItem Value="0">选择样式</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <asp:Repeater ID="RepField" runat="server" OnItemDataBound="RepField_ItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td class="bqleft">
                                <asp:TextBox ID="txtModelId" runat="server" Text='<%#Eval("ModelId") %>' Style="display: none"></asp:TextBox><%#Eval("ModelName") %>：
                            </td>
                            <td class="bqright">
                                <table align="center" cellpadding="2" cellspacing="1" width="99%" class="border">
                                    <tr class="title">
                                        <td>
                                            关键词相关内容字段
                                        </td>
                                        <td>
                                            内容链接字段
                                        </td>
                                        <td>
                                            内容链接方式
                                        </td>
                                    </tr>
                                    <tr class="tdMoveTr" onmouseover="this.className='tdMoveTrBg'" onmouseout="this.className='tdMoveTr'">
                                        <td>
                                            <asp:ListBox ID="FieldList" runat="server" Rows="5" SelectionMode="Multiple" Width="125px"
                                                title="按住“Ctrl”或“Shift”键可以多选，按住“Ctrl”可取消选择"></asp:ListBox>
                                        </td>
                                        <td>
                                            <asp:ListBox ID="FieldList2" runat="server" Rows="5" SelectionMode="Single" Width="125px">
                                            </asp:ListBox>
                                        </td>
                                        <td>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:RadioButtonList ID="RadCreateType" runat="server">
                                                            <asp:ListItem Value="1" Selected="True">按模型</asp:ListItem>
                                                            <asp:ListItem Value="2">按栏目字段</asp:ListItem>
                                                        </asp:RadioButtonList>
                                                        <asp:DropDownList ID="DropColumn" runat="server">
                                                            <asp:ListItem Value="0">选择栏目</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                <tr>
                    <td class="bqleft">
                        排序方式：
                    </td>
                    <td class="bqright" height="28">
                        <asp:DropDownList ID="DropOrder" runat="server">
                            <asp:ListItem Value="addtime desc">添加日期降序</asp:ListItem>
                            <asp:ListItem Value="addtime asc">添加日期升序</asp:ListItem>
                            <asp:ListItem Value="click desc">文章点击降序</asp:ListItem>
                            <asp:ListItem Value="click asc">文章点击升序</asp:ListItem>
                            <asp:ListItem Value="Id desc">自动编号降序</asp:ListItem>
                            <asp:ListItem Value="Id asc">自动编号升序</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        说明：
                    </td>
                    <td class="bqright" height="28">
                        相关内容是根据该内容中的【关键字】字段进行查找，如模型中没有选择【关键字】字段，结果将返回空.
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                    </td>
                    <td class="bqright" height="40">
                        <asp:Button ID="Button1" runat="server" Text=" 确认 " CssClass="btn radius30 pad_0_30" OnClick="Button1_Click" /><input id="Button6" type="button" value=" 取消 " onclick="frameElement.api.close();"
                    class="btn radius30 pad_0_30" style="margin-left: 20px" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="Button1" />
        </Triggers>
    </asp:UpdatePanel>
    </form>
</body>
</html>
