<%@ Page Language="C#" ValidateRequest="false" MasterPageFile="~/admin/admin_page.master" AutoEventWireup="true" CodeBehind="freedomlabel_edit_end.aspx.cs" Inherits="YXShop.Web.admin.templates.label.freedomlabel_edit_end" %>
<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
<asp:Content ID="ContHead" runat="server" ContentPlaceHolderID="head">
<link rel="stylesheet" href="../../style/admin.css" type="text/css" />
    <script src="../../../scripts/prototype.js" type="text/javascript"></script>
    <link rel="stylesheet" href="../../style/validator.css" type="text/css" />
    <script type="text/javascript" src="../../../scripts/validate.js"></script>
 <script language="javascript" type="text/javascript">
function AddTag(val)
{
    var oEditor = FCKeditorAPI.GetInstance("<%=EdtContent.ClientID %>");
    var str = val.trim();
    if(str != '')
    {
        if (oEditor.EditMode==FCK_EDITMODE_WYSIWYG)
        {
             oEditor.InsertHtml(str);
        }
    }
}
function AddDate()
{
    var str = document.getElementById('<%=TxtDateStyle.ClientID %>').value.trim();
    if(str != '')
    {
        str = '[$'+ str +'$]'
        AddTag(str);
    }
}
function CheckNumber(obj)
{
    var str = obj.value.trim();
    var reg=/^\d*$/;    
       if(!reg.test(str))
        {    
            document.getElementById("divShort").className="msgError"; 
            obj.value=1;
            obj.focus();      
            return;         
        }
        else
        {   
            document.getElementById("divShort").className="msgShort";   
            return true;
        }
}
</script>
</asp:Content>
<asp:Content ID="ContTitle" runat="server" ContentPlaceHolderID="pagetitle">
<asp:Label ID="LblCaption" runat="server" Text="添加自由标签"></asp:Label>
<asp:HyperLink ID="HyperLink1" onclick="javascript:history.back()" runat="server"  CssClass="inputbutton" Width="65px" Height="24px" onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'">上一步</asp:HyperLink>
<asp:Button ID="Button2" runat="server" CssClass="inputbutton" onclick="btnSave_Click" Text="保存" onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'"/>
<asp:Button ID="btnReview" runat="server" CssClass="inputbutton" onclick="btnReview_Click" Text="预览" onMouseOver="javascript:document.getElementById(this.id).className='inputbutton_a'" onMouseOut="javascript:document.getElementById(this.id).className='inputbutton'"/>
</asp:Content>
<asp:Content ID="ContInfo" runat="server" ContentPlaceHolderID="pageinfo">
</asp:Content>
<asp:Content ID="ContSarch" ContentPlaceHolderID="pagesarch" runat="server">
 <div runat="server" id="review">      
 </div>
 <asp:Panel ID="pnlMsg" runat="server" Visible="false" CssClass="pnlReturnMessageErr ">
    <asp:Literal ID="ltlMsg" runat="server"></asp:Literal>
