<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="articlelist_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.articlelist_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 runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
    <script src="../../scripts/changehope.js" type="text/javascript"></script>
    <script src="../../scripts/public.js" type="text/javascript"></script>
    <script type="text/javascript">     
    function ReturnValue()
    {
       var ChannelID=document.getElementById("channelId_droplist").value;//频道ID
     var ClassID=document.getElementById("classId_droplist").value //分类ID  
     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 Property;
     o=document.getElementsByName("rbArticleProperty");//文章属性
     var len=o.length;   
     for (var i=0;i<len ;i++ )
     {
         if( o[i].checked==true )
         {
             Property=o[i].value;
         }
     }
     
     var CompositorField =document.getElementById("ddl_filed").value; //排序字段
     var ShowRows = document.getElementById("Tb_rows").value;//显示行数
     var ShowColumns = document.getElementById("Tb_Columns").value;//显示列数
    var NameCharacter =document.getElementById("tb_namelength").value;//名称最大字符数
     
      var WhetherPagination;
     o=document.getElementsByName("rbl_page");//是否分页
      var len=o.length;   
      for (var i=0;i<len ;i++ )
       {
          if( o[i].checked==true )
           {
             WhetherPagination=o[i].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 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 IsAudit;
      o=document.getElementsByName("rbIsAudit");//是否通过审核
      var len=o.length;   
      for (var i=0;i<len ;i++ )       
      {
          if( o[i].checked==true )
          {
             IsAudit=o[i].value;
           }
      }
     var ShowType;
     o=document.getElementsByName("rblShowType");//文章属性
     var len=o.length;   
     for (var i=0;i<len ;i++ )
     {
         if( o[i].checked==true )
         {
             ShowType=o[i].value;
         }
     }
     var ContentCharacter=document.getElementById("tb_ContentCharacter").value;
    var TypeColumns=document.getElementById("txtTypeColumns").value;//类别显示列数
    var TypeRows=document.getElementById("txtTypeRows").value;//类别显示行数
    var mystyle = document.getElementById("txtLabelContent").value;	
	var cnm ="[YX:Loop,YX:LableType=AricleList,YX:ChannelID="+ChannelID+",YX:ArticleProperty="+Property+",YX:ClassID="+ClassID+",YX:CompositorType="+CompositorType+",YX:CompositorField="
	+CompositorField+ ",YX:ShowRows="+ ShowRows+",YX:ShowColumns="+ShowColumns+
	",YX:NameCharacter="+NameCharacter+",YX:WhetherPagination="+WhetherPagination+
	",YX:TempletLayout="+TempletLayout+
	",YX:ContentCharacter="+ContentCharacter+",YX:IsAudit="+IsAudit+",YX:WhetherOmit="+WhetherOmit+",YX:ShowType="+ShowType+",YX:TypeColumns="+TypeColumns+",YX:TypeRows="+TypeRows+"]"+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 ShowType()
{
     var ShowType;
     o=document.getElementsByName("rblShowType");//文章属性
     var len=o.length;   
     for (var i=0;i<len ;i++ )
     {
         if( o[i].checked==true )
         {
             ShowType=o[i].value;
         }
     }
    if(ShowType==1||ShowType==2)
    {
       document.getElementById("TowContent").style.display="";
       if(ShowType==2)
       {
           document.getElementById("TypePar").style.display="";
       }
       else
       {
            document.getElementById("TypePar").style.display="none";
       }
    }
    else
    {
        document.getElementById("TowContent").style.display="none";
    }
}
    </script>
</head>
<body onload="load($('channelId_droplist').value)">
    <form id="form1" runat="server">
    <div>
        <table style="width: 99%;" class="form_table_input">
            <tr>
            <td>所属频道</td>
               <td>
                  <asp:DropDownList ID="channelId_droplist" runat="server" OnSelectedIndexChanged="channelId_droplist_SelectedIndexChanged" AutoPostBack="true">
                    </asp:DropDownList>
                    <br />
                    <span style="color:Red;">注：未指定所属频道，前台自动获取URL指定的频道。</span>
               </td>
               <td>文章属性</td>
               <td>
                   <asp:RadioButtonList ID="rbArticleProperty" runat="server" RepeatDirection="Horizontal" RepeatColumns="4">
                       <asp:ListItem Value="0" Text="无限制" Selected="True"></asp:ListItem>
                       <asp:ListItem Value="1" Text="推荐"></asp:ListItem>
                       <asp:ListItem Value="3" Text="头条"></asp:ListItem>
                       <asp:ListItem Value="5" Text="热门"></asp:ListItem>
                       <asp:ListItem Value="7" Text="置顶"></asp:ListItem>
                       <asp:ListItem Value="9" Text="精华"></asp:ListItem>
                       
                   </asp:RadioButtonList>
               </td>
            </tr>
            <tr>
             <td width="100">
                  所属类别</td>
                <td width="200">
                     <asp:DropDownList ID="classId_droplist" runat="server">
                    </asp:DropDownList>
                    &nbsp;
                    <input id="classId_droplistVal" type="hidden" runat="server" />
                </td>
                <td width="100">
                  排序选择</td>
                <td width="200">
                    <asp:RadioButtonList ID="rbl_CompositorType" runat="server" 
                        RepeatDirection="Horizontal" Height="24px" Width="119px">
                        <asp:ListItem Value="0" Selected="True">升序</asp:ListItem>
                        <asp:ListItem Value="1">降序</asp:ListItem>
                    </asp:RadioButtonList> 
                </td>
            </tr>
            <tr>
                <td>
                   显示几行</td>
                <td>
                    <asp:TextBox ID="Tb_rows" runat="server" Width="147px"  onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" >2</asp:TextBox>
                </td>
                <td>
                   排列方式</td>
                <td>
                    <asp:DropDownList ID="ddl_filed" runat="server" Height="25px" Width="137px">
                    <asp:ListItem Value="" Selected="True">排列方式</asp:ListItem>
                    <asp:ListItem Value="articleID">自动编号</asp:ListItem>
                     <asp:ListItem Value="createTime">添加日期</asp:ListItem>
                     <asp:ListItem Value="updateTime">更新日期</asp:ListItem>
                     <asp:ListItem Value="elite">精华信息</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    显示几列</td>
                <td>
                    <asp:TextBox ID="Tb_Columns" runat="server" Width="147px"  onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" >2</asp:TextBox>
                </td>
                <td>
                  是否分页</td>
                <td>
                    <asp:RadioButtonList ID="rbl_page" runat="server" 
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">分页</asp:ListItem>
                        <asp:ListItem Value="1">不分页</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                   名称长度</td>
                <td>
                    <asp:TextBox ID="tb_namelength" runat="server" Width="147px"  onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" >8</asp:TextBox>
                </td>
                <td>显示省略号
                   </td>
                <td>
                   <asp:RadioButtonList ID="rbl_WhetherOmit" runat="server" 
                        RepeatDirection="Horizontal">
                        <asp:ListItem Selected="True" Value="False">否</asp:ListItem>
                        <asp:ListItem Value="True">是</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    内容长度</td>
                <td>
                  
                   <asp:TextBox ID="tb_ContentCharacter" runat="server" Width="150px"  onkeyup="value=value.replace(/[^\d]/g,'') " 
                        onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" >20</asp:TextBox>
                </td>
                <td>
                    布局方式</td>
                <td>
                  
                    <asp:RadioButtonList ID="Rbl_TempletLayout" runat="server" Height="26px" 
                        RepeatDirection="Horizontal" Width="116px">
                        <asp:ListItem Value="0" Selected="True">Div</asp:ListItem>
                        <asp:ListItem Value="1">Table</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    选择参数</td>
                <td>
                    <asp:DropDownList ID="ddl_Properties" runat="server" Width="150px" onchange="javascript:getValue(this.value);">
                     <asp:ListItem Value="">--请选择参数--</asp:ListItem>
                        <asp:ListItem Value="[#Articles_Title]">标题</asp:ListItem>
                        <asp:ListItem Value="[#Articles_SubTitle]">副标题</asp:ListItem>
                        <asp:ListItem Value="[#Articles_Images]">新闻图片</asp:ListItem>
                        <asp:ListItem Value="[#Articles_Author]">作者</asp:ListItem>
                        <asp:ListItem Value="[#Articles_SouesURL]">标题链接地址(新闻来源链接地址)</asp:ListItem>
                        <asp:ListItem Value="[#Articles_Synopsis]">文章简介</asp:ListItem>
                        <asp:ListItem Value="[#Articles_URL]">链接地址</asp:ListItem>
                        <asp:ListItem Value="[#Articles_UpdateTime]">更新时间</asp:ListItem>
                        <asp:ListItem Value="[#Articles_CreateTime]">添加时间</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    是否通过审核
                </td>
                <td>
                  <asp:RadioButtonList ID="rbIsAudit" 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>
                显示类型
                    <span title="文章列表：跟据上面的属性类别查询文章。&#10;文章分类与文章列表：通过该标签控制文章分类与文章列表,文章分类跟据上面选中的属性类别而变改;文章列表就是该类别的文章。&#10;分类列表与文章列表：跟据上面所选中的所属频道与所属类别循环显示内容。">
                        <img src="../../images/dot.gif" style="cursor:hand;" />
                    </span>
                </td>
                <td colspan="3">
                    <asp:RadioButtonList ID="rblShowType" runat="server" RepeatDirection="Horizontal" onClick="ShowType()">
                        <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 id="TowContent" style="display:none">
                <td>&nbsp;</td>
                <td colspan="3">
                        <input type="button" value="插入文章列表" onclick="getValue('{# 您要加的内容 #}')" />
                        <span title="点击按钮可以在标示中插入文章列表">
                            <img src="../../images/dot.gif" style="cursor:hand;" />
                        </span>
                        <asp:DropDownList ID="DropDownList1" runat="server" Width="150px" onchange="javascript:getValue(this.value);">
                            <asp:ListItem Value="">--选择类别名称--</asp:ListItem>
                            <asp:ListItem Value="[#ClassName]">类别名称</asp:ListItem>
                            <asp:ListItem Value="[#Class_Link]">类别资讯链接</asp:ListItem>
                        </asp:DropDownList>
                </td>
            </tr>
            <tr id="TypePar" style="display:none">
                <td>类别参数</td>
                <td>
                    行数<asp:TextBox ID="txtTypeRows" runat="server" Width="50"></asp:TextBox>
                    列数<asp:TextBox ID="txtTypeColumns" runat="server" Width="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td colspan="3">                      
                    <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>          
            <tr>
                <td colspan="4" align="center" style="text-align:center">
                   <input id="bt_Exc" type="button" value="提交" onclick="ReturnValue()" />
                    &nbsp;<input class="form" type="button" value=" 关 闭 "  onclick="javascript:CloseDiv();" /></td>
            </tr>
            </table>
    </div>
    </form>
</body>
</html>
