复件 (2) dir_list.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:26k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8" %>
  2. <%@ page import="cn.js.fan.security.*"%>
  3. <%@ page import="cn.js.fan.util.*"%>
  4. <%@ page import="cn.js.fan.db.*"%>
  5. <%@ page import="java.util.*"%>
  6. <%@ page import="cn.js.fan.web.*"%>
  7. <%@ page import="com.redmoon.oa.pvg.*"%>
  8. <%@ page import="com.redmoon.oa.person.UserDb"%>
  9. <%@ page import="java.util.Calendar" %>
  10. <%@ page import="cn.js.fan.db.Paginator"%>
  11. <%@ page import="com.redmoon.oa.netdisk.*"%>
  12. <html><head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  14. <link href="common.css" rel="stylesheet" type="text/css">
  15. <%@ include file="../inc/nocache.jsp"%>
  16. <style>
  17. .skin0 {
  18. padding-top:2px;
  19. cursor:default;
  20. font:menutext;
  21. position:absolute;
  22. text-align:left;
  23. font-family: "宋体";
  24. font-size: 9pt;
  25. width:80px;              /*宽度,可以根据实际的菜单项目名称的长度进行适当地调整*/
  26. background-color:menu;    /*菜单的背景颜色方案,这里选择了系统默认的菜单颜色*/
  27. border:1 solid buttonface;
  28. visibility:hidden;        /*初始时,设置为不可见*/
  29. border:2 outset buttonhighlight;
  30. }
  31. /*定义菜单条的显示样式*/
  32. .menuitems {
  33. padding:2px 1px 2px 10px;
  34. }
  35. </style>
  36. <jsp:useBean id="strutil" scope="page" class="cn.js.fan.util.StrUtil"/>
  37. <jsp:useBean id="docmanager" scope="page" class="com.redmoon.oa.netdisk.DocumentMgr"/>
  38. <jsp:useBean id="dir" scope="page" class="com.redmoon.oa.netdisk.Directory"/>
  39. <%
  40. String dir_code = ParamUtil.get(request, "dir_code");
  41. String dir_name = "";
  42. int id = 0;
  43. Privilege privilege = new Privilege();
  44. String userName = privilege.getUser(request);
  45. String correct_result = "操作成功!";
  46. Document doc = new Document();
  47. Document template = null;
  48. System.out.print("dir_list.jsp dir_code=" + dir_code + " id=" + id);
  49. Leaf leaf = dir.getLeaf(dir_code);
  50. dir_name = leaf.getName();
  51. LeafPriv lp = new LeafPriv(dir_code);
  52. if (!lp.canUserSee(privilege.getUser(request))) {
  53. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "pvg_invalid")));
  54. return;
  55. }
  56. String strtemplateId = ParamUtil.get(request, "templateId");
  57. String op = ParamUtil.get(request, "op");
  58. String work = ParamUtil.get(request, "work"); // init modify
  59. if (op.equals("editarticle")) {
  60. op = "edit";
  61. try {
  62. doc = docmanager.getDocumentByCode(request, dir_code, privilege);
  63. dir_code = doc.getDirCode();
  64. } catch (ErrMsgException e) {
  65. out.print(strutil.makeErrMsg(e.getMessage(), "red", "green"));
  66. return;
  67. }
  68. }
  69. String action = ParamUtil.get(request, "action");
  70. if (action.equals("changeName")) {
  71. boolean re = false;
  72. try {
  73. re = docmanager.updateAttachmentName(request);
  74. }
  75. catch (ErrMsgException e) {
  76. out.print(StrUtil.Alert(e.getMessage()));
  77. }
  78. }
  79. if (doc!=null) {
  80. id = doc.getID();
  81. Leaf lfn = new Leaf();
  82. lfn = lfn.getLeaf(doc.getDirCode());
  83. dir_name = lfn.getName();
  84. }
  85. %>
  86. <title><%=doc!=null?doc.getTitle():""%></title>
  87. <script language=JavaScript src='formpost.js'></script>
  88. <script language="JavaScript">
  89. <!--
  90. <%
  91. if (doc!=null) {
  92. out.println("var id=" + doc.getID() + ";");
  93. }
  94. %>
  95. var id = "<%=id%>"; // 用于右键菜单
  96. var curAttachId = "";
  97. var curAttachName = "";
  98. var op = "<%=op%>";
  99. var work = "<%=work%>";
  100. function SubmitWithFileDdxc() {
  101. addform.webedit.isDdxc = 1;
  102. if (document.addform.title.value.length == 0) {
  103. alert("请输入文章标题.");
  104. document.addform.title.focus();
  105. return false;
  106. }
  107. loadDataToWebeditCtrl(addform, addform.webedit);
  108. addform.webedit.MTUpload();
  109. // 因为Upload()中启用了线程的,所以函数在执行后,会立即反回,使得下句中得不到ReturnMessage的值
  110. // 原因是此时服务器的返回信息还没收到
  111. // alert("ReturnMessage=" + addform.webedit.ReturnMessage);
  112. }
  113. function SubmitWithFileThread() {
  114. if (document.addform.title.value.length == 0) {
  115. alert("请输入文章标题.");
  116. document.addform.title.focus();
  117. return false;
  118. }
  119. loadDataToWebeditCtrl(addform, addform.webedit);
  120. addform.webedit.Upload();
  121. // 因为Upload()中启用了线程的,所以函数在执行后,会立即反回,使得下句中得不到ReturnMessage的值
  122. // 原因是此时服务器的返回信息还没收到
  123. // alert("ReturnMessage=" + addform.webedit.ReturnMessage);
  124. }
  125. function SubmitWithoutFile() {
  126. if (document.addform.title.value.length == 0) {
  127. alert("请输入文章标题.");
  128. document.addform.title.focus();
  129. return false;
  130. }
  131. addform.isuploadfile.value = "false";
  132. loadDataToWebeditCtrl(addform, addform.webedit);
  133. addform.webedit.UploadMode = 0;
  134. addform.webedit.UploadArticle();
  135. addform.isuploadfile.value = "true";
  136. if (addform.webedit.ReturnMessage == "<%=correct_result%>")
  137. doAfter(true);
  138. else
  139. doAfter(false);
  140. }
  141. function ClearAll() {
  142. document.addform.title.value=""
  143. oEdit1.putHTML(" ");
  144. }
  145. function doAfter(isSucceed) {
  146. if (isSucceed) {
  147. if (op=="edit")
  148. {
  149. if (work=="modify")
  150. location.href = "dir_list.jsp?op=editarticle&dir_code=<%=StrUtil.UrlEncode(dir_code)%>";
  151. else
  152. location.href = "dir_list.jsp?op=editarticle&dir_code=<%=StrUtil.UrlEncode(dir_code)%>";
  153. }
  154. else {
  155. location.href = "dir_list.jsp?op=editarticle&dir_code=<%=StrUtil.UrlEncode(dir_code)%>";
  156.     }
  157. }
  158. else {
  159. alert(addform.webedit.ReturnMessage);
  160. }
  161. }
  162. function showvote(isshow)
  163. {
  164. if (addform.isvote.checked)
  165. {
  166. addform.vote.style.display = "";
  167. }
  168. else
  169. {
  170. addform.vote.style.display = "none";
  171. }
  172. }
  173. function window_onload() {
  174. }
  175. function displayCtlTable(btnObj) {
  176. if (ctlTable.style.display=="none") {
  177. ctlTable.style.display = "";
  178. addform.webedit.height = "173px";
  179. btnObj.value = "隐 藏";
  180. }
  181. else {
  182. ctlTable.style.display = "none";
  183. addform.webedit.height = "0px";
  184. btnObj.value = "上 传";
  185. }
  186. }
  187. function findObj(theObj, theDoc)
  188. {
  189.   var p, i, foundObj;
  190.   
  191.   if(!theDoc) theDoc = document;
  192.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  193.   {
  194.     theDoc = parent.frames[theObj.substring(p+1)].document;
  195.     theObj = theObj.substring(0,p);
  196.   }
  197.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  198.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  199.     foundObj = theDoc.forms[i][theObj];
  200.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  201.     foundObj = findObj(theObj,theDoc.layers[i].document);
  202.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  203.   
  204.   return foundObj;
  205. }
  206. //-->
  207. </script>
  208. </head>
  209. <body bgcolor="#FFFFFF" text="#000000" onLoad="window_onload()" style="overflow:auto">
  210. <%
  211. String orderBy = ParamUtil.get(request, "orderBy");
  212. if (orderBy.equals(""))
  213. orderBy = "name";
  214. String sort = ParamUtil.get(request, "sort");
  215. if (sort.equals(""))
  216. sort = "asc";
  217. %>
  218. <TABLE width="100%" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  219.   <TR valign="top" bgcolor="#FFFFFF">
  220.     <TD width="" height="430" colspan="2" style="background-attachment: fixed; background-image: url(images/bg_bottom.jpg); background-repeat: no-repeat">
  221.           <TABLE cellSpacing=0 cellPadding=0 width="100%">
  222.             <TBODY>
  223.               <TR>
  224.                 <TD class=head>
  225. &nbsp;&nbsp;
  226. <%
  227. Leaf dlf = new Leaf();
  228. if (doc!=null) {
  229. dlf = dlf.getLeaf(doc.getDirCode());
  230. }
  231. if (doc!=null && dlf.getType()==2) {%>
  232. <a href="cms/document_list_m.jsp?dir_code=<%=StrUtil.UrlEncode(dir_code)%>&dir_name=<%=StrUtil.UrlEncode(dir_name)%>"><%=dlf.getName()%></a>
  233. <%}else{%>
  234. <%=dir_name%>
  235. <%}%>
  236. &nbsp;
  237. <%
  238. UserDb ud = new UserDb();
  239. ud = ud.getUserDb(userName);
  240. String strDiskAllow = NumberUtil.round((double)ud.getDiskSpaceAllowed()/1024000, 3);
  241. String strDiskHas = NumberUtil.round((double)(ud.getDiskSpaceAllowed()-ud.getDiskSpaceUsed())/1024000, 3);
  242. %>
  243. &nbsp;磁盘份额:<%=strDiskAllow%>M &nbsp;剩余空间:<%=strDiskHas%>M&nbsp;&nbsp; <a href="dir_priv_m.jsp?dirCode=<%=dir_code%>">共享管理</a></TD>
  244.               </TR>
  245.             </TBODY>
  246.           </TABLE>
  247.           <table border="0" cellspacing="0" width="100%" cellpadding="0" align="center">
  248. <form name="addform" action="fwebedit_do.jsp" method="post">
  249.             <tr align="center">
  250.               <td width="90%" align="left" valign="top" bgcolor="#F2F2F2" class="unnamed2">              </td>
  251.             </tr>
  252.             <tr>
  253.               <td height="25" align="center" bgcolor="#FFFFFF"><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="D6D3CE">
  254.                 <tr>
  255.                   <td width="40%" align="center"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#aaaaaa" borderColorDark="#ffffff" bgcolor="D6D3CE">
  256.                       <tr>
  257.                         <td style="cursor:hand" onClick="doSort('name')">&nbsp;名称&nbsp;&nbsp;
  258.   <%if (orderBy.equals("name")) {
  259. if (sort.equals("asc")) 
  260. out.print("<img src='images/arrow_up.gif' width=8px height=7px>");
  261. else
  262. out.print("<img src='images/arrow_down.gif' width=8px height=7px>");
  263. }%>
  264. </td>
  265.                       </tr>
  266.                   </table></td>
  267.                   <td width="13%" bgcolor="#EAE9E6"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#aaaaaa" borderColorDark="#ffffff" bgcolor="D6D3CE">
  268.                       <tr>
  269.                         <td style="cursor:hand" onClick="doSort('file_size')">&nbsp;大小&nbsp;&nbsp;<span style="cursor:hand">
  270.                           <%if (orderBy.equals("file_size")) {
  271. if (sort.equals("asc")) 
  272. out.print("<img src='images/arrow_up.gif' width=8px height=7px>");
  273. else
  274. out.print("<img src='images/arrow_down.gif' width=8px height=7px>");
  275. }%>
  276.                         </span></td>
  277.                       </tr>
  278.                     </table></td>
  279.                   <td width="20%" bgcolor="#EAE9E6"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#aaaaaa" borderColorDark="#ffffff" bgcolor="D6D3CE">
  280.                       <tr>
  281.                         <td style="cursor:hand" onClick="doSort('uploadDate')">&nbsp;上传时间                    &nbsp;<span style="cursor:hand">
  282.                           <%if (orderBy.equals("uploadDate")) {
  283. if (sort.equals("asc")) 
  284. out.print("<img src='images/arrow_up.gif' width=8px height=7px>");
  285. else
  286. out.print("<img src='images/arrow_down.gif' width=8px height=7px>");
  287. }%>
  288.                         </span></td>
  289.                       </tr>
  290.                   </table></td>
  291.                   <td width="27%" bgcolor="#EAE9E6"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#aaaaaa" borderColorDark="#ffffff" bgcolor="D6D3CE">
  292.                       <tr>
  293.                         <td>&nbsp;操作</td>
  294.                       </tr>
  295.                   </table></td>
  296.                 </tr>
  297.               </table>
  298.     <%if (!leaf.getParentCode().equals(Leaf.PARENT_CODE_NONE)) {%>
  299.                 <table width="100%"  border="0" cellpadding="0" cellspacing="0">
  300.                   <tr>
  301.                     <td width="3%" align="center"><img src="images/parent.gif" width="20" height="20" align="absmiddle"></td>
  302.                     <td width="37%"><a href="dir_list.jsp?op=editarticle&dir_code=<%=leaf.getParentCode()%>" onMouseUp="curAttachId=''">上级目录</a></td>
  303.                     <td width="13%">&nbsp;</td>
  304.                     <td width="22%">&nbsp;</td>
  305.                     <td width="25%">&nbsp;</td>
  306.                   </tr>
  307.                 </table>
  308.                 <%}%>
  309.                 <%
  310. Iterator irch = leaf.getChildren().iterator();
  311. while (irch.hasNext()) {
  312. Leaf plf = (Leaf)irch.next();
  313. %>
  314.                 <table width="100%"  border="0" cellpadding="0" cellspacing="0">
  315.                   <tr>
  316.                     <td width="3%" align="center"><img src="images/folder.gif" width="20" height="20" align="absmiddle"></td>
  317.                     <td width="37%"><a href="dir_list.jsp?op=editarticle&dir_code=<%=plf.getCode()%>" onMouseUp="curAttachId=''"><%=plf.getName()%></a></td>
  318.                     <td width="13%">&nbsp;</td>
  319.                     <td width="22%">&nbsp;</td>
  320.                     <td width="25%">&nbsp;</td>
  321.                   </tr>
  322.                 </table>
  323.                 <%}%>
  324.                 <%
  325. String strcurpage = StrUtil.getNullString(request.getParameter("CPages"));
  326. if (strcurpage.equals(""))
  327. strcurpage = "1";
  328. if (!StrUtil.isNumeric(strcurpage)) {
  329. out.print(StrUtil.makeErrMsg("标识非法!"));
  330. return;
  331. }
  332. Attachment am = new Attachment();
  333. int pagesize = 30;
  334. int curpage = Integer.parseInt(strcurpage);
  335. String sql = "SELECT id FROM netdisk_document_attach WHERE doc_id=" + doc.getID() + " and page_num=1 order by ";
  336. sql += orderBy + " " + sort;
  337. ListResult lr = am.listResult(sql, curpage, pagesize);
  338. int total = lr.getTotal();
  339. Paginator paginator = new Paginator(request, total, pagesize);
  340. // 设置当前页数和总页数
  341. int totalpages = paginator.getTotalPages();
  342. if (totalpages==0)
  343. {
  344. curpage = 1;
  345. totalpages = 1;
  346. }
  347.   if (doc!=null) {
  348.   // Vector attachments = doc.getAttachments(1);
  349.   Vector attachments = lr.getResult();
  350.   Iterator ir = attachments.iterator();
  351.   while (ir.hasNext()) {
  352.    am = (Attachment) ir.next(); %>
  353. <table width="100%"  border="0" cellspacing="0" cellpadding="0" onMouseOver="this.style.backgroundColor='#FFD6DE'" onMouseOut="this.style.backgroundColor='#ffffff'">
  354.                       <tr>
  355.                         <td width="4%" align="center"><a title="打开文件" target=_blank href="netdisk_getfile.jsp?id=<%=doc.getID()%>&attachId=<%=am.getId()%>"><img src="images/<%=am.getIcon()%>" border="0"></a></td>
  356.                         <td width="37%">&nbsp;
  357.                           <span id="span<%=am.getId()%>" name="span<%=am.getId()%>"><a target=_blank title="打开文件" class="mainA" href="netdisk_getfile.jsp?id=<%=doc.getID()%>&attachId=<%=am.getId()%>" onmouseup='onMouseUp("<%=am.getId()%>", "<%=am.getName()%>")'><%=am.getName()%></a></span></td>
  358.                         <td width="13%"><%=NumberUtil.round((double)am.getSize()/1024, 1)%>KB</td>
  359.                         <td width="19%"><%=DateUtil.format(am.getUploadDate(), "yyyy-MM-dd HH:mm")%></td>
  360.                         <td width="27%">&nbsp;<a href="dir_change.jsp?attachId=<%=am.getId()%>"><img src="images/rename.gif" alt="重命名或移动文件" width="16" height="16" border="0" align="absmiddle"></a> &nbsp;<a href="javascript:delAttach('<%=am.getId()%>', '<%=doc.getID()%>')"><img src="images/del.gif" alt="删除" width="16" height="16" border="0" align="absmiddle"></a>&nbsp;&nbsp;<a target="_blank" href="netdisk_downloadfile.jsp?id=<%=am.getDocId()%>&attachId=<%=am.getId()%>"><img src="images/download.gif" alt="下载" width="16" height="16" border="0" align="absmiddle"></a>
  361.                           <%if (!StrUtil.getNullStr(am.getPublicShareDir()).equals("")) {%>
  362.                           <a href="netdisk_public_share.jsp?attachId=<%=am.getId()%>"><font color="#FF0000">已发布</font></a>
  363.                           <%}else{%>
  364.                           <a href="netdisk_public_share.jsp?attachId=<%=am.getId()%>"><img src="images/share_public.gif" alt="发布" width="16" height="16" border="0" align="absmiddle"></a>
  365.                         <%}%></td>
  366.                       </tr>
  367.                 </table>
  368.   <%}
  369.   }
  370.   %></td>
  371.             </tr>
  372.             <tr>
  373.               <td align=center bgcolor="#FFFFFF">
  374.     <table width="100%" border="0" cellspacing="0" cellpadding="0" name-"ctlTable" id="ctlTable" style="display:none">
  375.                   <tr>
  376.                     <td><table  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  377.                       <tr>
  378.                         <td bgcolor="#FFFFFF"><%
  379. Calendar cal = Calendar.getInstance();
  380. String year = "" + (cal.get(cal.YEAR));
  381. String month = "" + (cal.get(cal.MONTH) + 1);
  382. com.redmoon.oa.Config cfg = new com.redmoon.oa.Config();
  383. String filepath = cfg.get("file_netdisk") + "/" + userName + "/" + year + "/" + month;
  384. %>
  385.                             <object classid="CLSID:DE757F80-F499-48D5-BF39-90BC8BA54D8C" codebase="<%=request.getContextPath()%>/activex/webedit.cab#version=4,0,1,1" width=400 height=0 align="middle" id="webedit">
  386.                               <param name="Encode" value="utf-8">
  387.                               <param name="MaxSize" value="<%=Global.MaxSize%>">
  388.                               <!--上传字节-->
  389.                               <param name="ForeColor" value="(0,0,0)">
  390.                               <param name="BgColor" value="(245,248,247)">
  391.                               <param name="ForeColorBar" value="(255,255,255)">
  392.                               <param name="BgColorBar" value="(0,0,255)">
  393.                               <param name="ForeColorBarPre" value="(0,0,0)">
  394.                               <param name="BgColorBarPre" value="(200,200,200)">
  395.                               <param name="FilePath" value="<%=filepath%>">
  396.                               <param name="Relative" value="1">
  397.                               <!--上传后的文件需放在服务器上的路径-->
  398.                               <param name="Server" value="<%=request.getServerName()%>">
  399.                               <param name="Port" value="<%=request.getServerPort()%>">
  400.                               <param name="VirtualPath" value="<%=Global.virtualPath%>">
  401.                               <param name="PostScript" value="<%=Global.virtualPath%>/netdisk/dir_list_do.jsp">
  402.                               <param name="PostScriptDdxc" value="<%=Global.virtualPath%>/ddxc.jsp">
  403.                               <param name="SegmentLen" value="204800">
  404.                           </object></td>
  405.                       </tr>
  406.                     </table></td>
  407.                   </tr>
  408.                   <tr>
  409.                     <td align="center" height="40">&nbsp;
  410.                       <input name="notuploadfile" type="button" class="singleboarder" value=" 上 传 " onClick="return SubmitWithoutFile()">
  411. &nbsp;&nbsp;
  412. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  413. <input name="remsg" type="button" class="singleboarder" onClick='alert(webedit.ReturnMessage)' value="返回信息">
  414. &nbsp;<span class="p14">
  415. <input type="hidden" name=isuploadfile value="true">
  416. <input type="hidden" name=id value="<%=doc!=null?""+doc.getID():""%>">
  417. <input type="hidden" name="op" value="<%=op%>">
  418. <input type="hidden" name="title" value="<%=leaf.getName()%>">
  419. <input type="hidden" name="dir_code" value="<%=dir_code%>">
  420. <input type="hidden" name="examine" value="<%=Document.EXAMINE_PASS%>">
  421. </span></td>
  422.                   </tr>
  423.               </table>       </td>
  424.             </tr>
  425.         </form>
  426.       </table>
  427.    
  428.   <table width="100%" border="0" cellspacing="0" cellpadding="0">
  429.             <tr>
  430.               <td height="30" align="right">共 <b><%=paginator.getTotal() %></b> 个 每页显示 <b><%=paginator.getPageSize() %></b> 个 页次 <b><%=paginator.getCurrentPage() %>/<%=paginator.getTotalPages() %></b>
  431.                   <%
  432. String querystr = "op=editarticle&orderBy=" + orderBy + "&sort=" + sort + "&dir_code=" + StrUtil.UrlEncode(dir_code);
  433.     out.print(paginator.getCurPageBlock("?"+querystr));
  434. %>
  435.                   <input name="button" type="button" class="button1" onClick="displayCtlTable(this)" value="上 传">
  436.                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  437.             </tr>
  438.           </table>
  439.   <table width="100%"  border="0">
  440.           
  441.           <tr>
  442.             <form name="form3" action="?" method="post"><td align="center">
  443. <input name="newname" type="hidden">
  444. </td></form>
  445.           </tr>
  446.       </table>
  447. </TD>
  448.   </TR>
  449. </TABLE>
  450. <div id="ie5menu" class="skin0" onMouseover="highlightie5(event)" onMouseout="lowlightie5(event)" onClick="jumptoie5(event)" style="display:none">
  451. <div class="menuitems" url="javascript:openFile()">打开</div>
  452. <div class="menuitems" url="javascript:changeName()">重命名</div>
  453. <div class="menuitems" url="javascript:move()">移动文件</div>
  454. <div class="menuitems" url="javascript:del()">删除</div>
  455. <div class="menuitems" url="javascript:download()">下载</div>
  456. <div class="menuitems" url="javascript:publicShare()">发布</div>
  457. <hr width=100%>
  458. <div class="menuitems" url="dir_list.jsp?op=editarticle&dir_code=<%=StrUtil.UrlEncode(dir_code)%>">刷新</div>
  459. </div>
  460. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  461. <form name=form10 action="?">
  462. <tr><td>&nbsp;
  463. <input name="op" type="hidden" value="editarticle">
  464. <input name="action" type="hidden">
  465. <input name="dir_code" type="hidden" value="<%=dir_code%>">
  466. <input name="newname" type="hidden">
  467. <input name="attach_id" type="hidden">
  468. <input name="doc_id" type="hidden" value="<%=id%>">
  469. <input name="page_num" type="hidden" value="1">
  470. <input name="CPages" type="hidden" value="<%=curpage%>"></td></tr>
  471. </form>
  472. </table>
  473. <iframe id="hideframe" name="hideframe" src="fwebedit_do.jsp" width=0 height=0></iframe>
  474. </body>
  475. <script>
  476. function changeAttachName(attach_id, doc_id, nm) {
  477. var obj = findObj(nm);
  478. // document.frames.hideframe.location.href = "fwebedit_do.jsp?op=changeattachname&page_num=1&doc_id=" + doc_id + "&attach_id=" + attach_id + "&newname=" + obj.value
  479. form3.action = "dir_list_do.jsp?op=changeattachname&page_num=1&doc_id=" + doc_id + "&attach_id=" + attach_id;
  480. form3.newname.value = obj.value;
  481. form3.submit();
  482. }
  483. function delAttach(attach_id, doc_id) {
  484. if (!window.confirm("您确定要删除吗?")) {
  485. return;
  486. }
  487. document.frames.hideframe.location.href = "dir_list_do.jsp?op=delAttach&page_num=1&doc_id=" + doc_id + "&attach_id=" + attach_id
  488. }
  489. var curOrderBy = "<%=orderBy%>";
  490. var sort = "<%=sort%>";
  491. function doSort(orderBy) {
  492. if (orderBy==curOrderBy)
  493. if (sort=="asc")
  494. sort = "desc";
  495. else
  496. sort = "asc";
  497. window.location.href = "?dir_code=<%=StrUtil.UrlEncode(dir_code)%>&op=editarticle&orderBy=" + orderBy + "&sort=" + sort;
  498. }
  499. </script>
  500. <script language="JavaScript1.2">
  501. //set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
  502. var display_url=0
  503. var ie5=document.all&&document.getElementById
  504. var ns6=document.getElementById&&!document.all
  505. if (ie5||ns6)
  506. var menuobj=document.getElementById("ie5menu")
  507. function showmenuie5(e){
  508. if (curAttachId=="")
  509. return;
  510. //Find out how close the mouse is to the corner of the window
  511. var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX
  512. var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY
  513. //if the horizontal distance isn't enough to accomodate the width of the context menu
  514. if (rightedge<menuobj.offsetWidth)
  515. //move the horizontal position of the menu to the left by it's width
  516. menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth
  517. else
  518. //position the horizontal position of the menu where the mouse was clicked
  519. menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX
  520. //same concept with the vertical position
  521. if (bottomedge<menuobj.offsetHeight)
  522. menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight
  523. else
  524. menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY
  525. menuobj.style.visibility="visible"
  526. return false
  527. }
  528. function hidemenuie5(e){
  529. menuobj.style.visibility="hidden"
  530. }
  531. function highlightie5(e){
  532. var firingobj=ie5? event.srcElement : e.target
  533. if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
  534. if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode //up one node
  535. firingobj.style.backgroundColor="highlight"
  536. firingobj.style.color="white"
  537. if (display_url==1)
  538. window.status=event.srcElement.url
  539. }
  540. }
  541. function lowlightie5(e){
  542. var firingobj=ie5? event.srcElement : e.target
  543. if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
  544. if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode //up one node
  545. firingobj.style.backgroundColor=""
  546. firingobj.style.color="black"
  547. window.status=''
  548. }
  549. }
  550. function jumptoie5(e){
  551. var firingobj=ie5? event.srcElement : e.target
  552. if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
  553. if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode
  554. if (firingobj.getAttribute("target"))
  555. window.open(firingobj.getAttribute("url"),firingobj.getAttribute("target"))
  556. else
  557. window.location=firingobj.getAttribute("url")
  558. }
  559. }
  560. if (ie5||ns6){
  561. menuobj.style.display=''
  562. document.oncontextmenu=showmenuie5
  563. document.onclick=hidemenuie5
  564. }
  565. function onMouseUp(attachId, attachName) {
  566. // 左键
  567. curAttachId = attachId;
  568. curAttachName = attachName;
  569. if (event.button==1) {
  570. // alert(id + "_" + attachId);
  571. }
  572. // 右键
  573. if (event.button==2) {
  574. // alert(id + "_" + attachId);
  575. }
  576. }
  577. var spanInnerHTML = "";
  578. function changeName() {
  579. if (curAttachId!="") {
  580. spanObj = findObj("span" + curAttachId);
  581. spanInnerHTML = spanObj.innerHTML;
  582. spanObj.innerHTML = "<input name='newName' class=singleboarder size=22 value='" + curAttachName + "' onblur="doChange('" + curAttachId + "',this.value,'" + curAttachName + "'," + spanObj.name + ")" onKeyDown="if (event.keyCode==13) this.blur()">";
  583. addform.newName.focus();
  584. addform.newName.select();
  585. }
  586. }
  587. function doChange(attachId, newName, oldName, spanObj) {
  588. if (newName!=oldName) {
  589. form10.action.value = "changeName";
  590. form10.attach_id.value = attachId;
  591. form10.newname.value = newName;
  592. form10.submit();
  593. }
  594. else {
  595. spanObj.innerHTML = spanInnerHTML;
  596. }
  597. curAttachId = "";
  598. }
  599. function move() {
  600. window.location.href = "dir_change.jsp?attachId=" + curAttachId;
  601. }
  602. function del() {
  603. delAttach(curAttachId, id);
  604. }
  605. function openFile() {
  606. window.open("netdisk_getfile.jsp?id=" + id + "&attachId=" + curAttachId);
  607. }
  608. function download() {
  609. window.open("netdisk_downloadfile.jsp?id=" + id + "&attachId=" + curAttachId);
  610. }
  611. function publicShare() {
  612. window.location.href = "netdisk_public_share.jsp?attachId=" + curAttachId;
  613. }
  614. </script>
  615. </html>