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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="java.util.*"%>
  3. <%@ page import="cn.js.fan.db.Conn"%>
  4. <%@ page import="cn.js.fan.util.*"%>
  5. <%@ page import="com.redmoon.forum.plugin.*"%>
  6. <%@ page import="com.redmoon.forum.plugin.entrance.*"%>
  7. <%@ page import="com.redmoon.forum.*"%>
  8. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  9. <html><head>
  10. <meta http-equiv="pragma" content="no-cache">
  11. <link rel="stylesheet" href="../../common.css">
  12. <LINK href="default.css" type=text/css rel=stylesheet>
  13. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>插件管理</title>
  16. <script language="JavaScript">
  17. <!--
  18. //-->
  19. </script>
  20. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  21. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  22. <%
  23. if (!privilege.isUserPrivValid(request, "forum.plugin"))
  24. {
  25. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  26. return;
  27. }
  28. String op = ParamUtil.get(request, "op");
  29. if (op.equals("add")) {
  30. String boardCode = ParamUtil.get(request, "boardCode");
  31. if (!boardCode.equals("")) {
  32. String entranceCode = MasterEntrance.CODE;
  33. BoardEntranceDb be = new BoardEntranceDb();
  34. be.setBoardCode(boardCode);
  35. be.setEntranceCode(entranceCode);
  36. if (be.create()) {
  37. out.print(StrUtil.Alert("添加成功!"));
  38. }
  39. else
  40. out.print(StrUtil.Alert("添加失败,请检查版块是否已被加入!"));
  41. }
  42. }
  43. if (op.equals("del")) {
  44. String boardCode = ParamUtil.get(request, "boardCode");
  45. String entranceCode = MasterEntrance.CODE;
  46. BoardEntranceDb be = new BoardEntranceDb();
  47. be = be.getBoardEntranceDb(boardCode, entranceCode);
  48. if (be.del()) {
  49. out.print(StrUtil.Alert("删除成功!"));
  50. }
  51. else
  52. out.print(StrUtil.Alert("删除失败!"));
  53. }
  54. %>
  55. <table width='100%' cellpadding='0' cellspacing='0' >
  56.   <tr>
  57.     <td class="head">管理插件-管理员进入方式插件</td>
  58.   </tr>
  59. </table>
  60. <br>
  61. <table width="98%" height="227" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  62.   <tr> 
  63.     <td height=20 align="left" class="thead">管理 - 管理员进入方式插件 </td>
  64.   </tr>
  65.   <tr> 
  66.     <td valign="top"><br>
  67.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFBFF" class="tableframe_gray">
  68.       <tr align="center">
  69.         <td width="13%" height="22">版面编码</td>
  70.       <td width="23%" height="22">版面名称</td>
  71.         <td width="30%">进入方式插件</td>
  72.         <td width="34%" height="22">操作</td>
  73.       </tr>
  74. <%
  75. BoardEntranceDb br = new BoardEntranceDb();
  76. Vector v = br.list(MasterEntrance.CODE);
  77. Iterator ir = v.iterator();
  78. Leaf leaf = new Leaf();
  79. while (ir.hasNext()) {
  80. BoardEntranceDb sb = (BoardEntranceDb)ir.next();
  81. leaf = leaf.getLeaf(sb.getBoardCode());
  82. %>
  83.       <tr align="center">
  84.         <td height="22"><%=leaf.getCode()%></td>
  85.       <td height="22"><%=leaf.getName()%></td>
  86.         <td>管理员准入</td>
  87.         <td height="22"><a href="?op=del&boardCode=<%=StrUtil.UrlEncode(leaf.getCode())%>&entranceCode=<%=StrUtil.UrlEncode(sb.getEntranceCode())%>">删除</a></td>
  88.       </tr>
  89. <%}%>   
  90.     </table>
  91.       <br>
  92.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0">
  93.   <form name=form1 action="?op=add" method=post>
  94.           <tr>
  95.           <td width="47%" align="right">
  96.   <select name="boardCode" onChange="if(this.options[this.selectedIndex].value=='no'){alert('您选择的是区域,请选择版块!'); this.selectedIndex=0;}">
  97.             <option value="" selected>请选择版块</option>
  98.             <%
  99. LeafChildrenCacheMgr dlcm = new LeafChildrenCacheMgr("root");
  100. java.util.Vector vt = dlcm.getChildren();
  101. ir = vt.iterator();
  102. while (ir.hasNext()) {
  103. leaf = (Leaf) ir.next();
  104. String parentCode = leaf.getCode();
  105. %>
  106.             <option style="BACKGROUND-COLOR: #f8f8f8" value="no">╋ <%=leaf.getName()%></option>
  107. <%
  108. LeafChildrenCacheMgr dl = new LeafChildrenCacheMgr(parentCode);
  109. v = dl.getChildren();
  110. Iterator ir1 = v.iterator();
  111. while (ir1.hasNext()) {
  112. Leaf lf = (Leaf) ir1.next();
  113. %>
  114.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=lf.getCode()%>"> ├『<%=lf.getName()%>』</option>
  115. <%if (lf.getChildCount()>0) {
  116. Vector vch = lf.getChildren();
  117. Iterator irch = vch.iterator();
  118. while (irch.hasNext()) {
  119. Leaf chlf = (Leaf)irch.next();
  120. %>
  121.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=chlf.getCode()%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ├『<%=chlf.getName()%>』</option>
  122. <%
  123. }
  124. }%>
  125.     <%}
  126. }%>
  127.           </select>
  128.           &nbsp;&nbsp;&nbsp;&nbsp;
  129.        </td>
  130.           <td width="4%" align="left">
  131.     </td>
  132.    <td width="49%" align="left"><input type=submit value="添加使用本进入方式插件的版块"></td>
  133.           </tr></form>
  134.       </table></td>
  135.   </tr>
  136. </table>
  137. </td> </tr>             
  138.       </table>                                        
  139.        </td>                                        
  140.      </tr>                                        
  141.  </table>                                        
  142.                                
  143. </body>                                        
  144. </html>                            
  145.