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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="java.util.*"%>
  3. <%@ page import="cn.js.fan.util.*"%>
  4. <%@ page import="cn.js.fan.web.*"%>
  5. <%@ page import="com.redmoon.forum.plugin.*"%>
  6. <%@ page import="com.redmoon.forum.plugin.entrance.*"%>
  7. <%@ page import="com.redmoon.forum.*"%>
  8. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  9. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  10. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  11. <html><head>
  12. <meta http-equiv="pragma" content="no-cache">
  13. <LINK href="default.css" type=text/css rel=stylesheet>
  14. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title><lt:Label res="res.label.forum.admin.entrance" key="plugin_manager"/></title>
  17. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  18. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  19. <%
  20. if (!privilege.isMasterLogin(request)) {
  21. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  22. return;
  23. }
  24. String op = ParamUtil.get(request, "op");
  25. if (op.equals("add")) {
  26. String boardCode = ParamUtil.get(request, "boardCode");
  27. if (!boardCode.equals("")) {
  28. String entranceCode = ManagerEntrance.CODE;
  29. BoardEntranceDb be = new BoardEntranceDb();
  30. be.setBoardCode(boardCode);
  31. be.setEntranceCode(entranceCode);
  32. if (be.create()) {
  33. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  34. }
  35. else
  36. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  37. }
  38. }
  39. if (op.equals("del")) {
  40. String boardCode = ParamUtil.get(request, "boardCode");
  41. String entranceCode = ManagerEntrance.CODE;
  42. BoardEntranceDb be = new BoardEntranceDb();
  43. be = be.getBoardEntranceDb(boardCode, entranceCode);
  44. if (be.del()) {
  45. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  46. }
  47. else
  48. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  49. }
  50. %>
  51. <table width='100%' cellpadding='0' cellspacing='0' >
  52.   <tr>
  53.     <td class="head"><lt:Label res="res.label.forum.admin.entrance" key="plugin_manage"/></td>
  54.   </tr>
  55. </table>
  56. <br>
  57. <table width="98%" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  58.   <tr> 
  59.     <td height=20 align="left" class="thead"> <lt:Label res="res.label.forum.admin.entrance" key="plugin_entrance"/> 
  60.       - <%=SkinUtil.LoadString(request, "res.config.entrance", ManagerEntrance.CODE)%></td>
  61.   </tr>
  62.   <tr> 
  63.     <td valign="top"><br>
  64.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFBFF" class="tableframe_gray">
  65.       <tr align="center">
  66.         <td width="13%" height="22"><lt:Label res="res.label.forum.admin.entrance" key="board_code"/></td>
  67.       <td width="23%" height="22"><lt:Label res="res.label.forum.admin.entrance" key="board_name"/></td>
  68.         <td width="34%" height="22"><lt:Label key="op"/></td>
  69.       </tr>
  70. <%
  71. BoardEntranceDb br = new BoardEntranceDb();
  72. Vector v = br.list(ManagerEntrance.CODE);
  73. Iterator ir = v.iterator();
  74. Leaf leaf = new Leaf();
  75. while (ir.hasNext()) {
  76. BoardEntranceDb sb = (BoardEntranceDb)ir.next();
  77. leaf = leaf.getLeaf(sb.getBoardCode());
  78. %>
  79.       <tr align="center">
  80.         <td height="22"><%=leaf.getCode()%></td>
  81.       <td height="22"><%=leaf.getName()%></td>
  82.         <td height="22"><a href="?op=del&boardCode=<%=StrUtil.UrlEncode(leaf.getCode())%>&entranceCode=<%=StrUtil.UrlEncode(sb.getEntranceCode())%>"><lt:Label key="op_del"/></a></td>
  83.       </tr>
  84. <%}%>   
  85.     </table>
  86.       <br>
  87.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0">
  88.   <form name=form1 action="?op=add" method=post>
  89.           <tr>
  90.           <td width="47%" align="right">
  91.   <select name="boardCode" onChange="if(this.options[this.selectedIndex].value=='no'){alert('<lt:Label res="res.label.forum.admin.entrance" key="error_sel_field"/>'); this.selectedIndex=0;}">
  92.             <option value="" selected><lt:Label res="res.label.forum.admin.entrance" key="sel_board"/></option>
  93.             <%
  94. LeafChildrenCacheMgr dlcm = new LeafChildrenCacheMgr("root");
  95. java.util.Vector vt = dlcm.getChildren();
  96. ir = vt.iterator();
  97. while (ir.hasNext()) {
  98. leaf = (Leaf) ir.next();
  99. String parentCode = leaf.getCode();
  100. %>
  101.             <option style="BACKGROUND-COLOR: #f8f8f8" value="no">╋ <%=leaf.getName()%></option>
  102. <%
  103. LeafChildrenCacheMgr dl = new LeafChildrenCacheMgr(parentCode);
  104. v = dl.getChildren();
  105. Iterator ir1 = v.iterator();
  106. while (ir1.hasNext()) {
  107. Leaf lf = (Leaf) ir1.next();
  108. %>
  109.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=lf.getCode()%>"> ├『<%=lf.getName()%>』</option>
  110. <%if (lf.getChildCount()>0) {
  111. Vector vch = lf.getChildren();
  112. Iterator irch = vch.iterator();
  113. while (irch.hasNext()) {
  114. Leaf chlf = (Leaf)irch.next();
  115. %>
  116.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=chlf.getCode()%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ├『<%=chlf.getName()%>』</option>
  117. <%
  118. }
  119. }%>
  120.     <%}
  121. }%>
  122.           </select>
  123.           &nbsp;&nbsp;&nbsp;&nbsp;
  124.        </td>
  125.           <td width="4%" align="left">
  126.     </td>
  127.    <td width="49%" align="left"><input type=submit value="<lt:Label res="res.label.forum.admin.entrance" key="add_board"/>"></td>
  128.           </tr></form>
  129.       </table>
  130.       <br></td>
  131.   </tr>
  132. </table>
  133. </td> </tr>             
  134.       </table>                                        
  135.        </td>                                        
  136.      </tr>                                        
  137.  </table>                                        
  138.                                
  139. </body>                                        
  140. </html>                            
  141.