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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="org.jdom.*"%>
  3. <%@ page import="org.jdom.output.*"%>
  4. <%@ page import="org.jdom.input.*"%>
  5. <%@ page import="java.util.Iterator"%>
  6. <%@ page import="com.redmoon.forum.*"%>
  7. <%@ page import="cn.js.fan.util.*"%>
  8. <%@ page import="cn.js.fan.web.*"%>
  9. <%@ page import="com.redmoon.forum.person.*"%>
  10. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  11. <%
  12. String skincode = UserSet.getSkin(request);
  13. if (skincode.equals(""))
  14. skincode = UserSet.defaultSkin;
  15. SkinMgr skm = new SkinMgr();
  16. Skin skin = skm.getSkin(skincode);
  17. if (skin==null)
  18. skin = skm.getSkin(UserSet.defaultSkin);
  19. String skinPath = skin.getPath();
  20. %>
  21. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  22. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  23. <jsp:useBean id="topic" scope="page" class="com.redmoon.forum.MsgMgr" />
  24. <%
  25. // 安全验证
  26. if (!privilege.isUserLogin(request)) {
  27. out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request,"info_please_login"), "../index.jsp"));
  28. return;
  29. }
  30. String boardcode = ParamUtil.get(request, "boardcode");
  31. if (boardcode.equals("")) {
  32. out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request,"res.label.forum.manager","board_code_can_not_null"), "../index.jsp"));
  33. return;
  34. }
  35. Leaf leaf = new Leaf();
  36. leaf = leaf.getLeaf(boardcode);
  37. %>
  38. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  39. <HTML><HEAD><TITLE><%=Global.AppName%> - <lt:Label res="res.label.forum.manager" key="mgr_board"/> <%=leaf.getName()%></TITLE>
  40. <META http-equiv=Content-Type content="text/html; charset=utf-8">
  41. <%@ include file="../inc/nocache.jsp"%>
  42. <link href="../<%=skinPath%>/skin.css" rel="stylesheet" type="text/css">
  43. <STYLE>
  44. TABLE {
  45. BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 1px
  46. }
  47. TD {
  48. BORDER-RIGHT: 0px; BORDER-TOP: 0px
  49. }
  50. .style1 {color: #FFFFFF}
  51. body {
  52. margin-left: 0px;
  53. margin-right: 0px;
  54. }
  55. </STYLE>
  56. <script>
  57. function form1_onsubmit() {
  58. form1.boardRule.value = getHtml();
  59. if (form1.boardRule.value.length>3000) {
  60. alert(<%=SkinUtil.LoadString(request,"res.label.forum.manager","board_rule_msg")%>);
  61. return false;
  62. }
  63. }
  64. </script>
  65. <META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
  66. <BODY topMargin=0>
  67. <%@ include file="../inc/header.jsp"%>
  68. <%@ include file="../inc/inc.jsp"%>
  69. <%
  70. String op = ParamUtil.get(request, "op");
  71. if (op.equals("modify")) {
  72.         if (!privilege.isManager(request, boardcode)) {
  73. out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request,"res.label.forum.manager","error_user"), "../index.jsp"));
  74.         }
  75. String boardRule = ParamUtil.get(request, "boardRule");
  76. leaf.setBoardRule(boardRule);
  77. if (leaf.update())
  78. out.print(StrUtil.Alert(SkinUtil.LoadString(request,"info_op_success")));
  79. else
  80. out.print(StrUtil.Alert(SkinUtil.LoadString(request,"info_operate_fail")));
  81. }
  82. %>   
  83.   <table width="63%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFBFF" class="tableframe_gray">
  84.     <form name=form1 action="?op=modify" method="post" onSubmit="return form1_onsubmit()">
  85.       <tr align="center" bgcolor="#FFFFFF">
  86.         <td width="16%" height="22"><lt:Label res="res.label.forum.manager" key="board_name"/></td>
  87.         <td width="84%" height="26" align="left"><a href="../listtopic.jsp?boardcode=<%=StrUtil.UrlEncode(boardcode)%>"><%=leaf.getName()%></a>
  88. <input type=hidden name=boardcode value="<%=boardcode%>">
  89. </td>
  90.       </tr>
  91.       <tr align="center" bgcolor="#FFFFFF">
  92.         <td height="22" valign="top"><lt:Label res="res.label.forum.manager" key="mgr_board"/></td>
  93.         <td height="22" align="left"><%
  94. String rpath = request.getContextPath();
  95. %>
  96.             <textarea id="boardRule" name="boardRule" style="display:none"><%=leaf.getBoardRule().replaceAll(""","'")%></textarea>
  97.             <link rel="stylesheet" href="<%=rpath%>/editor/edit.css">
  98.             <script src="<%=rpath%>/editor/DhtmlEdit.js"></script>
  99.             <script src="<%=rpath%>/editor/editjs.jsp"></script>
  100.             <script src="<%=rpath%>/editor/editor_s.jsp"></script>
  101.             <script>
  102. setHtml(form1.boardRule);
  103. </script>
  104.         </td>
  105.       </tr>
  106.       <tr align="center" bgcolor="#FFFFFF">
  107.         <td height="22">&nbsp;</td>
  108.         <td height="22" align="left">( <lt:Label res="res.label.forum.manager" key="board_rule_msg_clear"/> )</td>
  109.       </tr>
  110.       <tr align="center" bgcolor="#FFFFFF">
  111.         <td height="30" colspan="2"><input type="submit" name="Submit" value="<%=SkinUtil.LoadString(request,"commit")%>">
  112. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  113.         <input type="reset" name="Submit" value="<%=SkinUtil.LoadString(request,"reset")%>"></td>
  114.       </tr>
  115.     </form>
  116.   </table>
  117.   <%@ include file="../inc/footer.jsp"%>
  118. </BODY></HTML>