<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="friedlink_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.friedlink_parameter" %>

<!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 language="javascript" type="text/javascript">
function ReturnValue()
{
   var ShowMode;
   var o=document.getElementsByName("rbl_ShowMode");//显示模式
    var len=o.length;   
    for (var i=0;i<len ;i++ )
    {
    if( o[i].checked==true )
    {

     ShowMode=o[i].value;
      }
     }
      
     var CompositorType;     
     o=document.getElementsByName("rbl_CompositorType");//排序方式
     var len=o.length;   
   for (var i=0;i<len ;i++ )
    {
     if( o[i].checked==true )
       {
           CompositorType=o[i].value;
       }
     }
     var ShowRows = document.getElementById("Tb_rows").value;//显示行数
     var ShowColumns = document.getElementById("Tb_Columns").value;//显示列数
     var TempletLayout;      
     o=document.getElementsByName("Rbl_TempletLayout");//布局方式
      var len=o.length;   
      for (var i=0;i<len ;i++ )       
       {
          if( o[i].checked==true )
          {
             TempletLayout=o[i].value;
           }
      }
      var NameLength=document.getElementById("txtNameLenght").value;
      var WhetherOmit;
      o=document.getElementsByName("rbl_WhetherOmit");//省略否
      var len=o.length;   
      for (var i=0;i<len ;i++ )       
       {
          if( o[i].checked==true )
          {
             WhetherOmit=o[i].value;
           }
      }
      var FriedLinkShowType;
      o=document.getElementsByName("rblShowType");//显示类型
      var len=o.length;   
      for (var i=0;i<len ;i++ )       
      {
          if( o[i].checked==true )
          {
             FriedLinkShowType=o[i].value;
           }
      }
       //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;
	    
	var cnm ="[YX:Loop,YX:LableType=FriedLink,YX:ShowMode="+ShowMode+",YX:CompositorType="+CompositorType+",YX:ShowRows="+ ShowRows+",YX:ShowColumns="+ShowColumns+
	",YX:TempletLayout="+TempletLayout+
	",YX:WhetherOmit="+WhetherOmit+",YX:NameCharacter="+NameLength+",YX:FriedLinkShowType="+FriedLinkShowType+"]"+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";
}

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table style="width: 100%;" class="form_table_input" >
        <tr>
            <td style="width:15%"  align="right">
               是否审核
            </td>
            <td style="width:35%" align="left">
                <asp:RadioButtonList ID="rbl_ShowMode" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="0" Selected="True">已审核</asp:ListItem>
                    <asp:ListItem Value="1">全部</asp:ListItem> 
                </asp:RadioButtonList>
            </td>
            <td style="width:15%" align="right">名称长度</td>
            <td  align="left">
                <asp:TextBox ID="txtNameLenght" runat="server" Width="50px"></asp:TextBox></td>   
        </tr>
        <tr>
            <td style="width:15%"  align="right">
           
               显&nbsp;&nbsp;&nbsp; 示</td>
            <td  align="left">
                行<asp:TextBox ID="Tb_rows" runat="server" Width="50px"></asp:TextBox>&nbsp;&nbsp;列<asp:TextBox
                    ID="Tb_Columns" runat="server" Width="50px"></asp:TextBox>
            </td>
            <td style="width:15%" align="right">
            是否省略
            </td>
            <td  align="left">
                <asp:RadioButtonList ID="rbl_WhetherOmit" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="true" Selected="True">是</asp:ListItem>
                    <asp:ListItem Value="false">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>   
        </tr>
        
        <tr>
            <td style="width:15%"  align="right">
           
               排&nbsp;&nbsp;&nbsp; 序</td>
            
            <td  align="left">
                <asp:RadioButtonList ID="rbl_CompositorType" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="desc" Selected="True">降序</asp:ListItem>
                    <asp:ListItem Value="asc">升序</asp:ListItem>
                </asp:RadioButtonList>
            </td> 
            <td style="width:15%"  align="right">
                布局方式 </td>
            <td  align="left">
                <asp:RadioButtonList ID="Rbl_TempletLayout" 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="width:15%" align="right">
             	 基本参数</td>
            <td  align="left">
            <asp:DropDownList ID="DropDownList1" runat="server"  onchange="javascript:getValue(this.value);">
        <asp:ListItem  Value="">-链接标签-</asp:ListItem>
        <asp:ListItem Value="[#SiteName]">链接名称</asp:ListItem>
        <asp:ListItem Value="<img src='[#SiteLogo]' width='90px' height='45px' />">链接图片</asp:ListItem>
        <asp:ListItem Value="{#SiteUrl}">链接URL</asp:ListItem>
        </asp:DropDownList>
            
            </td>   
            <td style="width:15%" align="right">显示类型</td>
            <td  align="left">
                <asp:RadioButtonList ID="rblShowType" runat="server" RepeatDirection="Horizontal"> 
                    <asp:ListItem Value="0" Selected="True">不限制</asp:ListItem>
                    <asp:ListItem Value="1">总站</asp:ListItem>
                    <asp:ListItem Value="2">店铺</asp:ListItem>
                </asp:RadioButtonList>
            </td>   
        </tr>
        <tr>
            <td colspan="4"  align="left">
                    <asp:TextBox runat="server" ID="txtLabelContent" height="100" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="600" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        <tr><td colspan="4" style="width: 100%; text-align:center"><input type="button" id="Button1" value="提交" onclick="ReturnValue()" />
            
        </td></tr>
        </table>
    </div>
    </form>
</body>
</html>