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