</asp:Panel>
</asp:Content>
<asp:Content ID="ContMain" runat="server" ContentPlaceHolderID="workspace">
<table width="98%" cellpadding="5" cellspacing="1" align="center" class="form_table_input">
                <tr>
                    <td class="form_table_input_info">标签名称：</td>
                    <td>
                        <asp:TextBox runat="server" Width="200" ID="TxtLabelName"></asp:TextBox>
                    </td>
                    <td><div class="msgShort">用于模版中的标签名</div></td>
                </tr>
                <tr>
                    <td class="form_table_input_info">标签说明：</td>
                    <td>
                        <asp:TextBox runat="server" Width="200" ID="TxtDescrpt" TextMode="MultiLine" MaxLength="200"></asp:TextBox>
                    </td>
                    <td><div class="msgShort">标签的描述与说明</div></td>
                </tr>
                <tr>
                   <td class="form_table_input_info">标签类型：</td>
                   <td>
                       <asp:DropDownList ID="DlType" runat="server">        
                       </asp:DropDownList>
                   </td>
                  <td><div class="msgShort">标签所在的类型</div></td>
                </tr>
                <tr>
                    <td class="form_table_input_info">自定义：</td>
                    <td style="font-size:12px">
                        <input type="button" value="循环内容" onclick="javascript:AddTag('{#您要加的内容#}')" />  <input type="button" value="不循环内容" onclick="javascript:AddTag('{*记录序号 您要加的内容*}')" />  <input type="button" value="函数" onclick="javascript:AddTag('(#函数内容#)')" />
                        <asp:CheckBox ID="ChePage" runat="server"  Text="是否分页" Font-Size="14px"/>
                    </td>
                    <td><div class="msgShort">用户自定义操作</div></td>
                </tr>
                <tr>
                    <td class="form_table_input_info">循环样式：</td>
                    <td >
                      <input  type="text" id="txtRow" runat="server" onblur="CheckNumber(this)" size="10" value="1"/>行
                      <input  type="text" id="txtCol" runat="server" onblur="CheckNumber(this)" size="10" value="1"/>列
                    </td>
                    <td><div id="divShort" class="msgShort">(必须是数字)只针对循环内容中的显示方式(显示几行几列)默认为1</div></td>
                </tr>
                <tr>
                   <td class="form_table_input_info">布局方式：</td>
                   <td>
                       <asp:RadioButtonList ID="RdWise" runat="server" RepeatDirection="Horizontal">
                         <asp:ListItem Selected="True" Value="1">Div布局</asp:ListItem>
                         <asp:ListItem Value="2">Table布局</asp:ListItem>
                       </asp:RadioButtonList>
                      &nbsp;                     
                   </td>
                   <td><div class="msgShort">对循环与分页布局</div></td>
                </tr>
                <tr>
                    <td class="form_table_input_info">可用字段：</td>
                    <td>
                        <asp:DropDownList runat="server" ID="DdlField1" onchange="AddTag(this.options[this.selectedIndex].value)" >
                            <asp:ListItem Value="">请选择字段</asp:ListItem></asp:DropDownList> ┆ <asp:DropDownList runat="server" ID="DdlField2" onchange="AddTag(this.options[this.selectedIndex].value)" ><asp:ListItem Value="">请选择字段</asp:ListItem>
</asp:DropDownList>
                  </td>
                   <td><div class="msgShort">自动替换循环里的内容</div></td> 
                </tr>
                <tr>
                    <td class="form_table_input_info">日期样式：</td>
                    <td>
                        <asp:TextBox runat="server" ID="TxtDateStyle" Text="YY02年MM月DD日" MaxLength="200"></asp:TextBox> <input type="button" value=" 插入 " onclick="AddDate()" />
                       
                    </td>
                    <td><div class="msgShort"> 需要选择时间字段，格式见说明 2</div></td>
                </tr>
                <tr>
                    <td class="form_table_input_info">标签内容：</td>
                    <td>
                        <div class="msgNormal">由HTML代码加所选择字段、自定义函数组成，用来定义查询记录的显示样式</div>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <FCKeditorV2:FCKeditor ID="EdtContent" runat="server" Width="98%"></FCKeditorV2:FCKeditor>             
                    </td>
                </tr>
            </table>
            <div class="msgFree">
            <p>说明：</p>
            <p>1.预定义字段需要选择各自对应编号。如新闻浏览路径需要选择新闻编号，栏目浏览路径需要选择栏目编号(注意：是新闻编号，<br />&nbsp;不是编号)。</p>
            <p>2.日期格式:YY02代表2位的年份(如06表示2006年),YY04表示4位数的年份(2006)，MM代表月，DD代表日，HH代表小时，MI代表<br />&nbsp;分，SS代表秒。</p>  
            <p>3.自定义函数：循环内容{#...#}、不循环内容{*n...*}(n>0)代表记录序号、函数(#...#)；如(#Left<br />&nbsp;([*YYXShopFreeTag*News.Title*],20)#) </p> 
            </div>
         <asp:HiddenField ID="HidID" runat="server"/>
         <asp:HiddenField ID="HidName" runat="server" />
         <asp:HiddenField ID="HidSQL" runat="server" />
</asp:Content>
