<!--#include file="../../ACT.Function.asp"-->
<!--#include file="../ACT.F.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ACT_标签管理</title>
<link href="../../Images/css1/css.css" rel="stylesheet" type="text/css">
</head>
<SCRIPT src="../../../ACT_inc/dtreeFunction.js"></SCRIPT>
<LINK href="../../../ACT_inc/dtree.css" type=text/css rel=StyleSheet>
<SCRIPT src="../../../ACT_inc/dtree.js" type=text/javascript></SCRIPT>
<body>
<%
Dim Action,ID,LabelRS,LabelName,Descript,LabelContent,LabelFlag,LabelContentArr,ClassID,ClassName,Rs,pages
Dim ListNumber,TitleLen,ColNumber,TitleCss,PicHeight,PicWidth,TypeSlide,ModeID
Dim OpenType,sysdir,TypeTitle,piccss,ChangeTime
If Not ACTCMS.ACTCMS_QXYZ(0,"bqxt","") Then   Call Actcms.Alert("对不起，你没有操作权限！","")

sysdir=actcms.ActSys&"upfiles"
Action = Request.QueryString("Action")
ID =  actcms.ChkNumeric(Request.QueryString("ID"))
IF Action = "Add" Then
	ModeID =  ActCMS.ChkNumeric(Request.QueryString("ModeID"))
	IF ModeID = 0 Then ModeID = 1
	ClassID = 0
	ListNumber = 10
	ColNumber = 1
	TypeSlide = 2
	PicWidth = 200
	PicHeight = 200
	TitleLen = 30
	ChangeTime = 5000
	LabelFlag = 0
	TypeTitle = True
	pages = "新建幻灯片文章标签"
