catalog_top.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="java.io.InputStream" %>
  3. <%@ page import="java.util.*" %>
  4. <%@ page import="cn.js.fan.db.*" %>
  5. <%@ page import="com.redmoon.forum.plugin.auction.*" %>
  6. <%@ page import="cn.js.fan.util.*" %>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  11. <title>目录</title>
  12. <LINK href="../manager/default.css" type=text/css rel=stylesheet>
  13. <script>
  14. function findObj(theObj, theDoc)
  15. {
  16.   var p, i, foundObj;
  17.   
  18.   if(!theDoc) theDoc = document;
  19.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  20.   {
  21.     theDoc = parent.frames[theObj.substring(p+1)].document;
  22.     theObj = theObj.substring(0,p);
  23.   }
  24.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  25.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  26.     foundObj = theDoc.forms[i][theObj];
  27.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  28.     foundObj = findObj(theObj,theDoc.layers[i].document);
  29.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  30.   
  31.   return foundObj;
  32. }
  33. function ShowChild(imgobj, name)
  34. {
  35. var tableobj = findObj("childof"+name);
  36. if (tableobj.style.display=="none")
  37. {
  38. tableobj.style.display = "";
  39. if (imgobj.src.indexOf("i_puls-root-1.gif")!=-1)
  40. imgobj.src = "images/i_puls-root.gif";
  41. if (imgobj.src.indexOf("i_plus-1-1.gif")!=-1)
  42. imgobj.src = "images/i_plus2-2.gif";
  43. if (imgobj.src.indexOf("i_plus-1.gif")!=-1)
  44. imgobj.src = "images/i_plus2-1.gif";
  45. }
  46. else
  47. {
  48. tableobj.style.display = "none";
  49. if (imgobj.src.indexOf("i_puls-root.gif")!=-1)
  50. imgobj.src = "images/i_puls-root-1.gif";
  51. if (imgobj.src.indexOf("i_plus2-2.gif")!=-1)
  52. imgobj.src = "images/i_plus-1-1.gif";
  53. if (imgobj.src.indexOf("i_plus2-1.gif")!=-1)
  54. imgobj.src = "images/i_plus-1.gif";
  55. }
  56. }
  57. </script>
  58. <style type="text/css">
  59. <!--
  60. body {
  61. margin-left: 0px;
  62. margin-top: 0px;
  63. margin-right: 0px;
  64. }
  65. -->
  66. </style></head>
  67. <body>
  68. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  69. <jsp:useBean id="dir" scope="page" class="com.redmoon.forum.plugin.auction.Directory"/>
  70. <%
  71. String root_code = ParamUtil.get(request, "root_code");
  72. if (root_code.equals(""))
  73. {
  74. root_code = "root";
  75. }
  76. %>
  77. <jsp:useBean id="leafPriv" scope="page" class="com.redmoon.forum.plugin.auction.LeafPriv"/>
  78. <%
  79. LeafPriv lp = new LeafPriv();
  80. lp.setDirCode(root_code);
  81. if (!lp.canUserModify(privilege.getUser(request))) {
  82. out.print(StrUtil.makeErrMsg(privilege.MSG_INVALID));
  83. return;
  84. }
  85. %>
  86. <Script>
  87. var root_code = "<%=root_code%>";
  88. // 使框架的bottom能得到此root_code
  89. function getRootCode() {
  90. return root_code;
  91. }
  92. </Script>
  93. <%
  94. String op = ParamUtil.get(request, "op");
  95. if (op.equals("AddRootChild")) {
  96. boolean re = false;
  97. try {
  98. re = dir.AddRootChild(request);
  99. }
  100. catch (ErrMsgException e) {
  101. out.print(StrUtil.Alert(e.getMessage()));
  102. }
  103. if (!re) {
  104. out.print(StrUtil.Alert("添加节点失败,请检查编码是否重复!"));
  105. }
  106. }
  107. if (op.equals("AddChild")) {
  108. boolean re = false;
  109. try {
  110. re = dir.AddChild(request);
  111. }
  112. catch (ErrMsgException e) {
  113. out.print(StrUtil.Alert(e.getMessage()));
  114. }
  115. if (!re) {
  116. out.print(StrUtil.Alert("添加节点失败,请检查编码是否重复!"));
  117. }
  118. }
  119. if (op.equals("del")) {
  120. String delcode = ParamUtil.get(request, "delcode");
  121. try {
  122. dir.del(delcode);
  123. out.print(StrUtil.Alert("删除成功!"));
  124. }
  125. catch (ErrMsgException e) {
  126. out.print(StrUtil.Alert(e.getMessage()));
  127. }
  128. }
  129. if (op.equals("modify")) {
  130. boolean re = true;
  131. try {
  132. re = dir.update(request);
  133. }
  134. catch (ErrMsgException e) {
  135. out.print(StrUtil.Alert(e.getMessage()));
  136. }
  137. if (re)
  138. out.print(StrUtil.Alert("修改完成"));
  139. }
  140. if (op.equals("move")) {
  141. try {
  142. dir.move(request);
  143. }
  144. catch (ErrMsgException e) {
  145. out.print(StrUtil.Alert(e.getMessage()));
  146. }
  147. }
  148. if (op.equals("removecache")) {
  149. String curcode = ParamUtil.get(request, "code");
  150. LeafChildrenCacheMgr.remove(curcode);
  151. out.print(StrUtil.Alert(curcode + "缓存已被清除!"));
  152. }
  153. Leaf leaf = dir.getLeaf(root_code);
  154. String root_name = leaf.getName();
  155. int root_layer = leaf.getLayer();
  156. String root_description = leaf.getDescription();
  157. boolean isHome = false;
  158. %>
  159. <table width='100%' cellpadding='0' cellspacing='0' >
  160.   <tr>
  161.     <td class="head">管理&nbsp;<%=root_name%></td>
  162.   </tr>
  163. </table>
  164. <br>
  165. <TABLE class="frame_gray"  
  166. cellSpacing=0 cellPadding=0 width="95%" align=center>
  167.   <TBODY>
  168.     <TR>
  169.       <TD height=200 valign="top" bgcolor="#FFFBFF">
  170. <table class="tbg1" cellspacing=0 cellpadding=0 width="100%" align=center onMouseOver="this.className='tbg1sel'" onMouseOut="this.className='tbg1'" 
  171. border=0>
  172.           <tbody>
  173.             <tr>
  174.               <td width="66%" height="13" align=left nowrap>              &nbsp;&nbsp;&nbsp;&nbsp;                             </td>
  175.             <td width="34%" align=right nowrap>>>&nbsp;<%=root_name%>&nbsp;&nbsp;<a target="_parent" href="document_list_m.jsp?dir_code=<%=StrUtil.UrlEncode(root_code)%>&dir_name=<%=StrUtil.UrlEncode(root_name)%>"></a><a href="dir_priv_m.jsp?dirCode=<%=StrUtil.UrlEncode(root_code)%>" target="_parent">权限</a>&nbsp;&nbsp;<a target=dirbottomFrame href="catalog_bottom.jsp?parent_code=<%=StrUtil.UrlEncode(root_code, "utf-8")%>&parent_name=<%=StrUtil.UrlEncode(root_name, "utf-8")%>&op=AddChild">添子目录</a> <a target="dirbottomFrame" href="catalog_bottom.jsp?op=modify&code=<%=StrUtil.UrlEncode(root_code, "utf-8")%>&name=<%=StrUtil.UrlEncode(root_name,"utf-8")%>&description=<%=StrUtil.UrlEncode(root_description,"utf-8")%>">修改</a> <!--<a target=_self href="#" onClick="if (window.confirm('您确定要删除<%=root_name%>吗?')) window.location.href='dir_top.jsp?op=del&delcode=<%=root_code%>'">删除</a>-->
  176.   </td>
  177.             </tr>
  178.           </tbody>
  179.         </table>
  180. <%
  181. DirectoryView tv = new DirectoryView(leaf);
  182. tv.list(out);
  183. %></TD>
  184.     </TR>
  185.   </TBODY>
  186. </TABLE>
  187. </body>
  188. </html>