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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ include file="../../../inc/inc.jsp" %>
  3. <%@ page import="java.util.*"%>
  4. <%@ page import="cn.js.fan.db.Conn"%>
  5. <%@ page import="cn.js.fan.web.*"%>
  6. <%@ page import="cn.js.fan.util.*"%>
  7. <%@ page import="com.redmoon.forum.plugin.flower.*"%>
  8. <%@ page import="com.redmoon.forum.plugin.*"%>
  9. <%@ page import="com.redmoon.forum.Leaf"%>
  10. <%@ page import="com.redmoon.forum.LeafChildrenCacheMgr"%>
  11. <%@ page import="org.jdom.*"%>
  12. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  13. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  14. <html><head>
  15. <meta http-equiv="pragma" content="no-cache">
  16. <link rel="stylesheet" href="../../../common.css">
  17. <LINK href="../../../admin/default.css" type=text/css rel=stylesheet>
  18. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>插件管理</title>
  21. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  22. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  23. <%
  24. if (!privilege.isMasterLogin(request)) {
  25. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  26. return;
  27. }
  28. String code = "flower";
  29. PluginMgr pm = new PluginMgr();
  30. PluginUnit pu = pm.getPluginUnit(code);
  31. String op = ParamUtil.get(request, "op");
  32. if (op.equals("addBoard")) {
  33. BoardDb sb = new BoardDb();
  34. String boardCode = ParamUtil.get(request, "boardCode");
  35. FlowerSkin sv = new FlowerSkin();
  36. if (!boardCode.equals("")) {
  37. if (sb.create(code, boardCode, ""))
  38. out.print(StrUtil.Alert(sv.LoadString(request, "addBoardSucceed")));
  39. else
  40. out.print(StrUtil.Alert(sv.LoadString(request, "addBoardFail")));
  41. }
  42. }
  43. if (op.equals("del")) {
  44. BoardDb sb = new BoardDb();
  45. String boardCode = ParamUtil.get(request, "boardCode");
  46. sb = sb.getBoardDb(code, boardCode);
  47. FlowerSkin sv = new FlowerSkin();
  48. if (!boardCode.equals("")) {
  49. if (sb.del())
  50. out.print(StrUtil.Alert(sv.LoadString(request, "delBoardSucceed")));
  51. else
  52. out.print(StrUtil.Alert(sv.LoadString(request, "delBoardFail")));
  53. }
  54. }
  55. %>
  56. <table width='100%' cellpadding='0' cellspacing='0' >
  57.   <tr>
  58.     <td class="head">管理插件-<%=FlowerSkin.LoadString(request, "name")%></td>
  59.   </tr>
  60. </table>
  61. <br>
  62. <table width="98%" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  63.   <tr> 
  64.     <td height=20 align="left" class="thead">管理 - <%=FlowerSkin.LoadString(request, "name")%></td>
  65.   </tr>
  66.   <tr>
  67.     <td valign="top"><br>
  68.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999" class="tableframe_gray">
  69.       <tr align="center">
  70.         <td width="19%" height="24" bgcolor="#EFEBDE">版面编码</td>
  71.       <td width="35%" height="22" bgcolor="#EFEBDE">版面名称</td>
  72.         <td width="46%" height="22" bgcolor="#EFEBDE">操作</td>
  73.       </tr>
  74. <%
  75. BoardDb sb1 = new BoardDb();
  76. Vector v = sb1.list("select pluginCode, boardCode from " + sb1.getTableName() + " where pluginCode=" + StrUtil.sqlstr(code));
  77. Iterator ir = v.iterator();
  78. Leaf leaf = null;
  79. com.redmoon.forum.Directory dir = new com.redmoon.forum.Directory();
  80. while (ir.hasNext()) {
  81. BoardDb sb = (BoardDb)ir.next();
  82. leaf = dir.getLeaf(sb.getBoardCode());
  83. %>
  84.       <tr align="center">
  85.         <td height="22" bgcolor="#FFFBFF"><%=leaf==null?"该版块已不存在":leaf.getCode()%></td>
  86.       <td height="22" bgcolor="#FFFBFF"><%=leaf==null?"":leaf.getName()%></td>
  87.         <td height="22" bgcolor="#FFFBFF"><a href="boardProp.jsp?code=<%=StrUtil.UrlEncode(code)%>&boardCode=<%=StrUtil.UrlEncode(leaf==null?"":leaf.getCode())%>">管理</a>&nbsp;&nbsp;&nbsp;<a href="manager.jsp?op=del&boardCode=<%=StrUtil.UrlEncode(sb.getBoardCode())%>">删除</a></td>
  88.       </tr>
  89. <%}%>
  90.     </table>
  91.       <br>
  92.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0">
  93.   <form action="?op=addBoard" method=post>
  94.         <tr>
  95.           <td width="56%" align="right">
  96.   <select name="boardCode" onChange="if(this.options[this.selectedIndex].value=='not'){alert('您选择的是区域,请选择版块!'); this.selectedIndex=0;}">
  97.             <option value="" selected>请选择版块</option>
  98. <%
  99. leaf = dir.getLeaf(Leaf.CODE_ROOT);
  100. com.redmoon.forum.DirectoryView dv = new com.redmoon.forum.DirectoryView(leaf);
  101. dv.ShowDirectoryAsOptions(out, leaf, leaf.getLayer());
  102. %>
  103.           </select>
  104.           &nbsp;&nbsp;&nbsp;&nbsp;</td>
  105.         <td width="44%" align="left"><input type=submit value="设为支持<%=FlowerSkin.LoadString(request, "name")%>功能"></td>
  106.         </tr></form>
  107.       </table>      <br>
  108.       <table width="86%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableframe" style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" >
  109.         <tr>
  110.           <td width="100%" height="23" class="thead">&nbsp;配置鲜花鸡蛋</td>
  111.         </tr>
  112.         <tr>
  113.           <td valign="top" bgcolor="#FFFFFF"><%
  114. FlowerConfig myconfig = new FlowerConfig();
  115. Element root = myconfig.getRootElement();
  116. String name="",value = "";
  117. name = request.getParameter("name");
  118. if (name!=null && !name.equals("")) {
  119. value = ParamUtil.get(request, "value");
  120. myconfig.put(name,value);
  121. out.println(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "manager.jsp"));
  122. }
  123. int k = 0;
  124. ir = root.getChildren().iterator();
  125. String desc = "";
  126. while (ir.hasNext()) {
  127.   Element e = (Element)ir.next();
  128.   desc = e.getAttributeValue("desc");
  129.   name = e.getName();
  130.   value = e.getValue();
  131. %>
  132.               <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
  133.                 <FORM METHOD=POST id="form<%=k%>" name="form<%=k%>" ACTION='?'>
  134.                   <tr>
  135.                     <td bgcolor=#F6F6F6 width='52%'><INPUT TYPE=hidden name=name value="<%=name%>">
  136.                       &nbsp;<%=desc%>
  137.                     <td bgcolor=#F6F6F6 width='34%'>
  138. <%
  139. if (name.equals("moneyCode")) {
  140. %>
  141. <select name="value">
  142. <%   
  143. ScoreMgr sm = new ScoreMgr();
  144. Vector vs = sm.getAllScore();
  145. Iterator irs = vs.iterator();
  146. String str = "";
  147. while (irs.hasNext()) {
  148. ScoreUnit su = (ScoreUnit) irs.next();
  149. if (su.isExchange()) {
  150. %>
  151. <option value="<%=su.getCode()%>"><%=su.getName(request)%></option>
  152. <%   
  153.   }
  154.   }
  155. %>    
  156. </select>
  157. <script>
  158. form<%=k%>.value.value = "<%=value%>";
  159. </script>
  160. <%}
  161. else if (value.equals("true") || value.equals("false")) {%>
  162.                         <select name="value">
  163.                           <option value="true">
  164.                             <lt:Label key="yes"/>
  165.                           </option>
  166.                           <option value="false">
  167.                             <lt:Label key="no"/>
  168.                           </option>
  169.                         </select>
  170.                         <script>
  171. form<%=k%>.value.value = "<%=value%>";
  172. </script>
  173.                         <%}else{%>
  174.                         <input type=text value="<%=value%>" name="value" style='border:1pt solid #636563;font-size:9pt' size=30>
  175.                         <%}%>
  176.                     <td width="14%" align=center bgcolor=#F6F6F6><INPUT TYPE=submit name='edit' value='<lt:Label key="op_modify"/>'>
  177.                     </td>
  178.                   </tr>
  179.                 </FORM>
  180.               </table>
  181.             <%
  182.   k++;
  183. }
  184. %></td>
  185.         </tr>
  186.         <tr class=row style="BACKGROUND-COLOR: #fafafa">
  187.           <td valign="top" bgcolor="#FFFFFF" class="thead">&nbsp;</td>
  188.         </tr>
  189.       </table>
  190.     <br></td>
  191.   </tr>
  192. </table>
  193. </td> </tr>             
  194.       </table>                                        
  195.        </td>                                        
  196.      </tr>                                        
  197.  </table>                                        
  198.                                
  199. </body>                                        
  200. </html>                            
  201.