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

<%@ Import Namespace="D.BLL" %>
<%@ Import Namespace="D.Common" %>
<!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 src="../../js/Common.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../js/Dragdrop.js"></script>

    <script type="text/javascript" src="../../js/<%=B_Lang.getLang() %>/Copy.js"></script>
    <script src="../../js/lhgdialog/lhgcore.lhgdialog.min.js?self=true&skin=<%=Function.GetCssNameColor()%>" type="text/javascript"></script>

    <script type="text/javascript">
        function LinkType(val) {
            switch (val) {
                case "1":
                    DianCMS_$("DivLink").style.display = "";
                    DianCMS_$("DivDataSource").style.display = "none";
                    DianCMS_$("DivDataSource_1").style.display = "none";
                    break;
                case "2":
                    DianCMS_$("DivLink").style.display = "none";
                    DianCMS_$("DivDataSource").style.display = "";
                    DianCMS_$("DivDataSource_1").style.display = "";
                    break;
            }
        }

        function CreateRange2(a, b) {
            var c = '&lt;%# Eval("' + b + '")%&gt;';
            CreateRange(a, c.replace("&lt;", "<").replace("&gt;", ">"));
        }
    </script>

</head>
<body onmousemove="dragmove();" onmouseup="dragclear()">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <table class="dh" cellpadding="0" cellspacing="0" border="0" align="center">
        <tr>
            <td>
                <asp:Image ID="P_Go" runat="server" ImageAlign="AbsMiddle" />
                您现在的位置：<a href="../info.aspx">后台管理</a> >> <a href="vslabellist.aspx">VS Free标签列表</a>
                >> 设置VS Free标签
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table class="border" cellspacing="1" cellpadding="0" width="99%" border="0" align="center">
                <tr>
                    <td class="bqleft">
                        <font color="#ff0066">*</font>标签名称：
                    </td>
                    <td class="bqright">
                        <font color="red">{D_VS_</font>
                        <asp:TextBox ID="txtName" runat="server" CssClass="in1" Columns="50"></asp:TextBox><font
                            color="red">}</font>
                        <asp:DropDownList ID="Class" runat="server">
                            <asp:ListItem Value="0">选择分类</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        连接类型：
                    </td>
                    <td class="bqright">
                        <asp:DropDownList ID="DropLinkType" runat="server" onchange="LinkType(this.value)">
                            <asp:ListItem Value="1">外部链接</asp:ListItem>
                            <asp:ListItem Value="2">数据源</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tbody id="DivLink" runat="server">
                    <tr>
                        <td class="bqleft">
                            连接地址：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtOutUrl" runat="server" Columns="50" CssClass="in1">http://</asp:TextBox>
                            本地路径：不带虚拟目录以"/"开始的绝对路径
                        </td>
                    </tr>
                </tbody>
                <tbody style="display: none" id="DivDataSource" runat="server">
                    <tr>
                        <td class="bqleft">
                            <font color="#ff0066">*</font>选择数据源：
                        </td>
                        <td class="bqright">
                            <asp:DropDownList ID="DropDataSource" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDataSource_SelectedIndexChanged">
                                <asp:ListItem Value="0">选择数据源</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            选择控件：
                        </td>
                        <td class="bqright">
                            <asp:RadioButtonList ID="RadControl" runat="server" RepeatDirection="Horizontal"
                                AutoPostBack="True" OnSelectedIndexChanged="RadControl_SelectedIndexChanged">
                                <asp:ListItem Value="Repeater" Selected="True">多行单列</asp:ListItem>
                                <asp:ListItem Value="DataList">多行多列</asp:ListItem>
                                <asp:ListItem Value="DropDownList">下拉列表框</asp:ListItem>
                                <asp:ListItem Value="RadioButtonList">单选列表</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr style="display: none" runat="server" id="DataList_1">
                        <td class="bqleft">
                            显示列数：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtColumn" runat="server" CssClass="in1" Rows="30" Text="1" Columns="10"></asp:TextBox>
                        </td>
                    </tr>
                    <tr style="display: none" runat="server" id="DataList_2">
                        <td class="bqleft">
                            项的布局方向：
                        </td>
                        <td class="bqright">
                            <asp:RadioButtonList ID="RadDirection" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="Horizontal" Selected="True">横向</asp:ListItem>
                                <asp:ListItem Value="Vertical">纵向</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr style="display: none" runat="server" id="DataList_3">
                        <td class="bqleft">
                            输出格式：
                        </td>
                        <td class="bqright">
                            <asp:RadioButtonList ID="RadioRepeatLayout" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="Table" Selected="True">Table</asp:ListItem>
                                <asp:ListItem Value="Flow">Flow</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            控件名称：
                        </td>
                        <td class="bqright">
                            <table cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td>
                                        <asp:RadioButtonList ID="IsDefault" runat="server">
                                            <asp:ListItem Value="True" Selected="True">系统默认</asp:ListItem>
                                            <asp:ListItem Value="False">自定义</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td>
                                    <td valign="bottom">
                                        <asp:TextBox ID="txtControlId" runat="server" CssClass="in1"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    </tr>
                </tbody>
                <tbody style="display: none" id="DivDataSource_1" runat="server">
                    <tr runat="server" id="Repeater_1">
                        <td class="bqleft">
                            标签模板：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtTemplate" runat="server" Columns="50" CssClass="in1" style="float:left" Text="/系统模板/vsfree_多行单列模板.html"></asp:TextBox>
                    <input id="Button25" type="button" value="选择模板" class="btn" style="float:left" onclick="WinOpenLhgDialog('选择模板','../template/SelectTemplate.aspx?ControlId=txtTemplate',650,450,'')" />
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            标题模板：
                        </td>
                        <td class="bqright">
                            <input id="Button11" type="button" value="<table>" class="btn" onclick="Win_Open('../common/table.aspx?Control=txtHeaderHtml','','550','415')" />
                            <input id="Button14" type="button" value="<div>" class="btn" onclick="Win_Open('../common/div.aspx?Control=txtHeaderHtml','','550','150')" />
                            <input id="Button12" type="button" value="<tr/>" class="btn" onclick="CreateRange('txtHeaderHtml','<tr></tr>')" />
                            <input id="Button13" type="button" value="<td/>" class="btn" onclick="CreateRange('txtHeaderHtml','<td></td>')" />
                            <input id="Button9" type="button" value="<div/>" class="btn" onclick="CreateRange('txtHeaderHtml','<div></div>')" />
                            <input id="Button10" type="button" value="<ul/>" class="btn" onclick="CreateRange('txtHeaderHtml','<ul></ul>')" />
                            <input id="Button15" type="button" value="<li/>" class="btn" onclick="CreateRange('txtHeaderHtml','<li></li>')" />
                            <input id="Button16" type="button" value="<span/>" class="btn" onclick="CreateRange('txtHeaderHtml','<span></span>')" />
                            <input id="Button17" type="button" value="<font/>" class="btn" onclick="CreateRange('txtHeaderHtml','<font></font>')" />
                            <input id="Button18" type="button" value="<p>" class="btn" onclick="CreateRange('txtHeaderHtml','<p></p>')" /><br />
                            <asp:TextBox ID="txtHeaderHtml" runat="server" TextMode="MultiLine" Width="99%"
                                Height="150"></asp:TextBox>
                            <table width="99%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td bgcolor="#e0dfe3" align="right">
                                        <a href="javascript:" onclick="runEx('txtHeaderHtml')">
                                            <img src="../images/PreView.gif" border="0" title="预览录入界面" /></a> <a href="javascript:"
                                                onclick="copyToClipboard(document.form1.txtHeaderHtml.value)">
                                                <img src="../images/copy.gif" border="0" title="复制录入界面" style="margin-left: 20px" /></a>
                                        <a href="javascript:" onclick="SizePlus('txtHeaderHtml')" title="增加编辑高度">
                                            <img src="../images/sizeplus.gif" border="0" style="margin-left: 20px;" /></a>
                                        <a href="javascript:" onclick="SizeMinus('txtHeaderHtml')">
                                            <img src="../images/sizeminus.gif" border="0" title="减少编辑高度" style="margin-left: 20px;
                                                margin-right: 20px" /></a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            选择字段：
                        </td>
                        <td class="bqright">
                            <asp:DataList ID="DataList1" runat="server" RepeatColumns="6" RepeatDirection="Horizontal"
                                Width="100%">
                                <ItemStyle Width="13%" />
                                <ItemTemplate>
									<div onclick="CreateRange2('txtItemHtml','<%# Eval("FieldName") %>')" class="fieldstyle" title="点击选择该字段到搜索样式">
                                        <%# Eval("FieldName")%>
                                    </div>
                                </ItemTemplate>
                            </asp:DataList>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            <font color="#ff0066">*</font>循环行模板：
                        </td>
                        <td class="bqright">
                            <input id="Button2" type="button" value="<table>" class="btn" onclick="Win_Open('../common/table.aspx?Control=txtItemHtml','','550','415')" />
                            <input id="Button5" type="button" value="<div>" class="btn" onclick="Win_Open('../common/div.aspx?Control=txtItemHtml','','550','150')" />
                            <input id="Button3" type="button" value="<tr/>" class="btn" onclick="CreateRange('txtItemHtml','<tr></tr>')" />
                            <input id="Button4" type="button" value="<td/>" class="btn" onclick="CreateRange('txtItemHtml','<td></td>')" />
                            <input id="Button19" type="button" value="<div/>" class="btn" onclick="CreateRange('txtItemHtml','<div></div>')" />
                            <input id="Button20" type="button" value="<ul/>" class="btn" onclick="CreateRange('txtItemHtml','<ul></ul>')" />
                            <input id="Button21" type="button" value="<li/>" class="btn" onclick="CreateRange('txtItemHtml','<li></li>')" />
                            <input id="Button22" type="button" value="<span/>" class="btn" onclick="CreateRange('txtItemHtml','<span></span>')" />
                            <input id="Button23" type="button" value="<font/>" class="btn" onclick="CreateRange('txtItemHtml','<font></font>')" />
                            <input id="Button24" type="button" value="<p>" class="btn" onclick="CreateRange('txtItemHtml','<p></p>')" />
                            <div style="margin-top:2px;"></div>
                            <input id="Button6" type="button" value="字符截取" class="btn" onclick="CreateRange('txtItemHtml','&lt;%# GetLength(Eval(&quot;Title&quot;,&quot;{0}&quot;),30)%&gt;')"
                                title="Title：字段名称,修改成您需要截取的字段名&#10;30：截取字符串长度,以字节单位" />
                            <input id="Button8" type="button" value="内容解码" class="btn"  onclick="CreateRange('txtItemHtml','&lt;%# Function.HtmlDecode(Eval(&quot;Content&quot;,&quot;{0}&quot;))%&gt;')" />
                            <input id="Button7" type="button" value="内容URL" class="btn" runat="server" visible="false" />
                            <input id="Button8" type="button" value="时间格式化" class="btn" onclick="CreateRange('txtItemHtml','&lt;%# Eval(&quot;AddTime&quot;,&quot;{0:yyyy-MM-dd}&quot;)%&gt;')"/>
                            <asp:TextBox ID="txtItemHtml" runat="server" TextMode="MultiLine" Width="99%" Height="200"></asp:TextBox>
                            <table width="99%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td bgcolor="#e0dfe3" align="right">
                                        <a href="javascript:" onclick="runEx('txtItemHtml')">
                                            <img src="../images/PreView.gif" border="0" title="预览录入界面" /></a> <a href="javascript:"
                                                onclick="copyToClipboard(document.form1.txtItemHtml.value)">
                                                <img src="../images/copy.gif" border="0" title="复制录入界面" style="margin-left: 20px" /></a>
                                        <a href="javascript:" onclick="SizePlus('txtItemHtml')" title="增加编辑高度">
                                            <img src="../images/sizeplus.gif" border="0" style="margin-left: 20px;" /></a>
                                        <a href="javascript:" onclick="SizeMinus('txtItemHtml')">
                                            <img src="../images/sizeminus.gif" border="0" title="减少编辑高度" style="margin-left: 20px;
                                                margin-right: 20px" /></a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            是否分页：
                        </td>
                        <td class="bqright">
                            <div style="float: left">
                                <asp:RadioButtonList ID="IsPage" runat="server" RepeatDirection="Horizontal" AutoPostBack="True"
                                    OnSelectedIndexChanged="IsPage_SelectedIndexChanged">
                                    <asp:ListItem Value="True">是</asp:ListItem>
                                    <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                                </asp:RadioButtonList>
                            </div>
                            <div style="float: left; line-height: 25px; margin-left: 20px">
                                开启分页后，生成方式只能够是动态</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            分页效果：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtCssName" runat="server" CssClass="in1" Columns="20" Text="viciao" style="float:left"></asp:TextBox><input
                                id="ButCssName" type="button" value="选择分页效果" class="btn" style="float:left" onclick="WinOpenDialog('../common/SelectPageStyle.aspx?ControlId=txtCssName', '620', '500')"
                                runat="server" />
                            更改分页样式后，需要同时更新该标签所在模板页
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            显示页索引数目：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="NumericText" runat="server" CssClass="in1" Columns="5" Text="10"></asp:TextBox>页
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            每页显示数：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtPageSize" runat="server" CssClass="in1">10</asp:TextBox>
                        </td>
                    </tr>
                </tbody>
                <tbody style="display: none" id="DivDataSource_2" runat="server">
                    <tr style="display: none" runat="server" id="DropDownList_0">
                        <td class="bqleft">
                            启用默认第一项：
                        </td>
                        <td class="bqright">
                            <asp:RadioButtonList ID="RadDropIsDefault" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="1" Selected="True">启用</asp:ListItem>
                                <asp:ListItem Value="2">关闭</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr style="display: none" runat="server" id="DropDownList_1">
                        <td class="bqleft">
                            默认第一项Text值：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtDropText" runat="server">请选择</asp:TextBox>
                        </td>
                    </tr>
                    <tr style="display: none" runat="server" id="DropDownList_2">
                        <td class="bqleft">
                            默认第一项Value值：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtDropValue" runat="server">0</asp:TextBox>
                        </td>
                    </tr>
                    <tr style="display: none" runat="server" id="RadioButtonList_1">
                        <td class="bqleft">
                            显示列数：
                        </td>
                        <td class="bqright">
                            <asp:TextBox ID="txtRadColumn" runat="server" CssClass="in1" Rows="30" Text="1" Columns="10"></asp:TextBox>
                        </td>
                    </tr>
                    <tr style="display: none" runat="server" id="RadioButtonList_2">
                        <td class="bqleft">
                            项的布局方向：
                        </td>
                        <td class="bqright">
                            <asp:RadioButtonList ID="RadRadDirection" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="Horizontal" Selected="True">横向</asp:ListItem>
                                <asp:ListItem Value="Vertical">纵向</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            Text值字段：
                        </td>
                        <td class="bqright">
                            <asp:DropDownList ID="DropTextField" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="bqleft">
                            Value值字段：
                        </td>
                        <td class="bqright">
                            <asp:DropDownList ID="DropValueField" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                </tbody>
                <tr>
                    <td class="bqleft">
                        生成方式：
                    </td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="IsHtml" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="True" Selected="True">静态</asp:ListItem>
                            <asp:ListItem Value="False">动态</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        备注：
                    </td>
                    <td class="bqright">
                        <asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine" Rows="5" Columns="40"></asp:TextBox>
                    </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" />
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">
                        可使用函数：
                    </td>
                    <td class="bqright">
                        一、字符截取（GetLength）使用方法：&lt;%# GetLength(Eval("Content","{0}"),300)%&gt;<br />
                        二、内容URL（GetInfoUrl）使用方法：<br />
                        1：内容在模型下URL：&lt;%# GetInfoUrl("0",Eval("Id","{0}"))%&gt;
                        <br />
                        2：内容在某栏目下URL：&lt;%# GetInfoUrl(Eval("Class_Id","{0}"),Eval("Id","{0}"))%&gt; 如：在模型中栏目的字段名称为Column,那么这里就把Class_Id替换成Column_Id即可<br />
                        3：内容在表单下URL：&lt;%# GetInfoUrl(Eval("Id","{0}"))%&gt;<br />
                        三、时间格式化：&lt;%# Eval("AddTime","{0:yyyy-MM-dd}")%&gt;<br />
                        四、无图路径：&lt;%# GetNoImagePath(Eval("ImageText","{0}"))%&gt;,如果ImageText字段有图时，将显示实际图片路径，否则将显示系统默认无图图片。<br />
                        五：图片等比例显示
                        <br />
                        1、等比例宽度:&lt;%# ImageSize(Eval("ImageText","{0}"),"最大宽度","最大高度","w","/upload/article/")%&gt;
                        <br />
                        2、等比例高度:&lt;%# ImageSize(Eval("ImageText","{0}"),"最大宽度","最大高度","h","/upload/article/")%&gt;<br />
                        六：栏目URL：&lt;%# GetColumnUrl(Eval("Class_Id","{0}"))%&gt;
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
