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

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="cn.js.fan.web.*" %>
  7. <%@ page import="cn.js.fan.module.cms.*" %>
  8. <%@ page import="cn.js.fan.module.cms.plugin.*" %>
  9. <%@ page import="com.redmoon.oa.pvg.*" %>
  10. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  11. <html>
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <title></title>
  15. <LINK href="default.css" type=text/css rel=stylesheet>
  16. <script>
  17. function form1_onsubmit() {
  18. form1.type.value = form1.seltype.value;
  19. form1.root_code.value = window.parent.dirmainFrame.getRootCode();
  20. }
  21. function selTemplate(id)
  22. {
  23. if (form1.templateId.value!=id) {
  24. form1.templateId.value = id;
  25. }
  26. }
  27. function enableSelType() {
  28. if (confirm("如果该项中已经含有内容,则更改以后会造成问题,您要强制更改吗?")) {
  29. form1.seltype.disabled = false;
  30. }
  31. }
  32. </script>
  33. </head>
  34. <body>
  35. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  36. <%
  37. if (!privilege.isUserLogin(request))
  38. {
  39. out.print(SkinUtil.makeErrMsg(request, SkinUtil.LoadString(request, "pvg_invalid")));
  40. return;
  41. }
  42. %>
  43. <%
  44. String parent_code = ParamUtil.get(request, "parent_code");
  45. if (parent_code.equals(""))
  46. parent_code = "root";
  47. String parent_name = ParamUtil.get(request, "parent_name");
  48. String code = ParamUtil.get(request, "code");
  49. String name = ParamUtil.get(request, "name");
  50. String description = ParamUtil.get(request, "description");
  51. String op = ParamUtil.get(request, "op");
  52. boolean isHome = false;
  53. int type = 0;
  54. if (op.equals(""))
  55. op = "AddChild";
  56. if (op.equals("AddChild")) {
  57. LeafPriv lp = new LeafPriv();
  58. lp.setDirCode(parent_code);
  59. if (!lp.canUserAppend(privilege.getUser(request))) {
  60. // out.println(StrUtil.makeErrMsg(privilege.MSG_INVALID, "red", "green"));
  61. // return;
  62. }
  63. }
  64. Leaf leaf = null;
  65. if (op.equals("modify")) {
  66. LeafPriv lp = new LeafPriv(code);
  67. if (!lp.canUserModify(privilege.getUser(request))) {
  68. // out.print(StrUtil.makeErrMsg(privilege.MSG_INVALID));
  69. // return;
  70. }
  71. Directory dir = new Directory();
  72. leaf = dir.getLeaf(code);
  73. name = leaf.getName();
  74. description = leaf.getDescription();
  75. type = leaf.getType();
  76. isHome = leaf.getIsHome();
  77. }
  78. %>
  79. <TABLE 
  80. style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" 
  81. cellSpacing=0 cellPadding=3 width="95%" align=center>
  82.   <!-- Table Head Start-->
  83.   <TBODY>
  84.     <TR>
  85.       <TD class=thead style="PADDING-LEFT: 10px" noWrap width="70%">目录增加或修改</TD>
  86.     </TR>
  87.     <TR class=row style="BACKGROUND-COLOR: #fafafa">
  88.       <TD align="center" style="PADDING-LEFT: 10px"><table class="frame_gray" width="469" border="0" cellpadding="0" cellspacing="1">
  89.         <tr>
  90.           <td align="center"><table width="100%">
  91.             <form name="form1" method="post" action="dir_top.jsp?op=<%=op%>" target="dirmainFrame" onClick="return form1_onsubmit()">
  92.               <tr>
  93.                 <td width="78" rowspan="7" align="left" valign="top"><br>
  94.                   当前结点:<br>
  95.                     <font color=blue><%=parent_name.equals("")?"根结点":parent_name%></font>
  96. </td>
  97.                 <td width="312" align="left"> 编码
  98.                     <input name="code" value="<%=code%>" <%=op.equals("modify")?"readonly":""%>>
  99. &nbsp;
  100. <select name="target">
  101. <option value="">默认</option>
  102. <option value="mainFileFrame">文件柜右侧</option>
  103. <option value="_parent">父窗口</option>
  104. <option value="_top">顶层窗口</option>
  105. <option value="_blank">新窗口</option>
  106. <option value="_self">本窗口</option>
  107. </select>
  108. <%if (op.equals("modify")) {%>
  109. <script>
  110. form1.target.value = "<%=leaf.getTarget()%>";
  111. </script>
  112. <%}%>
  113.                </td>
  114.               </tr>
  115.               <tr>
  116.                 <td align="left">名称
  117.                     <input name="name" value="<%=name%>"></td>
  118.               </tr>
  119.               <tr>
  120.                 <td align="left">描述
  121.                     <input name="description" value="<%=description%>">
  122.                     <input type=hidden name=parent_code value="<%=parent_code%>"> 
  123.                     (链接型节点在描述中填链接地址)                    </td>
  124.               </tr>
  125.               <tr>
  126.                 <td align="left">
  127. <%
  128. String disabled = "";
  129. if (op.equals("modify") && leaf.getType()>=1)
  130. disabled = "true";
  131. %>
  132. 类型:
  133.                   <select name="seltype">
  134.                     <option value="0">分类</option>
  135.                     <option value="1">文章</option>
  136.                     <option value="2" <%=op.equals("AddChild")?"selected":""%>>列表</option>
  137. <option value="3">链接</option>
  138.                   </select>
  139.   <script>
  140.   <%if (op.equals("modify")) {%>
  141.   form1.seltype.value = "<%=type%>"
  142.   <%}%>
  143.   form1.seltype.disabled = "<%=disabled%>"
  144.   </script>
  145.   <input type=hidden name=root_code value="">
  146.   <input type=hidden name="type" value="<%=type%>">
  147.                   <span class="unnamed2">模板ID&nbsp;
  148.                   <input name="templateId" class="singleboarder" value="<%=op.equals("modify")?""+leaf.getTemplateId():"-1"%>" size=3 readonly>
  149. &nbsp;<a href="javascript:showModalDialog('doc_template_select_frame.jsp',window.self,'dialogWidth:640px;dialogHeight:480px;status:no;help:no;')">选模板</a> <span id=templateInfo>
  150. <%if (op.equals("modify") && leaf.getTemplateId()!=-1) {%>
  151. <a target=_blank href="doc_template_show.jsp?id=<%=leaf.getTemplateId()%>">预览模板</a> 
  152. <%}%><a target=_self href="#" onClick="form1.templateId.value='-1'">取消模板</a>
  153. </span></span> </td>
  154.               </tr>
  155.               <tr>
  156.                 <td align="left"><span class="unnamed2">
  157.                   <%if (op.equals("modify")) {%>
  158.                   <script>
  159.   var bcode = "<%=leaf.getCode()%>";
  160.       </script>
  161. &nbsp;父结点:
  162. <select name="parentCode">
  163. <%
  164. Leaf rootlf = leaf.getLeaf("root");
  165. DirectoryView dv = new DirectoryView(rootlf);
  166. dv.ShowDirectoryAsOptionsWithCode(out, rootlf, rootlf.getLayer());
  167. %>
  168. </select>
  169. <script>
  170. form1.parentCode.value = "<%=leaf.getParentCode()%>";
  171. </script>
  172. &nbsp;( <span class="style3">蓝色</span>表示“无内容”或“列表”项 )
  173. <%}%>
  174.                 </span></td>
  175.               </tr>
  176.               <tr>
  177.                 <td align="left">
  178. <%if (op.equals("modify")) {%>
  179. <input type="checkbox" name="isHome" value="true" <%=isHome?"checked":""%> >
  180. <%}else{%>
  181. <input type="checkbox" name="isHome" value="true" checked>
  182. <%}%>
  183. 前台
  184. <%if (op.equals("modify")) {%>
  185. <a href="dir_priv_m.jsp?dirCode=<%=StrUtil.UrlEncode(leaf.getCode())%>" target="_parent">权限</a>
  186. <%}%>  
  187. 应用插件
  188. <select name=pluginCode>
  189. <option value="<%=PluginUnit.DEFAULT%>">默认</option>
  190. <%
  191. PluginMgr pm = new PluginMgr();
  192. Vector v = pm.getAllPlugin();
  193. Iterator ir = v.iterator();
  194. while (ir.hasNext()) {
  195. PluginUnit pu = (PluginUnit)ir.next();
  196. %>
  197. <option value="<%=pu.getCode()%>"><%=pu.getName(request)%></option>
  198. <%}%>
  199. <%if (op.equals("modify")) {%>
  200. <script>
  201. form1.pluginCode.value = "<%=leaf.getPluginCode()%>";
  202. </script>
  203. <%}%>
  204. </select>
  205. <%
  206. String sysChecked = "";
  207. if (op.equals("modify")) {
  208. if (leaf.isSystem())
  209. sysChecked = "checked";
  210. }
  211. %>
  212. <input name="isSystem" value="1" type="checkbox" <%=sysChecked%>>系统目录
  213. </td>
  214.               </tr>
  215.               <tr>
  216.                 <td align="center"><input name="Submit" type="submit" class="singleboarder" value="提交">
  217.                   &nbsp;&nbsp;&nbsp;
  218.                   <input name="Submit" type="reset" class="singleboarder" value="重置">
  219.                   &nbsp;&nbsp;&nbsp;
  220.                   <input type="button" class="singleboarder" value="强制类型修改" onClick="enableSelType()"></td>
  221.               </tr>
  222.             </form>
  223.           </table></td>
  224.         </tr>
  225.       </table>
  226.       </TD>
  227.     </TR>
  228.     <!-- Table Body End -->
  229.     <!-- Table Foot -->
  230.     <TR>
  231.       <TD class=tfoot align=right><DIV align=right> </DIV></TD>
  232.     </TR>
  233.     <!-- Table Foot -->
  234.   </TBODY>
  235. </TABLE>
  236. </body>
  237. </html>