destselection.jsp

来自「Java的框架」· JSP 代码 · 共 134 行

JSP
134
字号
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="/WEB-INF/tld/doc-man.tld" prefix="docman" %>

<c:if test="${param.method == 'moveFolder'}">
	<c:set var="title"><fmt:message key="destSelection.folder.title"/></c:set>
	<c:set var="heading"><fmt:message key="destSelection.folder.heading"/></c:set>
	<c:url var="cancelUrl" value="/folder.action">
		<c:param name="path" value="${docManFolder.folderPath}"/>
	</c:url>
	<c:url var="moveUrl" value="/moveFolder.action" />
</c:if>
<c:if test="${param.method == 'moveFile'}">
	<c:set var="title"><fmt:message key="destSelection.file.title"/></c:set>
	<c:set var="heading"><fmt:message key="destSelection.file.heading"/></c:set>
	<c:url var="cancelUrl" value="/file.action">
		<c:param name="path" value="${docManFile.filePath}"/>
	</c:url>
	<c:url var="moveUrl" value="/moveFile.action" />
</c:if>

<c:set var="message"><fmt:message key="destSelection.message"/></c:set>
<html>
	<head>
		<title><c:out value="${title}"/></title>
		<content tag="heading">
			<c:out value="${heading}"/>
		</content>
    <script type="text/javascript" src="<c:url value='/scripts/selectbox.js'/>"></script>
	</head>
	<script LANGUAGE="JavaScript">
			<c:if test="${param.method == 'moveFolder'}">
			var srcpath = "<c:out value="${docManFolder.parentId}"/>";
			</c:if>
			<c:if test="${param.method == 'moveFile'}">
			var srcpath = "<c:out value="${docManFile.parentId}"/>";
			</c:if>
			function moveToDest(){
				//get selected target
				var destpath = docman_getSelected();
				if (!docman_hasSelection ()) {
					alert ("Please select a destination folder.");
					return false;
				}
				if (destpath == srcpath) {
					alert ("Destination folder is the same as Source folder. Please select another destination folder.");
					return false;
				}
				<c:if test="${param.method == 'moveFolder'}">
				if (destpath == "<c:out value="${docManFolder.folderPath}"/>") {
					alert ("You cannot move the folder back to itself. Please select another destination folder.");
					return false;
				}
				</c:if>
				if (confirm('Are you sure you want to move to the selected destination?')) {
					document.moveForm.destpath.value = destpath;
					document.moveForm.submit ();
				}
			}
	</script>

	<body>
		<span id="message"><c:out value="${message}"/></span>
		<div class="separator"></div>
		<c:set var="pageButtons">
			<button name="move" type="button" style="margin-right: 5px" 
				onclick="javascript:moveToDest();">
				<c:if test="${param.method == 'moveFolder'}">
				<fmt:message key="button.folderObject.move"/>
				</c:if>
				<c:if test="${param.method == 'moveFile'}">
				<fmt:message key="button.fileObject.move"/>
				</c:if>
			</button>

			<button name="cancel" type="button" 
				onclick="window.location='<c:out value="${cancelUrl}"/>'">
	  		<fmt:message key="button.cancel"/>
	 		</button>
		</c:set>
		<c:out value="${pageButtons}" escapeXml="false" />
		<form method="post" action="<c:out value="${moveUrl}"/>" name="moveForm">
			<input type="hidden" name="destpath" value="" />
			<c:if test="${param.method == 'moveFolder'}">
			<input type="hidden" name="path" value="<c:out value="${docManFolder.folderPath}"/>" />
			</c:if>
			<c:if test="${param.method == 'moveFile'}">
			<input type="hidden" name="path" value="<c:out value="${docManFile.filePath}"/>" />
			</c:if>
		</form>
		<table class="detail">
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>
				<c:if test="${param.method == 'moveFolder'}">
				<fmt:message key="folderObject.name"/>:
				</c:if>
				<c:if test="${param.method == 'moveFile'}">
				<fmt:message key="fileObject.name"/>:
				</c:if>
				</td>
				<td>&nbsp;</td>
				<td>
					<c:out value="${docManFile.name}"/>
				</td>
			</tr>
			<tr>
				<c:if test="${param.method == 'moveFolder'}">
				<td><fmt:message key="folderObject.path"/>:</td>
				<td>&nbsp;</td>
				<td>//<c:out value="${docManFolder.parentId}"/></td>
				</c:if>
				<c:if test="${param.method == 'moveFile'}">
				<td><fmt:message key="fileObject.path"/>:</td>
				<td>&nbsp;</td>
				<td>//<c:out value="${docManFile.parentId}"/></td>
				</c:if>
			</tr>
			<tr>
				<td valign="top">Destination Folder:</td>
				<td>&nbsp;</td>
				<td>
				<docman:buildDocStructView folder="${docManFolderStruct}" expandAll="true" />
				</td>
			</tr>
		</table>
		<c:out value="${pageButtons}" escapeXml="false" />
	</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?