<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="getcategory.aspx.cs" Inherits="TotCms.Web.Admin.label.getcategory" 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>获取栏目标签</title>
  <link href="css.css" rel="stylesheet" type="text/css" />
  <script src="../js/common.js" type="text/javascript"></script>
  <script type="text/javascript"> 
    function retValue(){
	    var ret='';
	    var CategoryId=document.getElementById('CategoryId').value;	
	    var getNum=document.getElementById('getNum').value;
	    var TitlePrefix=document.getElementById('TitlePrefix').value;
	    var CharMax=checkInt(document.getElementById('CharMax').value);
	    var LinkStyle=document.getElementById('LinkStyle').value;
	    LinkStyle=LinkStyle.replace(/\,/g,"");		
	    ret='GetCategory(';
	    ret+=CategoryId+',';
	    ret+=getNum+',';
	    ret+=TitlePrefix+',';	
	    ret+=CharMax+',';
	    ret+=LinkStyle+')';	
	    window.opener.document.form1.Content.value=ret;
	    window.close();
    }
    function Preview(){
      var ret='';
	    var CategoryId=document.getElementById('CategoryId').value;	
	    var getNum=document.getElementById('getNum').value;
	    var TitlePrefix=document.getElementById('TitlePrefix').value;
	    var CharMax=checkInt(document.getElementById('CharMax').value);
	    var LinkStyle=document.getElementById('LinkStyle').value;
	    LinkStyle=LinkStyle.replace(/\,/g,"");		
	    ret='GetCategory,';
	    ret+=CategoryId+',';
	    ret+=getNum+',';
	    ret+=TitlePrefix+',';	
	    ret+=CharMax+',';
	    ret+=LinkStyle;	
		  document.getElementById('preframe').src='label_privew.aspx?content='+escape(ret);
    }
    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>栏目列表标签</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:TextBox ID="getNum" runat="server">0</asp:TextBox>
</div></td>
  </tr>
  <tr>
    <td><div align="left">标题前缀:</div></td>
    <td><div align="left">
      <asp:TextBox ID="TitlePrefix" runat="server">·</asp:TextBox>
    </div></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:TextBox ID="LinkStyle" runat="server" CssClass="input_num"> </asp:TextBox>
    </div></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>
