<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="getimgtxtsdiv.aspx.cs" Inherits="TotCms.Web.Admin.label.getimgtxtsdiv" ValidateRequest="false" %>

<!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>图文混排标签一(Div排版)</title>
  <link href="css.css" rel="stylesheet" type="text/css" />
  <script src="../js/common.js" type="text/javascript"></script>
  <script type="text/javascript"> 
    function GetValue(){
      var ret='';
	    var CategoryId=document.getElementById('CategoryId').value;	
	    var Sort=document.getElementById('Sort').value;
	    var ArticleAttr=document.getElementById('ArticleAttr').value;
	    var CharMax=checkInt(document.getElementById('CharMax').value);
	    //var LinkStyle=document.getElementById('LinkStyle').value;
	    //var TableWidth=document.getElementById('TableWidth').value;
      var ImgW=document.getElementById('ImgW').value;
      var ImgH=document.getElementById('ImgH').value;
	    var RowsNum=document.getElementById('RowsNum').value;
	    var ShowTitle=document.getElementById('ShowTitle').value;
      var TitlePrefix=document.getElementById('TitlePrefix').value;
	    TitlePrefix=TitlePrefix.replace(/\'/g,"\'");
	    TitlePrefix=TitlePrefix.replace(/\,/g,"");
	    var GetChilds=document.getElementById('GetChilds').value;
	    var ShowBorder=document.getElementById('ShowBorder').value;
      var TxtsAttr=document.getElementById('TxtsAttr').value;
	    //LinkStyle=LinkStyle.replace(/\,/g,"");		
	    ret='GetImgTxtsDiv(';
	    ret+=CategoryId+',';
	    ret+=Sort+',';
	    ret+=ArticleAttr+',';	
	    ret+=CharMax+',';
	    //ret+=LinkStyle+',';
	    //ret+=TableWidth+',';
      ret+=ImgW+',';
      ret+=ImgH+',';
	    ret+=RowsNum+',';
	    ret+=ShowTitle+',';
      ret+=TitlePrefix+',';
      ret+=GetChilds+',';
	    ret+=ShowBorder+',';
	    ret+=TxtsAttr+')';
	    return ret;
    }
    function retValue(){
	    var r=GetValue();
	    window.opener.document.form1.Content.value=r;
	    window.close();
    }
    function Preview(){
      var r=GetValue();
      r=r.replace('(',',');
      r=r.replace(')','');
      r=r.replace('"','');
		  document.getElementById('preframe').src='label_privew.aspx?content='+escape(r);
    }
    function checkInt(obj){
	    var reg = /^(\d{1,4})$/; 
	    if(obj!="" && obj.match(reg)==null){
		    return 0;
	    }else{
	      return obj;
	    }
    }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <fieldset style="text-align:center; ">
<legend>图文混排标签一、左为图片，右为文本列表(Div排版)</legend>
<table width="400" border="0" align="center" cellpadding="1" cellspacing="5">
  <tr>
    <td width="113"><div align="left">栏目</div></td>
    <td width="268">
      <div align="left">
        <asp:Label ID="CategoryTitle" runat="server" Text="选择栏目"></asp:Label>
        <asp:TextBox ID="CategoryId" runat="server" CssClass="hidden">0</asp:TextBox>
          <input id="Button4" type="button" value="..." onclick="popupWindow('../Category_Tree.aspx','category_tree',400,300,1)" />
      </div></td>
  </tr>
  <tr>
    <td><div align="left">排序:</div></td>
    <td><div align="left">   
      <asp:DropDownList ID="Sort" runat="server">
        <asp:ListItem>id</asp:ListItem>
        <asp:ListItem Value="ModiTime">日期</asp:ListItem>
        <asp:ListItem Value="Hits">点击</asp:ListItem>
        <asp:ListItem Value="SortId">排序</asp:ListItem>
      </asp:DropDownList>
</div></td>
  </tr>
  <tr>
    <td><div align="left">图片文章属性:</div></td>
    <td><div align="left">
      <asp:DropDownList ID="ArticleAttr" runat="server">
        <asp:ListItem Value="All">所有</asp:ListItem>
        <asp:ListItem Value="Images">图文</asp:ListItem>
        <asp:ListItem Value="Top1">头条</asp:ListItem>
        <asp:ListItem Value="ToHot">热点</asp:ListItem>
        <asp:ListItem Value="Recommend">推荐</asp:ListItem>
        <asp:ListItem Value="ToTop">置顶</asp:ListItem>
      </asp:DropDownList>
    </div></td>
  </tr>
  <tr>
    <td align="left">是否显示标题：</td>
    <td align="left">
      <asp:DropDownList ID="ShowTitle" runat="server">
        <asp:ListItem Value="1">是</asp:ListItem>
        <asp:ListItem Value="0">否</asp:ListItem>
      </asp:DropDownList>
            </td>
  </tr> 
  
  <tr>
    <td align="left">图片宽度：</td>
    <td align="left">
      <asp:TextBox ID="ImgW" runat="server">120</asp:TextBox>
            </td>
  </tr>
  <tr>
    <td align="left">图片高度：</td>
    <td align="left">
      <asp:TextBox ID="ImgH" runat="server">120</asp:TextBox></td>
  </tr>
  <tr>
    <td align="left">行数：</td>
    <td align="left">
      <asp:TextBox ID="RowsNum" runat="server">6</asp:TextBox>
            </td>
  </tr>
  <tr>
    <td><div align="left">文字个数限制:</div></td>
    <td>
        <div align="left">
          <asp:TextBox ID="CharMax" runat="server" CssClass="input_num">20</asp:TextBox>
      </div></td>
  </tr>
  <tr>
    <td><div align="left">列表文章属性:</div></td>
    <td><div align="left">
      <asp:DropDownList ID="TxtsAttr" runat="server">
        <asp:ListItem Value="All">所有</asp:ListItem>
        <asp:ListItem Value="Images">图文</asp:ListItem>
        <asp:ListItem Value="Top1">头条</asp:ListItem>
        <asp:ListItem Value="ToHot">热点</asp:ListItem>
        <asp:ListItem Value="Recommend">推荐</asp:ListItem>
        <asp:ListItem Value="ToTop">置顶</asp:ListItem>
      </asp:DropDownList>
    </div></td>
  </tr>
  
  <tr>
    <td align="left">标题前缀：</td>
    <td align="left">
      <asp:TextBox ID="TitlePrefix" runat="server">·</asp:TextBox>
            </td>
  </tr>
  <tr>
    <td align="left">调用子栏目：</td>
    <td align="left">
      <asp:DropDownList ID="GetChilds" runat="server">
        <asp:ListItem Value="0">否</asp:ListItem>
        <asp:ListItem Value="1">是</asp:ListItem>
      </asp:DropDownList>
            </td>
  </tr>
  <tr>
    <td align="left">是否加边框：</td>
    <td align="left">
      <asp:DropDownList ID="ShowBorder" runat="server">
        <asp:ListItem Value="0">否</asp:ListItem>
        <asp:ListItem Value="1">是</asp:ListItem>
      </asp:DropDownList>
            </td>
  </tr>
  <tr>
    <td colspan="2">
      <div align="center">
        <input id="Ok" type="submit" value="确定" onclick="retValue()" />
        &nbsp;
        <input type="button"  onclick="window.close();" value="取消" />
    &nbsp;<input id="Button1" type="button" value="预览" onclick="Preview()" /></div></td>
  </tr>
</table>
 
</fieldset>
<fieldset>
  <legend>预览</legend>
  <iframe width="99%" frameborder="0" id="preframe" name="preframe" src="preview.htm"></iframe>
</fieldset>
    </form>
</body>
</html>
