<%@ Page Language="C#" AutoEventWireup="true" Inherits="Caicai.Framework.UI.Admin.Kernel" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="Caicai.Framework.Utils" %>
<script language="c#" runat="server">
public static string Link(string system, string id)
{
	if (system == "word")
	{
		return String.Format("c_{0}.aspx?action=update&id={1}&hide=InputDate", system, id);
	}
	else if (system == "case")
	{
		return String.Format("c_{0}.aspx?islike=true&classid={1}", system, id);
	}
	else
	{
		if (system.Contains("_"))
		{	
			if (system.IndexOf("include_") == 0)
				return String.Format("c_word.aspx?action=update&id={0}&hide=InputDate", id);
			else if (system.IndexOf("common_") == 0)
				return String.Format("c_common.aspx?islike=false&classid={0}&system={1}", id, system.Split('_')[1]);
			else
				return String.Format("c_{0}.aspx?islike=false&classid={1}", system.Split('_')[0], id);
		}
		else
		{
			return String.Format("c_{0}.aspx?islike=false&classid={1}", system, id);
		}
	}
}

public static string Img(string system)
{
	if (system.Contains("_"))
	{
		if (system.IndexOf("include_") == 0)
			return String.Format("images/ico_{0}.gif", "word");
		else if (system.IndexOf("common_") == 0)
			return String.Format("images/ico_{0}.gif", system.Split('_')[1]);
		else
			return String.Format("images/ico_{0}.gif", system.Split('_')[0]);
	}
	else
	{
		return String.Format("images/ico_{0}.gif", system);
	}
}
</script>
<!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>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="StyleSheet" href="include/dtree/dtree.css" />
<script type="text/javascript" src="include/dtree/dtree.js"></script>	
<link type="text/css" href="style.css" rel="stylesheet" rev="stylesheet" media="all" /> 
</head>
<body>
<script type="text/javascript">
<!--
d = new dTree('d');
d.add(10000,-1,'<%= Caicai.Framework.Common.Language.Get("C_Word") %>');
d.add(1000100,10000,'插入栏目','c_word.aspx?action=insert','','main','images/ico_word_insert.gif','images/ico_word_insert.gif');
d.add(0,10000,'栏目管理','c_word.aspx','','main','images/ico_word.gif','images/ico_word.gif');
<Caicai:CRepeater runat="server" Table="C_Word" Order="OrderNum desc">
	<ItemTemplate>
		d.add(<%#Eval("ID")%>,<%#Eval("ParentId")%>,'<%#Eval("Name")%>','<%# Link(Eval("System").ToString(),Eval("ID").ToString()) %>','','main','<%# Img(Eval("System").ToString()) %>','<%# Img(Eval("System").ToString()) %>');
	</ItemTemplate>
</Caicai:CRepeater>
document.write(d);
//-->
</script>
</body>
</html>