<!--#include file="../ACT.Function.asp"-->
<!--#include file="../include/ACT.F.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>栏目管理</title>
<link href="../Images/css1/css.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="../../ACT_inc/Prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="../../ACT_inc/ActHelp.js"></script>
</head>
<body>
<% Dim ClassName,EnName,ChangesLinkUrl,dh,tg,ParentID,CMS_Extension,disabled
Dim ClassID,ClassKeywords,ClassDescription,GetParentID,ConTentTemplate,FolderTemplate
Dim GroupIDClass,TGGroupID,OrderID,TiesDomain,ModeName,ModeID,classnames,ActCMS_DIY
ClassID = request("ClassID")
 ModeID = ACTCMS.ChkNumeric(Request("ModeID"))
 if ModeID=0 or ModeID="" Then ModeID=1
 ModeName= ACTCMS.ACT_C(ModeID,1) 
 If Not ACTCMS.ACTCMS_QXYZ(ModeID,"","") Then   Call Actcms.Alert("对不起，您没有"&ACTCMS.ACT_C(ModeID,1)&"系该项操作权限！","")

With Response
IF Request("Action") = "add" Then
	ActCMS_DIY=Split(AF.ActCMS_DIY_F(ModeID,1,""),"§") 

	dh=1:tg=1:CMS_Extension="Index.Htm":OrderID=10
	if ClassID <>"" then
		GetParentID =  ClassID
		FolderTemplate=ActCMS_DIY(23)
	Else
		GetParentID = "0"
		FolderTemplate=ActCMS_DIY(22)
	End if
	IF ClassID <> "" Then 
		Dim Rs,ShowErr
		Set Rs=server.CreateObject("adodb.recordset") 
		Rs.OPen "Select ChangesLinkUrl from Class_Act where ClassID='"& ClassID &"' and ChangesLinkUrl='' order by id desc",Conn,1,1
		IF Rs.Eof Then '判断是否为转向链接
			ShowErr = "<li>转向链接不能添加子类</li>"
			.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1")
		End If
		classnames =ACTCMS.ACT_L(ClassID,2)
	Else
		classnames ="根栏目"
	End If

	ConTentTemplate=ActCMS_DIY(24)
Else
	Set Rs = server.CreateObject("adodb.recordset")
	Rs.open "select * From  Class_Act where ClassID = '"& ClassID &"'",Conn,1,3
	if Not   Rs.eof then
		dh = Rs("dh"):tg = Rs("tg")
		ClassName = Rs("ClassName")
		EnName = Rs("EnName") 
		CMS_Extension = Rs("Extension")
		ClassDescription = Rs("ClassDescription")
		ClassKeywords = Rs("ClassKeywords")
		ChangesLinkUrl = Rs("ChangesLinkUrl")
		TGGroupID = Rs("TGGroupID")
		ConTentTemplate=Rs("ConTentTemplate")
		OrderID=Rs("OrderID")
		GroupIDClass=Rs("GroupIDClass")
		FolderTemplate=Rs("FolderTemplate")
		Dim Rs1
		Set Rs1=actcms.actexe("Select ClassName From Class_Act Where ClassID='" &Rs("ParentID")&"' ")
		If Not Rs1.EOF Then classnames=Rs1("ClassName") Else classnames ="根栏目"
		disabled="disabled=true "
	End If
End If
 %>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  <tr>
    <td class="bg_tr">您现在的位置：<%=ModeName%>管理 &gt;&gt; 栏目管理</td>
  </tr>
  <tr>
		<td height="18" ><a href="ACT.Class.asp?ModeID=<%=ModeID %>">管理首页</a>┆<a href="ACT.ClassAdd.asp?ModeID=<%=ModeID %>&Action=add">添加根栏目</a>┆<a href="ACT.ClassAct.asp?Action=one&ModeID=<%=ModeID %>">栏目排序</a></td>
  </tr>
