<%@ Page Language="C#" ValidateRequest="false"  AutoEventWireup="true" CodeBehind="productclass_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.lable.productclass_parameter" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<!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 id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
    <script src="../../../scripts/prototype.js" type="text/javascript"></script>
    <script src="../../scripts/public.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
    function ShowSel()
    {
       var rblshow;
       var o=document.getElementsByName("rblshowSel");
       var len=o.length; 
          
       for (var i=0;i<len ;i++ )
       {
          if(o[i].checked==true )
          {
             rblshow=o[i].value;
           }
       }
       if(rblshow!="")
       { 
           var cnm ="[YX:unLoop,YX:LableType=OtherSetup,YX:Option=ProductClassName,YX:ShowValue="+rblshow+"][/YX:unLoop]";
	       parent.getValue(cnm);
	       CloseDiv(); 
	    }
    }
    function ReturnValue(level)
    {
        var ShowMode;
        var o=document.getElementsByName("ddl_ShowMod");
        var len=o.length;   
        for (var i=0;i<len ;i++ )
        {
            if( o[i].checked==true )
            {
                ShowMode=o[i].value;
            }
        }
        
        var ProductClassID;
        if(ShowMode=="ProductClassID")
        {
            ProductClassID=document.getElementById("hfcid").value;
        }
        
        var ShowType;   
        o=document.getElementsByName("ddl_ShowType");
        var len=o.length;   
        for (var i=0;i<len ;i++ )
        {
            if( o[i].checked==true )
            {
                ShowType=o[i].value;
            }
        }
        
        var Showlevel;
        o=document.getElementsByName("ddl_Showlevel");
        var len=o.length;   
        for (var i=0;i<len ;i++ )
        {
            if( o[i].checked==true )
            {
                Showlevel=o[i].value;
            }
        }
        var CompositorType;     
        o=document.getElementsByName("ddl_order");
        var len=o.length;   
        for (var i=0;i<len ;i++ )
        {
            if( o[i].checked==true )
            {
               CompositorType=o[i].value;
            }
        }
        
        var StairShowRows;
        var StairShoeColumns;
        var TowShowRows;
        var TowShoeColumns;
        var StairCharacter; 
        var TowCharacter;
        var CompositorField = document.getElementById("ddl_CField").value;
        if (level=="一级")
        {
            StairShowRows = document.getElementById("tb_StairShowRows").value;
            StairShoeColumns = document.getElementById("tb_StairShoeColumns").value;
            StairCharacter = document.getElementById("tb_StairCharacter").value;
            TowShowRows = "";
            TowShoeColumns = "";   
            TowCharacter = "";
        }
        if (level=="二级")
        {
            StairShowRows = document.getElementById("tb_StairShowRows").value;
            StairShoeColumns = document.getElementById("tb_StairShoeColumns").value;
            StairCharacter = document.getElementById("tb_StairCharacter").value;
            TowShowRows = document.getElementById("tb_TowShowRows").value;
            TowShoeColumns = document.getElementById("tb_TowShoeColumns").value;
            TowCharacter = document.getElementById("tb_TowCharacter").value;
        }
        var WhetherOmit;
        o=document.getElementsByName("ddl_WhetherOmit");
        var len=o.length;   
        for (var i=0;i<len ;i++ )
        {
            if( o[i].checked==true )
            {
                WhetherOmit=o[i].value;
            }
        }
        var TempletLayout;      
        o=document.getElementsByName("rbl_TempletLayou");
        var len=o.length;   
        for (var i=0;i<len ;i++ )
        {
            if( o[i].checked==true )
            {
                TempletLayout=o[i].value;
            }
        }
        var mystyle =document.getElementById("txtLabelContent").value;
	    var cnm ="[YX:Loop,YX:LableType=ProductClass,YX:ShowMode="+ShowMode+",YX:ShowType="+ShowType+",YX:Showlevel="
	    +Showlevel+",YX:CompositorType="+CompositorType+",YX:CompositorField="
	    +CompositorField+ ",YX:StairShowRows="+StairShowRows+",YX:StairShowColumns="+StairShoeColumns+
	    ",YX:TowShowRows="+TowShowRows+",YX:TowShowColumns="+TowShoeColumns+
	    ",YX:StairCharacter="+StairCharacter+",YX:TowCharacter="+TowCharacter+
	    ",YX:WhetherOmit="+WhetherOmit+",YX:TempletLayout="+TempletLayout+",YX:ProductClassID="+ProductClassID+"]"+mystyle+"[/YX:Loop]";
    	 
	     parent.getValue(cnm);
	     CloseDiv();

    }

    function getValue(value)
{
    var textObj=document.getElementById("txtLabelContent");
    var textFeildValue=value;
    if(value!="") 
    {
        if(document.all)
        {     
            if(textObj.createTextRange && textObj.caretPos)
            {   
                var caretPos=textObj.caretPos;   
                caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
            }
            else
            {   
                textObj.value=textFeildValue;   
            }   
        }
        else
        {   
            if(textObj.setSelectionRange)
            {   
                var rangeStart =textObj.selectionStart;   
                var rangeEnd=textObj.selectionEnd;   
                var tempStr1=textObj.value.substring(0,rangeStart);   
                var tempStr2 =textObj.value.substring(rangeEnd);   
                textObj.value=tempStr1+textFeildValue+tempStr2;   
            }
            else
            {   
                alert("This version of Mozilla based browser does not support setSelectionRange");   
            }   
        }
    }
}
function setCaret(textObj)
{   
    if(textObj.createTextRange)
    {   
        textObj.caretPos=document.selection.createRange().duplicate();   
    }   
} 
    function CloseDiv()
    {
        parent.document.getElementById("LabelDivid").style.display="none";
    }
    function ShowProClass()
    {
        var ShowMode;
        var o=document.getElementsByName("ddl_ShowMod");
        var len=o.length;   
        for (var i=0;i<len ;i++ )
        {
            if( o[i].checked==true )
            {
                ShowMode=o[i].value;
            }
        }
        if(ShowMode=="ProductClassID")
        {
            document.getElementById("ProductClass").style.display="";
        }
        else
        {
            document.getElementById("ProductClass").style.display="none";
        }
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 99%; margin-top:5px" class="form_table_input" >
            <tr>
                <td style="text-align:right;">
                    选项：
                </td>
                <td>
                    <asp:RadioButtonList ID="rblshowSel" runat="server" onClick="javascript:ShowSel()" RepeatDirection="Horizontal">
                        <asp:ListItem Value="" Selected="True">不受限制</asp:ListItem>
                        <asp:ListItem Value="showname">显示分类名称</asp:ListItem>
                        <asp:ListItem Value="showupname">显示该分类的上级分类名称</asp:ListItem>
                    </asp:RadioButtonList><span style="color:Red">注：跟据商品分类的ID显示分类称。</span>
                </td>
            </tr>
        </table>
        <table style="width: 99%; margin-top:5px" class="form_table_input" >
            <tr>
                <td style="text-align:right;">显示方式：</td>
                <td colspan="3">
                    <asp:RadioButtonList ID="ddl_ShowMod" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="NoneLimit" Selected="True" onclick="javascript:ShowProClass();">不限制</asp:ListItem>
                        <asp:ListItem Value="Parameter" onclick="javascript:ShowProClass();">传参查询</asp:ListItem>
                        <asp:ListItem Value="ProID" onclick="javascript:ShowProClass();">跟据商品ID查询分类</asp:ListItem>
                        <asp:ListItem Value="SisterParameter" onclick="javascript:ShowProClass();">传参同级查询</asp:ListItem>
                        <asp:ListItem Value="ProductClassID" onclick="javascript:ShowProClass();">指定分类栏目</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr id="ProductClass" style="display:none;">
                <td colspan="4">
                     商品分类：
                     <asp:TextBox ID="txtProductClass" runat="server"></asp:TextBox>
                     <asp:HiddenField runat="server" ID="hfcid" />
                </td>
            </tr>
        <tr>
            <td style="text-align:right;">显示类型：</td>
            <td>
                <asp:RadioButtonList ID="ddl_ShowType" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="0" Selected="True">表示全部</asp:ListItem>
                    <asp:ListItem Value="1">推荐显示</asp:ListItem>
                </asp:RadioButtonList>
                     </td>
            <td  style="text-align:right;">是否省略：</td>
            <td>
                <asp:RadioButtonList ID="ddl_WhetherOmit" runat="server" RepeatDirection="Horizontal"> 
                    
                    <asp:ListItem Value="0">是</asp:ListItem>
                    <asp:ListItem Value="1" Selected="True">否</asp:ListItem>
                </asp:RadioButtonList>
                     </td>
        </tr>
        <tr>
            <td  style="text-align:right;">排序：</td>
            <td>
                <asp:RadioButtonList ID="ddl_order" runat="server"  RepeatDirection="Horizontal">
                    <asp:ListItem Value="0" Selected="True">升序</asp:ListItem>
                    <asp:ListItem Value="1">降序</asp:ListItem>
                </asp:RadioButtonList>
                
                     </td>
            <td style="text-align:right;">布局方式：</td>
            <td>
                <asp:RadioButtonList ID="rbl_TempletLayou" runat="server" RepeatDirection="Horizontal"> 
                   
                    <asp:ListItem Value="0" Selected="True">Div</asp:ListItem>
                    <asp:ListItem Value="1">Table</asp:ListItem>
                </asp:RadioButtonList>
                     </td>
        </tr>
        <tr>
            <td style="text-align:right;">显示级数：</td>
            <td>
                <asp:RadioButtonList ID="ddl_Showlevel" runat="server" 
                    RepeatDirection="Horizontal" AutoPostBack="True" 
                    onselectedindexchanged="ddl_Showlevel_SelectedIndexChanged">
                    <asp:ListItem Value="1" Selected="True">一级显示</asp:ListItem>
                    <asp:ListItem Value="2">二级显示</asp:ListItem>
                </asp:RadioButtonList>
            </td>
            <td style="text-align:right;">排序字段：</td>
            <td><asp:DropDownList ID="ddl_CField" runat="server">
                    </asp:DropDownList></td>
        </tr>
        </table>
        <table  id="tb_one" runat="server" style="width: 99%;"  class="form_table_input" >
            <tr>
                <td  style="text-align:right;"> 一级行数：</td>
                <td >
                <asp:TextBox ID="tb_StairShowRows" runat="server" 
                        onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" 
                        Width="100px" >1</asp:TextBox>
                </td>
                <td style="text-align:right;">一级列数： </td>
                <td >
                <asp:TextBox ID="tb_StairShoeColumns" runat="server" 
                        onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" 
                        Width="100px" >2</asp:TextBox>
                </td>
                <td  style="text-align:right;"> 一级字符数：</td>
                <td >
                <asp:TextBox ID="tb_StairCharacter" runat="server" 
                        onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" 
                        Width="100px" >6</asp:TextBox>
                </td>
            </tr>
        </table>
          <table  id="Table1" runat="server" style="width: 99%;" class="form_table_input"  visible="false">
            <tr>
                <td style="text-align:right;">二级行数：</td>
                <td >
                <asp:TextBox ID="tb_TowShowRows" runat="server" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" 
                        Width="100px" >1</asp:TextBox>
                </td>
                <td style="text-align:right;">二级列数：</td>
                <td >
                <asp:TextBox ID="tb_TowShoeColumns" runat="server" 
                    onkeyup="value=value.replace(/[^\d]/g,'') " 
                    
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" 
                        Width="100px" >2</asp:TextBox>
                     </td>
                <td style="text-align:right;">二级字符数：</td>
                <td >
                <asp:TextBox ID="tb_TowCharacter" runat="server" Text="6" 
                    onkeyup="value=value.replace(/[^\d]/g,'') " 
                    
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" 
                        Width="100px" ></asp:TextBox>
                     </td>
            </tr>
            <tr>
                <td style="text-align:right;"></td>
                <td colspan="5">
                    <input type="button" value="插入二级分类" onclick="getValue('{# 您要加的内容 #}')" /><span style="color:Red">点击按钮可以在标示中插入二级分类</span>
                </td>
            </tr>
        </table>
        <table style="width: 100%;" class="form_table_input" >
        <tr>
            <td>显示属性</td>
            <td colspan="3"  align="left">
                <asp:DropDownList ID="LabelList1" runat="server" onchange="javascript:getValue(this.value);">
                    <asp:ListItem Value="">-类型标签-</asp:ListItem>
                    <asp:ListItem Value="[#StairName]">一级分类名称</asp:ListItem>
                    <asp:ListItem Value="[#SecondName]">二级分类名称</asp:ListItem>
                    <asp:ListItem Value="[#ProductCount]">商品数量</asp:ListItem>
                    <asp:ListItem Value="[#URL]">URL地址</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>标签内容</td>
            <td colspan="3"  align="left">
                 <asp:TextBox runat="server" ID="txtLabelContent" height="200" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="500" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        </table>
        <table style="width: 100%;" class="form_table_input" >
            <tr>
                <td align="center">
                     <input id="bt_back" type="button" value="提交" onclick="ReturnValue('<%=level%>')" />&nbsp;<input class="form" type="button" value="关闭"  onclick="javascript:CloseDiv();" />
                </td>
                
            </tr>
            
        </table>
    </div>
    </form>
</body>
</html>