<!--#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>
<body>
<%
Dim Action,ID,LabelRS,LabelName,Descript,LabelContent,LabelFlag,LabelContentArr,ClassID,ClassName,Rs,pages
Dim ArticleSort,TitleLen,RowHeight,ColNumber,TitleCss,DateCss,DateForm,DateAlign,NavType,ListNumber
Dim sysdir,TypeClassName,OpenType,MoreLinkType,MoreLinkWord,MoreLinkpic,Division,TypeNew,NavPic,NavWord
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"))
Dim ActF,divid,divclass,ulid,ulclass,liid,liclass,Str
IF Action = "Add" Then
	ClassID = 0
	TitleLen =30
	ColNumber = 1
	RowHeight = 20
	ListNumber = 10
	ActF=1
	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, "{$CorrelationArticleList(", ""), ")}", "")
		LabelContent = Replace(LabelContent, """", "") 
		LabelContentArr = Split(LabelContent, "§")
		ActF = LabelContentArr(0)
		ArticleSort = LabelContentArr(1)'排序方法
		ListNumber = LabelContentArr(2)'文章数量
		OpenType =  LabelContentArr(3)'链接目标
		RowHeight = LabelContentArr(4)'文章行距
		TitleLen = LabelContentArr(5)'标题字数
		ColNumber = LabelContentArr(6)'排列列数
		TypeClassName = LabelContentArr(7)'是否显示栏目
		TypeNew = LabelContentArr(8)'最新文章标志
		NavType = LabelContentArr(9)'导航类型
		
		Division = LabelContentArr(11)'分隔图片
		DateForm = LabelContentArr(12)'日期格式
		DateAlign = LabelContentArr(13)'日期对齐
		TitleCss = LabelContentArr(14)'标题样式
		DateCss  = LabelContentArr(15)'日期样式
		
		'ActF=LabelContentArr(16)
		divid=LabelContentArr(16)
		divclass=LabelContentArr(17)
		ulid=LabelContentArr(18)
		ulclass=LabelContentArr(19)
		liid=LabelContentArr(20)
		liclass=LabelContentArr(21)
		IF NavType = 0 Then 
			NavWord = LabelContentArr(10)
			Navpic = ""
		Else
			NavWord = ""
			Navpic = LabelContentArr(10)
		End If
		pages = "修改相关栏目文章列表标签"
End IF
 With Response 
%>
<form id="myform" name="myform" method="post" action="AddLabelSave.asp">
 <input type="hidden" name="LabelContent"> 
  <input type="hidden" name="LabelType" value="1">
  <input type="hidden" name="Action" value="<%= Action %>"> 
  <input type="hidden" name="ID" value="<%= ID %>"> 
 <input type="hidden" name="FileUrl" value="CorrelationArticleList.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%" >标签名称
      <input name="LabelName" type="text" id="LabelName" value="<%= LabelName %>"></td>
      <td width="50%" >&nbsp;</td>
    </tr>
    <tr>
      <td >标签目录      
        <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><b>新建存放目录</b></font></a></td>
	 <td width="50%" height="24"  ><font color=green>标签存放目录,日后方便管理标签</font></td>
    </tr>
  
 <tr>
      <td width="50%" >
	  输出格式
		 <select  style='width:70%' name="ActF" id="ActF" onChange="SetActF(this.options[this.selectedIndex].value);"> 
	 <option value="1" <% IF ActF = 1 Then Response.Write("selected") %>>普通Table格式</option>
  <option value="2" <% IF ActF = 2 Then Response.Write("selected") %>>DIV+CSS格式</option>
  </select>   
		 </td>
      <td width="50%" ><font color=red>请选择系统支持的输出格式</font>
	  </td>
    </tr>
  <tr id=ActFs ><td  colspan="2" >&lt;div id=&quot;
 <input name="divid" type="text" value="<%= divid %>" id="divid" size="6"  style="border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width:0px;border-bottom-color: #000000"  title="DIV调用的ID号，必须在CSS中预先定义且不能为空!">
 &quot; Class=&quot; <input name="divclass"  type="text" value="<%= divclass %>" id="divclass" size="6" style="border-top-width: 0px;	border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-bottom-color: #000000" title="DIV调用的Class名称，请在CSS中预先定义,可以为空!">
  &quot;&gt;&nbsp; &lt;ul  id=&quot; <input value="<%= ulid %>" name="ulid" type="text" id="ulid"  size="6" style="border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-bottom-color: #000000"  title="生成ul调用的ID，请在CSS中预先定义,可以为空!"> 
  &quot; Class=&quot; <input  value="<%= ulclass %>" name="ulclass"  type="text" id="ulclass" size="6" style="border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-bottom-color: #000000" title="生成ul调用的class名称，请在CSS中预先定义。可以为空!">
  &quot;&gt;&nbsp;&lt;li id=&quot; <input value="<%= liid %>" name="liid" type="text" id="liid" size="6"  style="border-top-width: 0px;	border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-bottom-color: #000000" title="生成li调用的ID，请在CSS中预先定义。可以为空!">
  &quot; Class=&quot; <input value="<%= liclass %>" name="liclass"  type="text" id="liclass" size="6" style="border-top-width: 0px;border-right-width: 0px;border-bottom-width: 1px;border-left-width: 0px;border-bottom-color: #000000"  title="生成li调用的class名称，请在CSS中预先定义。可以为空!"> 
  &quot;&gt;<font color=green>如果不想输出该标签,请将ID设为0,例:ul的id设为0,将不输出ul</font></td>
	</tr>
   

    <tr>
      <td >排序方法
	  <select   name="ArticleSort">
			<%.Write AF.ACT_ArticleSort(ArticleSort) %>			
		</select>		      </td>
      <td ><div style="position:relative;">链接目标<span style="margin-left:175px;width:18px;overflow:hidden;">
        <select name="select"  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  name="OpenType" style="width:175px;position:absolute;left:55px;" value="<%= OpenType %>">
      </div></td>
    </tr>
    <tr>
      <td >
	  文章数量
	   	  <input name="ListNumber" type="text" id="ListNumber" value="<%= ListNumber %>" onKeyUp="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">	  </td>
      <td >文章行距
      <input name="RowHeight" type="text" id="RowHeight2"    style="width:70%;" value="<%= RowHeight %>"></td>
    </tr>
    <tr>
      <td >标题字数
      <input name="TitleLen"  type="text"    style="width:70%;" value="<%= TitleLen %>"></td>
      <td >排列列数
        <input type="text"   size="4" value="<%= ColNumber %>" name="ColNumber"></td>
    </tr>
    <tr>
      <td colspan="2" >附加显示
      <input name="TypeClassName" type="checkbox" id="TypeClassName"  value="<%= TypeClassName %>"  <% IF TypeClassName = "true" Then Response.Write("Checked") %>><label for="TypeClassName">显示栏目</label>&nbsp;&nbsp;&nbsp;     
		<% 	
		  .Write "&nbsp;&nbsp;&nbsp;"
		 If  cbool(TypeNew) = True Then
		  .Write ("<input id=""TypeNew1"" type=""checkbox"" value=""true"" name=""TypeNew"" checked><label for=""TypeNew1"">最新文章标志</label>")
		 Else
		  .Write ("<input id=""TypeNew2"" type=""checkbox"" value=""true"" name=""TypeNew""><label for=""TypeNew2"">最新文章标志</label>")
		 End If
		 .Write "&nbsp;&nbsp;&nbsp;"

 %>             </td>
    </tr>
    <tr >
      <td >导航类型
        <input id="NavType1"  <% IF NavType = 0 Then Response.Write("Checked") %> type="radio" name="NavType" value="0" onClick="SetNavStatus(1);"><label for="NavType1">文字导航</label>
         <input id="NavType2" <% IF NavType = 1 Then Response.Write("Checked") %>   type="radio" name="NavType" value="1" onClick="SetNavStatus(2);"><label for="NavType2">图片导航</label>		</td>
    <td width="50%" height="24"   id=SetNavStatus1 
	<% if NavType=1 then %>
	style="DISPLAY: none" 
	<% end if %>>
 <input name="NavWord" type="text" id="NavWord" style="width:70%;" value="<%= NavWord %>"> 
 支持HTML语法</td>
   <td width="50%" height="24"   id=SetNavStatus2 
	<% if NavType=0 then %>
	style="DISPLAY: none"
	SetNavStatus1.style.display=''
	<% end if %> >
<input name="NavPic" type="text" id="NavPic" style="width:250;" value="<%= NavPic %>" readonly>
<input class="ACT_btn" type="button"  onClick="OpenWindowAndSetValue('../print/SelectPic.asp?CurrPath=<%=sysdir%>',500,320,window,document.myform.NavPic);" value="选择图片...">&nbsp;<span style="cursor:hand;color:green;" onClick="javascript:document.myform.NavPic.value='';" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='green'">清除</span></td>  
    </tr>
    <tr>
      <td colspan="2" >分隔图片
      <input name="Division" type="text" id="Division" style="width:61%;" value="<%= Division %>" readonly>
	  <input class="ACT_btn" type="button" onClick="OpenWindowAndSetValue('../print/SelectPic.asp?CurrPath=<%=sysdir%>',500,320,window,document.myform.Division);" name="Submit3" value="选择图片...">
	 &nbsp;<span style="cursor:hand;color:green;" onClick="javascript:document.myform.Division.value='';" onMouseOver="this.style.color='red'" onMouseOut="this.style.color='green'">清除</span>	  </td>
    </tr>
    <tr>
      <td >日期格式
        <select  style="width:70%;" name="DateForm" id="select2">
    <% 
		.Write AF.ACT_DateStr(DateForm)
			 %>
        </select>      </td>
      <td >日期对齐

<% 		.Write "  <select class=""textbox"" name=""DateAlign"" id=""select3"" style=""width:70%;"">"
							
					If ID = "" Or CStr(DateAlign) = "left" Then
					 Str = " selected"
					Else
					 Str = ""
					End If
					 .Write ("<option value=""left""" & Str & ">左对齐</option>")
					If CStr(DateAlign) = "center" Then
					 Str = " selected"
					Else
					 Str = ""
					End If
					 .Write ("<option value=""center""" & Str & ">居中对齐</option>")
					If CStr(DateAlign) = "right" Then
					 Str = " selected"
					Else
					 Str = ""
					End If
					 .Write ("<option value=""right""" & Str & ">右对齐</option>")
					 
				.Write "                  </select>"
		End With %>    </td>
    </tr>
    <tr>
      <td >标题样式
      <input name="TitleCss" type="text" id="TitleCss" style="width:70%;" value="<%= TitleCss %>"></td>
      <td >日期样式
      <input name="DateCss" type="text" id="DateCss" style="width:70%;" value="<%= DateCss %>"></td>
    </tr>
    <tr>
      <td colspan="2" align="center" >
	   <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 SetNavStatus(n){
			if (n==1){
			SetNavStatus1.style.display='';
			SetNavStatus2.style.display='none';	
			}
		  else{
			SetNavStatus1.style.display='none';
			SetNavStatus2.style.display='';	
		}
}


		function SetActF(Val)
		{
		 if(Val==1)	
			{
			 ActFs.style.display="none";
			}
		 if(Val==2)	
			{
			 ActFs.style.display="";
			}
		 if(Val==3)	
			{
			 ActFs.style.display="none";
			}
		}

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()
		{   if (document.myform.LabelName.value=='')
			 {
			  alert('请输入标签名称');
			  document.myform.LabelName.focus(); 
			  return false
			  }
			var NavType=1;
			var TypeClassName,TypeWordPic,TypeNew,TypeHot;
			var OpenType='"'+document.myform.OpenType.value+'"';
			var RowHeight=document.myform.RowHeight.value;
			var TitleLen=document.myform.TitleLen.value;
			var ListNumber=document.myform.ListNumber.value;
			var ArticleSort='"'+document.myform.ArticleSort.value+'"';
			var ColNumber=document.myform.ColNumber.value;
			var Nav,NavType=document.myform.NavType.value;
			var Division='"'+document.myform.Division.value+'"';
			var DateForm=document.myform.DateForm.value;
			var DateAlign='"'+document.myform.DateAlign.value+'"';
			var TitleCss='"'+document.myform.TitleCss.value+'"';
			var DateCss='"'+document.myform.DateCss.value+'"';
			var ActF=document.myform.ActF.value;

			var divid=document.myform.divid.value;
			var divclass=document.myform.divclass.value;
			var ulid=document.myform.ulid.value;
			var ulclass=document.myform.ulclass.value;
			var liid=document.myform.liid.value;
			var liclass=document.myform.liclass.value;

			if (document.myform.TypeClassName.checked)
				TypeClassName = true
			else
			    TypeClassName =false;

			if (document.myform.TypeNew.checked)
			   TypeNew= true
			else
			   TypeNew=false;

			if (RowHeight=='') RowHeight=20
			if  (TitleLen=='') TitleLen=30;
			if  (ColNumber=='') ColNumber=1;
			for (var i=0;i<document.myform.NavType.length;i++){
			 var TCJ = document.myform.NavType[i];
			if (TCJ.checked==true)	   
				NavType = TCJ.value
			if  (NavType==0) Nav='"'+document.myform.NavWord.value+'"'
			 else  Nav='"'+document.myform.NavPic.value+'"';
			}
		
			
			//-----------------------------
			document.myform.LabelContent.value=	'{$CorrelationArticleList('+ActF+'§'+ArticleSort+'§'+ListNumber+'§'+OpenType+'§'+RowHeight+'§'+TitleLen+'§'+ColNumber+'§'+TypeClassName+'§'+TypeNew+'§'+NavType+'§'+Nav+'§'+Division+'§'+DateForm+'§'+DateAlign+'§'+TitleCss+'§'+DateCss+'§'+divid+'§'+divclass+'§'+ulid+'§'+ulclass+'§'+liid+'§'+liclass+')}';
			document.myform.SubmitBtn.value="正在提交数据,请稍等...";
			document.myform.SubmitBtn.disabled=true;
			document.myform.Submit.disabled=true;	
			document.myform.submit();
		}
	
</script><script language="javascript">SetActF(<%= ActF %>);</script>
</body>
</html>
