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

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. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  22. <HTML><HEAD><TITLE><lt:Label res="res.label.forum.manager" key="move_board"/></TITLE>
  23. <META http-equiv=Content-Type content="text/html; charset=utf-8">
  24. <%@ include file="../inc/nocache.jsp"%>
  25. <link href="../<%=skinPath%>/skin.css" rel="stylesheet" type="text/css">
  26. <STYLE>
  27. TABLE {
  28. BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 1px
  29. }
  30. TD {
  31. BORDER-RIGHT: 0px; BORDER-TOP: 0px
  32. }
  33. .style1 {color: #FFFFFF}
  34. body {
  35. margin-left: 0px;
  36. margin-right: 0px;
  37. }
  38. </STYLE>
  39. <META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
  40. <BODY topMargin=0>
  41. <%@ include file="../inc/header.jsp"%>
  42. <%@ include file="../inc/inc.jsp"%>
  43. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  44. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  45. <jsp:useBean id="topic" scope="page" class="com.redmoon.forum.MsgMgr" />
  46. <%
  47. String querystring = StrUtil.getNullString(request.getQueryString());
  48. String privurl=request.getRequestURL()+"?"+StrUtil.UrlEncode(querystring,"utf-8");
  49. String op = ParamUtil.get(request, "op");
  50. long id = ParamUtil.getLong(request, "id");
  51. String boardcode = ParamUtil.get(request, "boardcode");
  52. String oldboardcode = ParamUtil.get(request, "oldboardcode");
  53. //安全验证
  54. if (!privilege.isUserLogin(request)) {
  55. response.sendRedirect("../index.jsp");
  56. return;
  57. }
  58. if (op.equals("change")) {
  59. boolean re = false;
  60. try {
  61. re = topic.ChangeBoard(request,id,boardcode);
  62. if (re) {
  63. out.println(StrUtil.Alert(SkinUtil.LoadString(request,"info_operate_success")));
  64. }
  65. else {
  66. out.println(StrUtil.Alert(SkinUtil.LoadString(request,"info_operate_fail")));
  67. boardcode = oldboardcode;
  68. }
  69. }
  70. catch (ErrMsgException e) {
  71. out.print(StrUtil.p_center(e.getMessage(),"red"));
  72. boardcode = oldboardcode;
  73. }
  74. }
  75. %>   
  76.   <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  77.     <tr> 
  78.       <td height="153" align="center" valign="middle"> 
  79.         <div align="">
  80. <form name="form1" method="post" action="?op=change">
  81.         <br>
  82.         <lt:Label res="res.label.forum.manager" key="move_to"/>
  83.               <select name="boardcode" onChange="if(this.options[this.selectedIndex].value==''){alert('<lt:Label res="res.label.forum.manager" key="you_selected_board_not"/>'); this.selectedIndex=oldIndex}">
  84.                 <option value="" selected><lt:Label res="res.label.forum.manager" key="select_board"/></option>
  85.                 <%
  86. LeafChildrenCacheMgr dlcm = new LeafChildrenCacheMgr("root");
  87. java.util.Vector vt = dlcm.getChildren();
  88. Iterator ir = vt.iterator();
  89. int oldIndex = 0;
  90. while (ir.hasNext()) {
  91. Leaf leaf = (Leaf) ir.next();
  92. String parentCode = leaf.getCode();
  93. %>
  94.                 <option style="BACKGROUND-COLOR: #f8f8f8" value="">╋ <%=leaf.getName()%></option>
  95.                 <%
  96. LeafChildrenCacheMgr dl = new LeafChildrenCacheMgr(parentCode);
  97. java.util.Vector v = dl.getChildren();
  98. Iterator ir1 = v.iterator();
  99. int i = 0;
  100. String selected = "";
  101. while (ir1.hasNext()) {
  102. Leaf lf = (Leaf) ir1.next();
  103. if (boardcode.equals(lf.getCode())) {
  104. selected = "selected";
  105. oldIndex = i;
  106. }
  107. else
  108. selected = "";
  109. i++;
  110. %>
  111.         <option value="<%=lf.getCode()%>" <%=selected%>> ├『<%=lf.getName()%>』</option>
  112.                 <%}
  113. }%>
  114.               </select>
  115.   <script>
  116.   var oldIndex = <%=oldIndex%>;
  117.   </script>
  118.               <input type="submit" name="Submit2" value="<%=SkinUtil.LoadString(request,"ok")%>">
  119.   <input type=hidden name=id value="<%=id%>">
  120.   <input type=hidden name=oldboardcode value="<%=boardcode%>">
  121.           </form>
  122.       </div>                
  123. </td>
  124.     </tr>
  125. </table>
  126. <%@ include file="../inc/footer.jsp"%>
  127. </BODY></HTML>