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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="java.util.*"%>
  3. <%@ page import="cn.js.fan.web.*"%>
  4. <%@ page import="cn.js.fan.util.*"%>
  5. <%@ page import="com.redmoon.forum.plugin.sweet.*"%>
  6. <%@ page import="com.redmoon.forum.plugin.*"%>
  7. <%@ page import="com.redmoon.forum.*"%>
  8. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  9. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  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.render" key="render"/></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. {
  22. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  23. return;
  24. }
  25. String boardCode = ParamUtil.get(request, "boardCode").trim();
  26. String renderCode = "";
  27. if (!boardCode.equals("")) {
  28. BoardRenderDb br = new BoardRenderDb();
  29. br = br.getBoardRenderDb(boardCode);
  30. if (br.isLoaded())
  31. renderCode = br.getRenderCode();
  32. }
  33. String op = ParamUtil.get(request, "op");
  34. if (op.equals("setBoard")) {
  35. BoardRenderDb br = new BoardRenderDb();
  36. renderCode = ParamUtil.get(request, "renderCode");
  37. if (renderCode.equals("") || boardCode.equals("")) {
  38. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "res.label.forum.admin.render", "board_render_empty")));
  39. }
  40. else {
  41. if (br.setBoardRender(boardCode, renderCode)) {
  42. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  43. }
  44. else
  45. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  46. }
  47. }
  48. if (op.equals("del")) {
  49. BoardRenderDb br = new BoardRenderDb();
  50. br = br.getBoardRenderDb(boardCode);
  51. // renderCode = ParamUtil.get(request, "renderCode");
  52. if (br.del()) {
  53. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  54. }
  55. else
  56. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  57. }
  58. %>
  59. <table width='100%' cellpadding='0' cellspacing='0' >
  60.   <tr>
  61.     <td class="head"><lt:Label res="res.label.forum.admin.entrance" key="plugin_manage"/></td>
  62.   </tr>
  63. </table>
  64. <br>
  65. <table width="98%" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  66.   <tr> 
  67.     <td height=20 align="left" class="thead"><lt:Label res="res.label.forum.admin.render" key="render"/></td>
  68.   </tr>
  69.   <tr> 
  70.     <td height="142" valign="top"><br>
  71.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999" class="tableframe_gray">
  72.       <tr align="center">
  73.         <td width="13%" height="24" bgcolor="#EFEBDE"><strong>
  74.           <lt:Label res="res.label.forum.admin.entrance" key="code"/>
  75.         </strong></td>
  76.       <td width="23%" height="22" bgcolor="#EFEBDE"><strong>
  77.         <lt:Label res="res.label.forum.admin.entrance" key="name"/>
  78.       </strong></td>
  79.         <td width="30%" bgcolor="#EFEBDE"><strong>
  80.           <lt:Label res="res.label.forum.admin.render" key="render"/>
  81.         </strong></td>
  82.         <td width="34%" height="22" bgcolor="#EFEBDE"><strong>
  83.           <lt:Label key="op"/>
  84.         </strong></td>
  85.       </tr>
  86. <%
  87. BoardRenderDb br = new BoardRenderDb();
  88. Vector v = br.list();
  89. Iterator ir = v.iterator();
  90. Leaf leaf = new Leaf();
  91. RenderMgr rm = new RenderMgr();
  92. Vector vrender = rm.getAllRender();
  93. while (ir.hasNext()) {
  94. BoardRenderDb sb = (BoardRenderDb)ir.next();
  95. leaf = leaf.getLeaf(sb.getBoardCode());
  96. RenderUnit ru = rm.getRenderUnit(sb.getRenderCode());
  97. %>
  98.       <tr align="center">
  99.         <td height="22" bgcolor="#FFFBFF"><%=leaf.getCode()%></td>
  100.       <td height="22" bgcolor="#FFFBFF"><%=leaf.getName()%></td>
  101.         <td bgcolor="#FFFBFF"><%=ru.getName(request)%></td>
  102.         <td height="22" bgcolor="#FFFBFF"><a href="render.jsp?op=del&boardCode=<%=StrUtil.UrlEncode(leaf.getCode())%>&renderCode=<%=StrUtil.UrlEncode(sb.getRenderCode())%>"><lt:Label key="op_del"/></a></td>
  103.       </tr>
  104. <%}%>   
  105.     </table>
  106.       <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
  107.         <tr>
  108.           <td height="22" align="center"><lt:Label res="res.label.forum.admin.render" key="default_render"/></td>
  109.         </tr>
  110.       </table>
  111.       <br>
  112.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0">
  113.   <form name=formsetrender action="?op=setBoard" method=post>
  114.           <tr>
  115.           <td width="41%" align="right">
  116.   <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;} else window.location.href='render.jsp?boardCode='+this.options[this.selectedIndex].value">
  117.             <option value="" selected><lt:Label res="res.label.forum.admin.render" key="sel_board"/></option>
  118.             <%
  119. LeafChildrenCacheMgr dlcm = new LeafChildrenCacheMgr("root");
  120. java.util.Vector vt = dlcm.getChildren();
  121. ir = vt.iterator();
  122. while (ir.hasNext()) {
  123. leaf = (Leaf) ir.next();
  124. String parentCode = leaf.getCode();
  125. %>
  126.             <option style="BACKGROUND-COLOR: #f8f8f8" value="no">╋ <%=leaf.getName()%></option>
  127. <%
  128. LeafChildrenCacheMgr dl = new LeafChildrenCacheMgr(parentCode);
  129. v = dl.getChildren();
  130. Iterator ir1 = v.iterator();
  131. while (ir1.hasNext()) {
  132. Leaf lf = (Leaf) ir1.next();
  133. %>
  134.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=lf.getCode()%>"> ├『<%=lf.getName()%>』</option>
  135.             <%}
  136. }%>
  137.           </select>
  138.   <script>
  139.   formsetrender.boardCode.value = "<%=boardCode%>";
  140.   </script>
  141.           &nbsp;&nbsp;&nbsp;&nbsp;
  142.        </td>
  143.           <td width="21%" align="left">
  144. <select name="renderCode">
  145.             <option value="" selected><lt:Label res="res.label.forum.admin.render" key="sel_render"/></option>
  146.   <%
  147.   ir = vrender.iterator();
  148.   while (ir.hasNext()) {
  149.    RenderUnit ru = (RenderUnit)ir.next();
  150.   %>
  151.     <option value="<%=ru.getCode()%>"><%=ru.getName(request)%></option>
  152.   <%}%>
  153.   </select>
  154.   <script>
  155.   formsetrender.renderCode.value = "<%=renderCode%>";
  156.   </script>
  157.   </td>
  158.    <td width="38%" align="left"><input type=submit value="<lt:Label key="ok"/>"></td>
  159.           </tr></form>
  160.     </table>
  161.     <br></td>
  162.   </tr>
  163. </table>
  164. </td> </tr>             
  165.       </table>                                        
  166.        </td>                                        
  167.      </tr>                                        
  168.  </table>                                        
  169.                                
  170. </body>                                        
  171. </html>                            
  172.