</table>

  <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <form id="Article" name="Article" method="post" action="ACT.ClassSave.asp?ModeID=<%=ModeID%>&action=<%= request("Action")%>"><tr>
      <td colspan="2" align="center" class="bg_tr">添加/修改<%=ModeName%>栏目</td>
    </tr>
    <tr>
      <td width="23%" align="right"><strong><%=ModeName%>栏目名称：</strong></td>
      <td><input name="ClassName" id="ClassName" value="<%= ACTCMS.HTMLCode(ClassName) %>" size="35" /> 
      <span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_001',this)">帮助</span> 
	  支持HTML语法
		<input name="ClassID" type="hidden" id="ClassID" value="<%= ClassID %>" readonly>
		<input name="ParentID" type="hidden" id="ParentID" value="<%= GetParentID %>" readonly> 
		</td>
    </tr>
    <tr>
      <td align="right"><strong>栏目英文名称：</strong></td>
      <td>
        <input name="EnName" id="EnName" value="<%= EnName %>" <% If Request("Action")="edit" then .Write disabled %> size="35" />
       <span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_002',this)">帮助</span>
		<% If Request("Action")="add" then %><label for="IFPinYin">
        <input  id="IFPinYin" value="1" type="checkbox"  name="IFPinYin" onClick="IFPinYins()" />
          栏目拼音</label>
     <font color="red">英文名称</strong>必须是字母,数字,确认后不能修改</font>
	 <% end if %></td>
    </tr>
    <tr>
      <td align="right"><strong>捆绑域名：</strong></td>
      <td><input name="TiesDomain" type="text" value="<%= TiesDomain %>" size="35" />
	  <span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_003',this)">帮助</span>不捆绑请留空</td>
    </tr>
    <tr>
      <td align="right"><strong>栏目模板地址：</strong></td>
      <td>
	  <input  name="FolderTemplate" type="text" size="35"  value="<%= FolderTemplate %>" />
	 <input class="ACT_btn" type="button"  onClick="OpenWindowAndSetValue('../include/print/SelectPic.asp?CurrPath=<%=ACTCMS.ActCMS_Sys(3)%>templets',500,320,window,document.Article.FolderTemplate);" value="选择模板..."> 
	 <span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_004',this)">帮助</span></td>
    </tr>
    <tr>
      <td align="right"><strong>内容页模板地址：</strong></td>
      <td><input name="ConTentTemplate" type="text" size="35" value="<%= ConTentTemplate %>" />
	 <input class="ACT_btn" type="button"  onClick="OpenWindowAndSetValue('../include/print/SelectPic.asp?CurrPath=<%=ACTCMS.ActCMS_Sys(3)%>templets',500,320,window,document.Article.ConTentTemplate);" value="选择模板..."> 
		<span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_005',this)">帮助</span></td>
    </tr>
    <tr>
      <td align="right"><strong>排列权重：</strong></td>
      <td><input name="OrderID" type="text" value="<%= OrderID %>" />
	  <span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_006',this)">帮助</span></td>
    </tr>
    <tr>
      <td align="right"><strong>所属分类：</strong></td>
      <td><%=classnames %></td>
    </tr>
    <tr>
      <td align="right"><strong>是否隐藏栏目：</strong></td>
      <td>
        <label for=dh1>
        <input  type=radio  value=1 <%If dh = 1 then response.Write("Checked ")  %> name=dh id=dh1>
        &nbsp;&nbsp;否&nbsp;&nbsp;</label>
        <label for=dh2>
        <input type=radio  <%If dh = 0 then response.Write("Checked ")  %> value=0 name=dh id=dh2>
        &nbsp;&nbsp;是&nbsp;&nbsp;</label>   
		 <span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_007',this)">帮助</span></td>
    </tr>
    <tr>
      <td align="right"><strong>是否转向链接：</strong></td>
      <td>
        <label for=ChangesLink0>
        <input onClick=ClassSetting(0) type=radio <%= disabled %> <%If ChangesLinkUrl = "" then response.Write("Checked ")  %>  value=0 name=ChangesLink id=ChangesLink0>
        &nbsp;&nbsp;否&nbsp;&nbsp;</label>
        <label for=ChangesLink1>
        <input onClick=ClassSetting(1) type=radio <%= disabled %> <%If ChangesLinkUrl <> ""  then response.Write("Checked ")  %>  value=1 name=ChangesLink id=ChangesLink1>
        &nbsp;&nbsp;是&nbsp;&nbsp;</label>    
		<span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_008',this)">帮助</span></td>
    </tr>
    <tr  id=ClassSetting1 >
      <td align="right"><STRONG>转向链接URL：</STRONG></td>
      <td>
        <input name=ChangesLinkUrl value="<%If ChangesLinkUrl <> "0" then response.Write ChangesLinkUrl  %>" size=45>
      </td>
    </tr>
    <tr id=ClassSetting2>
      <td align="right"><strong>栏目首页文件：</strong></td>
      <td><input name="Extension" type="text" id="Extension" value="<%= CMS_Extension %>" size="10"> 
             <select name="select" onChange="document.Article.Extension.value=this.value">
			 <option value='index.htm'>index.htm</option>
			 <option value='index.html'>index.html</option>
			 <option value='index.asp'>index.asp</option>
			 <option value='index.shtm'>index.shtm</option>
			 <% IF Request("Action") = "edit" Then %>
			 <option value='<%= CMS_Extension %>' selected>default.shtm</option>
			 <% end if  %>
            </select>
           <span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_009',this)">帮助</span>
		   (如index.html,index.asp等)</td>
    </tr>

    <tr id=ClassSetting4>
      <td align="right"><strong>栏目是否允许投稿：</strong></td>
      <td>
        <label for=tg1>
        <input type=radio  value=0 name=tg id=tg1 <% if tg = 0 then .Write("Checked") %>>
        &nbsp;&nbsp;否&nbsp;&nbsp;</label>
        <label for=tg2>
        <input type=radio Checked value=1 name=tg id=tg2 <% if tg = 1 then .Write("Checked") %>>
        &nbsp;&nbsp;是&nbsp;&nbsp;</label>  
	<span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_010',this)">帮助</span>	</td>
    </tr>
    <tr id=ClassSetting5>
      <td align="right"><strong>栏目META关键字：</strong></td>
      <td>
        <textarea name="ClassKeywords" style="width:80%" rows="5" id="ClassKeywords"><%= ClassKeywords %></textarea> 
		<span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_011',this)">帮助</span></td>
    </tr>
    <tr id=ClassSetting6>
      <td align="right"><strong>栏目META描述：</strong></td>
      <td>
        <textarea name="ClassDescription" style="width:80%" rows="5" id="ClassDescription"><%= ClassDescription %></textarea>
		<span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_012',this)">帮助</span></td>
    </tr>
    <tr id=ClassSetting7>
      <td align="right"><STRONG>浏览/查看权限：</STRONG></td>
      <td>	      				
	<%= actcms.GetGroup_CheckBox("GroupIDClass",GroupIDClass,5)  %>
