<!--#include file="fy.Function.asp"-->
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>fycms内容管理系统</title> 
<LINK href="../fy_inc/dtree.css" type=text/css rel=StyleSheet>
<SCRIPT src="../fy_inc/lhgtree.js" type=text/javascript></SCRIPT>
</head>
<body onload="d.openAll();">
<div class="dtreebox">
	<div class="showhide"><a href="javascript: d.openAll();" id="allshow">全部展开</a> | <a href="javascript: d.closeAll();" id="allhide">全部折叠</a></div>
  	<%
		Call InitTree()
	%>
</div>
 
 <%
      
 
	Function InitTree()

    echo "        <script type=""text/javascript"">" & vbCrLf
    echo "        <!--" & vbCrLf
    echo "        d = new dTree('d');" & vbCrLf
    echo "        d.config.inputType = 0;" & vbCrLf
    echo "			d.config.useIcons = true;" & vbCrLf
	echo "        d.add(0, -1, '栏目列表',null,null,null,null);" & vbCrLf
	echo  Classmake
    echo "        document.write(d);" & vbCrLf
    echo "        //-->" & vbCrLf
    echo "        </script>" & vbCrLf
End Function 

	function Classmake
		 Dim Crs
		 Set Crs = Conn.Execute("Select * from Class_fy where rootid=0   Order by Orderid desc,ID desc")
		 If Not  Crs.Eof Then
		 do while Not Crs.Eof
		 'echo Crs("ClassID")&"-"
			If   fycms.fycms_QXYZ(Crs("ModeID"),"1",Crs("ClassID")) Then  
				If Crs("actlink")="3" Then 
 				  echo "        d.add(" & Crs("ClassID") & ",0,'" & Crs("ClassName") & "','fy_Mode/fy.diyname.ClassAdd.asp?Action=edit&ModeID="&Crs("Modeid")&"&ClassID="&Crs("ClassID")&"','"&Crs("ClassName")&"','ifrcontent',null,null,null,0,true,'" & Crs("ClassID") & "');" & vbCrLf
				Else 
 				  echo "        d.add(" & Crs("ClassID") & ",0,'" & Crs("ClassName") & "','fy_Mode/fy.Manage.asp?Action=ListisAccept&ModeID="&Crs("Modeid")&"&ClassID="&Crs("ClassID")&"','"&Crs("ClassName")&"','ifrcontent',null,null,null,0,true,'" & Crs("ClassID") & "');" & vbCrLf
				End if
			End if
			  Classmake=Classmake&(GetChildClassList(Crs("ClassID")))
			  Crs.MoveNext
		  Loop
		  End IF
	 End function
	 Function GetChildClassList(ClassID)
	       Dim Sql,Rsc,CheckStr
	        Sql = "Select * from Class_fy where rootid=" & ClassID & "  "
	        Set Rsc = Conn.Execute(Sql)
			do while Not Rsc.Eof
			If   fycms.fycms_QXYZ(Rsc("ModeID"),"1",Rsc("ClassID")) Then  
				If Rsc("actlink")="3" Then 
					echo "        d.add(" & Rsc("ClassID") & "," & Rsc("rootid") & ",'" & Rsc("ClassName") & "','fy_Mode/fy.diyname.ClassAdd.asp?Action=edit&ModeID="&Rsc("Modeid")&"&ClassID="&Rsc("ClassID")&"','"&Rsc("ClassName")&"','ifrcontent',null,null,null,0,true,'" & Rsc("ClassID") & "');" & vbCrLf
				Else 
					echo "        d.add(" & Rsc("ClassID") & "," & Rsc("rootid") & ",'" & Rsc("ClassName") & "','fy_Mode/fy.Manage.asp?Action=ListisAccept&ModeID="&Rsc("Modeid")&"&ClassID="&Rsc("ClassID")&"','"&Rsc("ClassName")&"','ifrcontent',null,null,null,0,true,'" & Rsc("ClassID") & "');" & vbCrLf
				End If 
			End if
				GetChildClassList = GetChildClassList & GetChildClassList(Rsc("ClassID"))
			 Rsc.MoveNext
		   loop
		   Set Rsc = Nothing
	 End Function 
 %><script type="text/javascript">
		
		lhgmenu.init();
		
		lhgmenu.config.bmenu = [
				{ txt : '添加内容', ico : '', cmd : function(){window.parent.frames['ifrcontent'].location = 'fy_Mode/fy.Add.asp?Action=t&ClassID='+lhgmenu.id;} },
 				{ txt : '修改栏目', ico : '', cmd : function(){window.parent.frames['ifrcontent'].location = 'fy_Mode/fy.ClassAdd.asp?Action=edit&ClassID='+lhgmenu.id;}  },
 				
 				{ txt : '生成栏目', ico : '', cmd : function(){window.parent.frames['ifrcontent'].location = 'include/fy.L.asp?RefreshFlag=IDS&CID='+lhgmenu.id;} },
 				{ txt : '增加新栏目', ico : '', cmd : function(){window.parent.frames['ifrcontent'].location = 'fy_Mode/fy.ClassAdd.asp?Action=add&ClassID='+lhgmenu.id;} },
			 	{ line : true }
				];
		lhgmenu.config.amenu = [
				//{ txt : '增加新栏目', ico : '', cmd : 'fy_Mode/fy.ClassAdd.asp?ModeID=5&ClassID=0479576662&Action=add' },
				//{ txt : '增加采集节点', ico : '', cmd : '' },
				//{ txt : '管理附件', ico : '', cmd : '' }
			];

</script> 