<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="TotCms.Web.Office.Module.Manage" %>
<!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 id="Head1" runat="server">
<title>模块管理</title>
<link href="../style/global.css" rel="stylesheet" type="text/css" />
<script src="../../js/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="js/tree_view.js" type="text/javascript"></script>
<script type="text/javascript">
    function SearchCatalog() {
        var s = document.form1.Key.value;
        if (s != "") {
            rootCell.parentNode.parentNode.parentNode.parentNode.removeChild(rootCell.parentNode.parentNode.parentNode);
            iconMap.length = 0;
            iconList.length = 0;
            s = encodeURI(s);            
            Initialise();
            d = CreateTreeItem(rootCell, "../images/tree/project.gif", "../images/tree/project.gif", 0, "ROOT", null, null, 2);
            $.ajax({
                url: 'GetSearch.aspx?key=' + s,      //异步方法
                type: 'get',
                dataType: 'xml',
                timeout: 1000,                            //延迟1秒执行
                error: function () {                        //返回失败后
                    alert('Error loading XML document');
                },
                success: function (xml) {              //返回成功
                    $(xml).find("category").each(function () {         //找到根节点
                        var id = $(this).children("id").text();
                        var tt = $(this).children("title").text();
                        CreateTreeItem(d, "../images/tree/folder_closed.gif", "../images/tree/folder_open.gif", id, tt, "Module_Edit.aspx?id=" + id, "_self", 1);
                    });
                }
            });            
        }
    }
    function addChild(pdiv, classid, classtitle) {
        CreateTreeItem(pdiv, "../images/tree/folder_closed.gif", "../images/tree/folder_open.gif", classid, classtitle, "Module_Edit.aspx?id=" + classid, "_self", 1);
    }
    function ConfirmDel() {
        if (confirm('确定删除吗？'))
            return true;
        else
            return false;
    }
</script>
</head>
<body onload="CreateProjectExplorer()">
    <form id="form1" runat="server">
    <div id="right_dqwz">模块管理</div>
    <table cellpadding="0" cellspacing="1" border="0" width="100%">
      <tr>
        <td class="topic"><a href="Module_Edit.aspx">添加新模块&gt;</a></td>
      </tr> 
      <tr>
        <td height="25" style="padding:0px 8px;">
          <div class="notice">
          关键字：
            <input id="Key" name="Key" type="text" onkeyup="SearchCatalog()" /><input id="Button1" type="button" 
                  value="搜索" onclick="SearchCatalog()" />
          [提示：<img alt="显示子模块" src="../images/tree/plus.gif" 
                  style="width: 16px; height: 16px" /> 显示子模块&nbsp; <img alt="添加模块" src="../images/icon/add.gif" style="width: 14px; height: 14px" /> 添加模块 <img alt="删除模块" src="../images/icon/del.gif" style="width: 15px; height: 15px" /> 删除模块]</div>
          </td>
      </tr>  
      <tr>
        <td>
          <div id="DivJs" runat="server"></div>
        </td>
      </tr>
        
    </table>
    </form>
</body>
</html>