<span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_013',this)">帮助</span>
					 </td>
    </tr>
    <tr id=ClassSetting8>
      <td align="right"><STRONG>允许此栏目下投稿的会员组：</STRONG></td>
      <td><%= actcms.GetGroup_CheckBox("TGGroupID",TGGroupID,5)  %>
	  <span class="h" style="cursor:help;" title="点击显示帮助" onclick="Help('ACTClassAdd_014',this)">帮助</span></td>
    </tr>
    <tr>
      <td colspan="2" align="center">
        <input type=button class="ACT_btn" onclick=CheckForm() name=Submit value="  保存  " />
&nbsp;&nbsp;
<input class="ACT_btn" type="reset" name="Submit2" value="  重置  ">
     </td>
    </tr></form>
  </table>
  <% End With %>
<script language = "JavaScript">
function ClassSetting(n){
	if (n == ""){
		ClassSetting1.style.display='none';
		ClassSetting2.style.display='';
		ClassSetting4.style.display='';
		ClassSetting5.style.display='';
		ClassSetting6.style.display='';
		ClassSetting7.style.display='';
		ClassSetting8.style.display='';
	}
	else{
		ClassSetting1.style.display='';
		ClassSetting2.style.display='none';
		ClassSetting4.style.display='none';
		ClassSetting5.style.display='none';
		ClassSetting6.style.display='none';
		ClassSetting7.style.display='none';
		ClassSetting8.style.display='none';
	}
}
function IFPinYins()
			{ if (document.Article.IFPinYin.checked==true)
			  {
			  document.Article.EnName.disabled=true;
			  document.Article.EnName.value="不能修改";
			  }
			  else
				{
				document.Article.EnName.checked=true;
				  document.Article.EnName.disabled=false;
				   document.Article.EnName.value="";
				 }
			}
function CheckForm()
{ var form=document.Article;
   if (form.ClassName.value=='')
    { alert("请输入栏目的分类名称!");   
	  form.ClassName.focus();    
	   return false;
    }
		form.Submit.value="正在提交数据,请稍等...";
		form.Submit.disabled=true;	
		form.Submit2.disabled=true;	
	    form.submit();
        return true;
}
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;
}	</script>
<script language="javascript">ClassSetting(<%=""""&ChangesLinkUrl&""""%>);</script>
</body>
</html>
