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

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