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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="java.io.InputStream" %>
  3. <%@ page import="java.util.*" %>
  4. <%@ page import="cn.js.fan.db.*" %>
  5. <%@ page import="cn.js.fan.util.*" %>
  6. <%@ page import="com.redmoon.forum.plugin.auction.*" %>
  7. <%@ page import="cn.js.fan.module.pvg.*" %>
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title></title>
  13. <LINK href="../manager/default.css" type=text/css rel=stylesheet>
  14. <script>
  15. function form1_onsubmit() {
  16. form1.type.value = form1.seltype.value;
  17. form1.root_code.value = window.parent.dirmainFrame.getRootCode();
  18. }
  19. function selTemplate(id)
  20. {
  21. if (form1.templateId.value!=id) {
  22. form1.templateId.value = id;
  23. }
  24. }
  25. function enableSelType() {
  26. if (confirm("如果该项中已经含有内容,则更改以后会造成问题,您要强制更改吗?")) {
  27. form1.seltype.disabled = false;
  28. }
  29. }
  30. </script>
  31. </head>
  32. <body>
  33. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  34. <%
  35. if (!privilege.isUserLogin(request))
  36. {
  37. out.println(StrUtil.makeErrMsg(privilege.MSG_INVALID, "red","green"));
  38. return;
  39. }
  40. %>
  41. <%
  42. String parent_code = ParamUtil.get(request, "parent_code");
  43. if (parent_code.equals(""))
  44. parent_code = "root";
  45. String parent_name = ParamUtil.get(request, "parent_name");
  46. String code = ParamUtil.get(request, "code");
  47. String name = ParamUtil.get(request, "name");
  48. String description = ParamUtil.get(request, "description");
  49. String op = ParamUtil.get(request, "op");
  50. boolean isHome = false;
  51. int type = 0;
  52. if (op.equals(""))
  53. op = "AddChild";
  54. if (op.equals("AddChild")) {
  55. LeafPriv lp = new LeafPriv();
  56. lp.setDirCode(parent_code);
  57. if (!lp.canUserAppend(privilege.getUser(request))) {
  58. out.println(StrUtil.makeErrMsg(privilege.MSG_INVALID, "red", "green"));
  59. return;
  60. }
  61. }
  62. Leaf leaf = null;
  63. if (op.equals("modify")) {
  64. LeafPriv lp = new LeafPriv(code);
  65. if (!lp.canUserModify(privilege.getUser(request))) {
  66. out.print(StrUtil.makeErrMsg(privilege.MSG_INVALID));
  67. return;
  68. }
  69. Directory dir = new Directory();
  70. leaf = dir.getLeaf(code);
  71. name = leaf.getName();
  72. description = leaf.getDescription();
  73. type = leaf.getType();
  74. isHome = leaf.getIsHome();
  75. }
  76. %>
  77. <TABLE 
  78. style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" 
  79. cellSpacing=0 cellPadding=3 width="95%" align=center>
  80.   <!-- Table Head Start-->
  81.   <TBODY>
  82.     <TR>
  83.       <TD class=thead style="PADDING-LEFT: 10px" noWrap width="70%">目录增加或修改</TD>
  84.     </TR>
  85.     <TR class=row style="BACKGROUND-COLOR: #fafafa">
  86.       <TD align="center" style="PADDING-LEFT: 10px"><table class="frame_gray" width="415" border="0" cellpadding="0" cellspacing="1">
  87.         <tr>
  88.           <td width="411" align="center"><table width="98%">
  89.             <form name="form1" method="post" action="catalog_top.jsp?op=<%=op%>" target="dirmainFrame" onClick="return form1_onsubmit()">
  90.               <tr>
  91.                 <td width="78" rowspan="7" align="left" valign="top"><br>
  92.                   当前结点:<br>
  93.                     <font color=blue><%=parent_name.equals("")?"根结点":parent_name%></font>
  94. </td>
  95.                 <td width="312" align="left"> 编码
  96.                     <input name="code" value="<%=code%>" <%=op.equals("modify")?"readonly":""%>>
  97.                 </td>
  98.               </tr>
  99.               <tr>
  100.                 <td align="left">名称
  101.                     <input name="name" value="<%=name%>"></td>
  102.               </tr>
  103.               <tr>
  104.                 <td align="left">描述
  105.                     <input name="description" value="<%=description%>">
  106.                     <input type=hidden name=parent_code value="<%=parent_code%>">                    </td>
  107.               </tr>
  108.               <tr>
  109.                 <td align="left">
  110. <%
  111. String disabled = "";
  112. if (op.equals("modify") && leaf.getType()>=1)
  113. disabled = "true";
  114. %>
  115. 类型:
  116.                   <select name="seltype">
  117.                     <option value="0">分类</option>
  118.                     <option value="1" <%=op.equals("AddChild")?"selected":""%>>商品列表</option>
  119.                   </select>
  120.   <script>
  121.   <%if (op.equals("modify")) {%>
  122.   form1.seltype.value = "<%=type%>"
  123.   <%}%>
  124.   form1.seltype.disabled = "<%=disabled%>"
  125.   </script>
  126.   <input type=hidden name=root_code value="">
  127.   <input type=hidden name="type" value="<%=type%>">
  128.                   <span class="unnamed2">模板ID&nbsp;
  129.                   <input name="templateId" class="singleboarder" value="<%=op.equals("modify")?""+leaf.getTemplateId():"-1"%>" size=3 readonly>
  130. &nbsp;<a href="javascript:showModalDialog('doc_template_select_frame.jsp',window.self,'dialogWidth:640px;dialogHeight:480px;status:no;help:no;')">选模板</a> <span id=templateInfo>
  131. <%if (op.equals("modify") && leaf.getTemplateId()!=-1) {%>
  132. <a target=_blank href="doc_template_show.jsp?id=<%=leaf.getTemplateId()%>">预览模板</a> 
  133. <%}%><a target=_self href="#" onClick="form1.templateId.value='-1'">取消模板</a>
  134. </span></span> </td>
  135.               </tr>
  136.               <tr>
  137.                 <td align="left"><span class="unnamed2">
  138.                   <%if (op.equals("modify")) {%>
  139.                   <script>
  140.   var bcode = "<%=leaf.getCode()%>";
  141.       </script>
  142. &nbsp;父结点:
  143. <select name="parentCode">
  144. <%
  145. Leaf rootlf = leaf.getLeaf("root");
  146. DirectoryView dv = new DirectoryView(rootlf);
  147. dv.ShowDirectoryAsOptionsWithCode(out, rootlf, rootlf.getLayer());
  148. %>
  149. </select>
  150. <script>
  151. form1.parentCode.value = "<%=leaf.getParentCode()%>";
  152. </script>
  153. &nbsp;( <span class="style3">蓝色</span>表示“无内容”或“列表”项 )
  154. <%}%>
  155.                 </span></td>
  156.               </tr>
  157.               <tr>
  158.                 <td align="left">
  159. <%if (op.equals("modify")) {%>
  160. <input type="checkbox" name="isHome" value="<%=isHome?"false":"true"%>" >
  161. <%}else{%>
  162. <input type="checkbox" name="isHome" value="true" >
  163. <%}%>
  164. 是否置于首页 <%if (op.equals("modify")) {%>
  165. <a href="dir_priv_m.jsp?dirCode=<%=StrUtil.UrlEncode(leaf.getCode())%>" target="_parent">权限</a>
  166. <%}%>  </td>
  167.               </tr>
  168.               <tr>
  169.                 <td align="center"><input name="Submit" type="submit" class="singleboarder" value="提交">
  170.                   &nbsp;&nbsp;&nbsp;
  171.                   <input name="Submit" type="reset" class="singleboarder" value="重置">
  172.                   &nbsp;&nbsp;&nbsp;
  173.                   <input type="button" class="singleboarder" value="强制类型修改" onClick="enableSelType()"></td>
  174.               </tr>
  175.             </form>
  176.           </table></td>
  177.         </tr>
  178.       </table>
  179.       </TD>
  180.     </TR>
  181.     <!-- Table Body End -->
  182.     <!-- Table Foot -->
  183.     <TR>
  184.       <TD class=tfoot align=right><DIV align=right> </DIV></TD>
  185.     </TR>
  186.     <!-- Table Foot -->
  187.   </TBODY>
  188. </TABLE>
  189. </body>
  190. </html>