Else
	  	
	  Set LabelRS = Server.CreateObject("Adodb.Recordset")
	  LabelRS.Open "Select * From Label_Act Where ID=" & ID & "", Conn, 1, 1
	  If LabelRS.EOF And LabelRS.BOF Then
		 LabelRS.Close
		 Conn.Close:Set Conn = Nothing
		 Set LabelRS = Nothing
		 Response.Write "参数传递出错!":Response.End
	  End If
		LabelName = Replace(Replace(LabelRS("LabelName"), "{ACTCMS_", ""), "}", "")
		Descript = LabelRS("Description")
		LabelContent = LabelRS("LabelContent")
		LabelFlag = Clng(LabelRS("LabelFlag"))
		LabelRS.Close:Set LabelRS = Nothing
		LabelContent = Replace(Replace(LabelContent, "{$GetSlide(", ""), ")}", "")
		LabelContent = Replace(LabelContent, """", "") 
		LabelContentArr = Split(LabelContent, "§")
		ClassID = LabelContentArr(0)
		ListNumber = LabelContentArr(1)'列出条数
		OpenType = LabelContentArr(2)'链接目标
		TitleLen = LabelContentArr(3)
		Titlecss= LabelContentArr(4)
		TypeTitle = LabelContentArr(5)
		TypeSlide= LabelContentArr(6)
		PicWidth = LabelContentArr(7)
		PicHeight = LabelContentArr(8)
		ChangeTime = LabelContentArr(9)
		ModeID = LabelContentArr(10)
		pages = "修改栏目文章列表标签"
End IF
 IF ModeID = 0 Or ModeID="" Then ModeID = 1
%>
<form id="myform" name="myform" method="post" action="AddLabelSave.asp">
 <input type="hidden" name="LabelContent"> 
  <input type="hidden" name="Action" value="<%= Action %>"> 
<input type="hidden" name="ModeID" value="<%= ModeID %>"> 
  <input type="hidden" name="ID" value="<%= ID %>"> 
 <input type="hidden" name="FileUrl" value="GetSlide.asp">  <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
    <tr>
      <td colspan="2" align="center" class="bg_tr"><%= pages %>&nbsp;</td>
    </tr>
    <tr>
      <td width="50%" class="td_bg">标签名称
      <input name="LabelName" class="textbox" type="text" id="LabelName" value="<%= LabelName %>"></td>
      <td width="50%" class="td_bg"><font color="red">* 调用格式"{ACTCMS_标签名称}"</font></td>
    </tr>
   <tr>
      <td class="td_bg">标签目录      
        <select name="LabelFlag" id="select">
          <option value="0">系统默认</option>
			 <%=AF.ACT_LabelFolder(CInt(LabelFlag))%>
        </select>&nbsp;&nbsp;<a href="ACT.LabelFolder.asp"><font color=red>新建存放目录</font></a></td>
	 <td width="50%" height="24"  class="td_bg"><font color=green>标签存放目录,日后方便管理标签</font></td>
    </tr>
    <tr>
      <td class="td_bg">
	  所属栏目
	   <input name="ClassID" type="text" id="ClassID" value="<%= ClassID %>" readonly  disabled=true>
	    <select name="select1" onChange="SelectClass();">
    <option value="0" <% IF ClassID = "0" Then  Response.Write "selected" %>>不指定栏目</option>
	
    <option value="1"  style="color:red" <% IF ClassID = "1" Then  Response.Write "selected" %>>当前栏目通用</option>
	<option value="2" <% IF ClassID <> "0" And ClassID <> "1"  Then  Response.Write "selected" %>>指定栏目</option>
	</select><a href="#" onClick="SelectClass()">快速打开</a> </td>
      <td class="td_bg">
	 </td>
    </tr>
    <tr>
      <td class="td_bg">列出条数
      <input name="ListNumber" class="textbox" type="text" id="ListNumber2"    style="width:70%;"  value="<%= ListNumber %>"></td>
      <td class="td_bg"><div style="position:relative;">链接目标<span style="margin-left:175px;width:18px;overflow:hidden;">
        <select name="select" class='textbox' style="width:185px;margin-left:-167px" onChange="this.parentNode.nextSibling.value=this.value">
          <option value=""></option>
          <option value="_blank"> _blank </option>
          <option value="_parent"> _parent </option>
          <option value="_self"> _self </option>
          <option value="_top"> _top </option>
        </select>
        </span>
            <input class="textbox" name="OpenType" style="width:175px;position:absolute;left:55px;" value="<%= OpenType %>">
      </div></td>
    </tr>
    <tr>
      <td class="td_bg">标题字数
      <input name="TitleLen" class="textbox"  type="text"    style="width:70%;" value="<%= TitleLen %>"></td><td class="td_bg">标题样式
        <input name="TitleCss" type="text" class="textbox" id="TitleCss" style="width:70%;" value="<%= TitleCss %>"></td>
    </tr>
    <tr>
      <td class="td_bg">显示标题
        <label for="TypeTitle1">
        <INPUT <% IF Cbool(TypeTitle) = True Then  Response.Write "Checked" %> type="radio" id="TypeTitle1" value="true" name="TypeTitle">
是</label>
        <label for="TypeTitle2">
        <INPUT <% IF Cbool(TypeTitle) = false Then  Response.Write "Checked" %> type="radio" id="TypeTitle2" value="false" name="TypeTitle">
否</label>
      </td>
      <td class="td_bg">?类型
<label for="TypeSlidel">
<INPUT <% IF TypeSlide = 1 Then  Response.Write "Checked" %> type="radio" id="TypeSlidel" value="1" name="TypeSlide">
普通幻灯片</label>
<label for="TypeSlide2">
<INPUT <% IF TypeSlide = 2 Then  Response.Write "Checked" %> type="radio" id="TypeSlide2" value="2" name="TypeSlide">
Flash幻灯片</label></td>
    </tr>
    <tr>
      <td class="td_bg">图片设置 宽
        <input name="PicWidth" class="textbox" type="text" id="PicWidth2" value="<%= PicWidth %>" size="6">
像素 高
<input name="PicHeight" class="textbox" type="text" id="PicHeight2" value="<%=PicHeight  %>" size="6" >
像素</td>
      <td class="td_bg">效果变换间隔时间
		
	  <input name="ChangeTime" type="text" id="ChangeTime" value="<%= ChangeTime %>" maxlength="10" onKeyUp="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">	 
	    <font color="red">单位:毫秒</font>		</td>
    </tr>
    <tr>
      <td colspan="2" class="td_bg">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2" align="center" class="td_bg" >
       <input name="SubmitBtn" class="ACT_btn" type="button"  onClick="InsertScriptFun()"  id="SubmitBtn"  value=" 确 定 ">    
      &nbsp;&nbsp; <input type="reset" class="ACT_btn" name="Submit" value="  重置  "></td>
    </tr>
    
    
    </table>
  
</form>
<script language="javascript" >

function SelectClass()
{

 if(document.myform.select1.value==0)	
	{
	document.all.ClassID.value=0
	}

 if(document.myform.select1.value==1 )	
	{
	document.all.ClassID.value=1
	}

 if(document.myform.select1.value==2 )	
	{
	var result = Selector(2, document.all.ClassID.value);
	if(!result) return false;
	var val = "";
	for(var i=0; i<result.length; i++)
	{
		if(val == "")
		{
			val += result[i].id;
		}else{
			val += "," + result[i].id;
		}
	}
	document.all.ClassID.value = val;
	}
	}

	
function OpenWindow(Url,Width,Height,WindowObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:no;');
	return ReturnStr;
}	


function OpenWindowAndSetValue(Url,Width,Height,WindowObj,SetObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:yes;help:no;scroll:yes;');
	if (ReturnStr!='') SetObj.value=ReturnStr;
	return ReturnStr;
}	
	function InsertScriptFun(Obj)
		{   if (document.myform.LabelName.value=='')
			 {
			  alert('请输入标签名称');
			  document.myform.LabelName.focus(); 
			  return false
			  }
			var ClassID=document.myform.ClassID.value;
			var PicWidth=document.myform.PicWidth.value;
			var PicHeight=document.myform.PicHeight.value;
			var ListNumber=document.myform.ListNumber.value;
			var ShowPicFlag,TypeTitle,TypeSlide;
			var OpenType='"'+document.myform.OpenType.value+'"';
			var TitleLen=document.myform.TitleLen.value;
			var TitleCss='"'+document.myform.TitleCss.value+'"';
			var ChangeTime=document.myform.ChangeTime.value;
			var ModeID=document.myform.ModeID.value;
			for (var i=0;i<document.myform.TypeTitle.length;i++){
			 var TCJ = document.myform.TypeTitle[i];
			if (TCJ.checked==true)	   
				TypeTitle = TCJ.value
			}
			for (var i=0;i<document.myform.TypeSlide.length;i++){
			 var TCJ = document.myform.TypeSlide[i];
			if (TCJ.checked==true)	   
				TypeSlide = TCJ.value
			}
			if  (ListNumber=='')  ListNumber=10;
			if  (TitleLen=='') TitleLen=30;
			document.myform.LabelContent.value=	'{$GetSlide("'+ClassID+'"§'+ListNumber+'§'+OpenType+'§'+TitleLen+'§'+TitleCss+'§'+TypeTitle+'§'+TypeSlide+'§'+PicWidth+'§'+PicHeight+'§'+ChangeTime+'§'+ModeID+')}';
			document.myform.SubmitBtn.value="正在提交数据,请稍等...";
			document.myform.SubmitBtn.disabled=true;
			document.myform.Submit.disabled=true;	
			document.myform.submit();
		}
</script>
</body>
</html>
