123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <%@ page language="java" pageEncoding="UTF-8" %>
- <%@ page import="java.io.File" %>
- <%@ page import="kr.comsquare.soonsu.define.AdminMessage" %>
- <% request.setCharacterEncoding("UTF-8"); %>
- <html>
- <head>
- <title>TrustForm Soonsu</title>
- </head>
- <%
- String strLanguage = AdminMessage.LANGUAGE;
- String strFontFamily = "Dotum, arial";
- if ("jp".equals(strLanguage))
- {
- strFontFamily = "MS Gothic, arial";
- }
- else if ("us".equals(strLanguage))
- {
- strFontFamily = "arial";
- }
-
- AdminMessage objAdminMessage = new AdminMessage();
- String strLogin = (String)session.getAttribute("login");
- if (strLogin == null || !strLogin.equals("Success"))
- {
- %>
- <script type="text/javascript">
- alert("<%=objAdminMessage.getMessage("main01")%>");
- if (window.parent.document.getElementById("modalBackground"))
- {
- window.parent.document.getElementById("tableFolderList").style.visibility = "hidden";
- window.parent.document.getElementById("modalBackground").style.visibility = "hidden";
- window.parent.document.getElementById("frameFolderList").src = "";
- }
- else
- {
- location.href = "index.jsp";
- }
- </script>
- <%
- return;
- }
- String strPathType = request.getParameter("inputFolderPathType");
- String strPathNum = request.getParameter("inputFolderPathNum");
- String strCurrentPath = request.getParameter("inputFolderValue") == null ? "" : request.getParameter("inputFolderValue");
- String strTargetPath = request.getParameter("inputTargetValue") == null ? "" : request.getParameter("inputTargetValue");
- String strFileSep = strPathType.equals("inputXrwPath") ? File.separator : "/";
- if (strTargetPath.equals(".."))
- {
- if (strCurrentPath.substring(strCurrentPath.length()-1).equals(strFileSep)) strCurrentPath = strCurrentPath.substring(0, strCurrentPath.length()-1);
- if (strCurrentPath.lastIndexOf(strFileSep) < 0)
- {
- strCurrentPath = "";
- }
- else
- {
- strCurrentPath = strCurrentPath.substring(0, strCurrentPath.lastIndexOf(strFileSep)) + strFileSep;
- }
- }
- else
- {
- if (strCurrentPath.equals(""))
- {
- if (strPathType.equals("inputHtmlPath")) strCurrentPath = "/";
- }
- else if (!strCurrentPath.substring(strCurrentPath.length()-1).equals(strFileSep))
- {
- strCurrentPath += strFileSep;
- }
-
- if (!strTargetPath.equals(""))
- {
- if (strTargetPath.substring(strTargetPath.length()-1).equals(strFileSep)) strTargetPath = strTargetPath.substring(0, strTargetPath.length()-1);
- strCurrentPath = strCurrentPath + strTargetPath + strFileSep;
- }
- }
- String strContextPath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
- String strCurrentRealPath = strPathType.equals("inputXrwPath") ? strCurrentPath : application.getRealPath("") + strCurrentPath;
- strCurrentRealPath = strCurrentRealPath.replace("/", File.separator);
- %>
- <script language="javascript">
- function submitByLink (strLinkValue)
- {
- document.getElementById("inputTargetValue").value = strLinkValue;
- document.formFolderList.submit();
- }
-
- function submitByType ()
- {
- document.getElementById("inputFolderValue").value = document.getElementById("inputCurrentPath").value;
- document.getElementById("inputTargetValue").value = "";
- document.formFolderList.submit();
- }
-
- function returnFolderPath ()
- {
- if (document.getElementById("inputFolderValue").value != document.getElementById("inputCurrentPath").value)
- {
- if ("<%=strPathType%>" == "inputXrwPath")
- {
- submitByType();
- }
- else if ("<%=strPathType%>" == "inputHtmlPath")
- {
- window.parent.document.getElementById("<%=strPathType%><%=strPathNum%>").value = document.getElementById("inputCurrentPath").value;
- closeFolderList();
- }
- }
- else
- {
- window.parent.document.getElementById("<%=strPathType%><%=strPathNum%>").value = document.getElementById("inputCurrentPath").value;
- closeFolderList();
- }
- }
- function closeFolderList ()
- {
- window.parent.document.getElementById("tableFolderList").style.visibility = "hidden";
- window.parent.document.getElementById("modalBackground").style.visibility = "hidden";
- window.parent.document.getElementById("frameFolderList").src = "";
- }
-
- <% if (strPathType.equals("inputHtmlPath")) { %>
- function adjustHtmlPath ()
- {
- var nSpanWidth = document.getElementById("spanCurrentPath").offsetWidth;
- var inputHtmlPath = document.getElementById("inputCurrentPath");
- inputHtmlPath.style.left = (nSpanWidth+4)+"px";
- inputHtmlPath.style.width = (345-nSpanWidth)+"px";
- }
- <% } %>
- </script>
- <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" <% if (strPathType.equals("inputHtmlPath")) { %>onload="adjustHtmlPath();"<% } %>>
- <table cellpadding="0" cellspacing="0" align="center">
- <tr>
- <td width="400px" height="50px" align="center">
- <div style="position:relative; width:100%; height:100%; ">
- <div style="position:absolute; left:10px; top:11px; width:380px; height:28px; border:1px solid #CDCDCD; ">
- <%
- if (strPathType.equals("inputXrwPath"))
- {
- %>
- <input id="inputCurrentPath" type="text" style="position:absolute; left:4px; top:6px; width:372px; height:16px; font-family:<%=strFontFamily%>; font-size:9pt; border-width:0px; " value="<%=strCurrentPath%>" onkeypress="javascript:if (event.keyCode==13) {submitByType();}" title="<%=objAdminMessage.getTip("main07")%>"/>
- <%
- }
- else if (strPathType.equals("inputHtmlPath"))
- {
- %>
- <span id="spanCurrentPath" style="position:absolute; left:4px; top:7px; font-family:<%=strFontFamily%>; font-size:9pt; color:#7F7F7F; cursor:default; "><%=strContextPath%></span>
- <input id="inputCurrentPath" type="text" style="position:absolute; top:6px; height:16px; font-family:<%=strFontFamily%>; font-size:9pt; border-width:0px; " value="<%=strCurrentPath%>" onkeypress="javascript:if (event.keyCode==13) {submitByType();}" title="<%=objAdminMessage.getTip("main07")%>"/>
- <%
- }
- %>
- </div>
- </div>
- </td>
- </tr>
- <tr>
- <td width="400px" height="154px" align="center">
- <div style="width:380px;height:152px;overflow-y:scroll;overflow-x:hidden;border-top:1px solid #D9D9D9;border-bottom:1px solid #D9D9D9;">
- <table cellpadding="0" cellspacing="0" align="center" style="font-family:<%=strFontFamily%>; font-size:9pt; color:#1A5B83; ">
- <%
- File objFolderList = new File(strCurrentRealPath);
- String strTrTemp = "<tr bgcolor=\"#F3F3F3\" onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor='#F3F3F3'\">";
- int nPrintRows = 0;
- if (strCurrentRealPath.equals(""))
- {
- File [] arFolderList = File.listRoots();
- for (int i = 0; i < arFolderList.length; i++)
- {
- strTrTemp = strTrTemp.equals("<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">") ? "<tr bgcolor=\"#F3F3F3\" onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor='#F3F3F3'\">":"<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">";
- out.println(strTrTemp);
- out.println(" <td width=\"363px\" height=\"30px\" onclick=\"submitByLink('"+arFolderList[i].getPath().replace("\\","\\\\")+"')\" style=\"cursor:default; padding-left:10px; \">");
- out.println(" <img src=\"image/folderlist03.png\" width=\"21px\" height=\"18px\" border=\"0\" align=\"absmiddle\"/> "+arFolderList[i].getPath());
- out.println(" </td>");
- out.println("</tr>");
- nPrintRows = nPrintRows + 1;
- }
- }
- else if (strPathType.equals("inputXrwPath") && (objFolderList == null || !objFolderList.exists()))
- {
- out.println("<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">");
- out.println(" <td width=\"363px\" height=\"30px\" align=\"center\">");
- out.println(" </td>");
- out.println("</tr>");
- out.println("<tr bgcolor=\"#F3F3F3\" onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor='#F3F3F3'\">");
- out.println(" <td height=\"30px\" align=\"center\" style=\"cursor:default;\">");
- out.println(" "+objAdminMessage.getTip("folderlist01"));
- out.println(" </td>");
- out.println("</tr>");
- nPrintRows = nPrintRows + 2;
- }
- else
- {
- if (strPathType.equals("inputXrwPath") || (strPathType.equals("inputHtmlPath") && !strCurrentPath.equals("/")))
- {
- out.println("<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">");
- out.println(" <td width=\"363px\" height=\"30px\" onclick=\"submitByLink('..')\" style=\"cursor:default;\">");
- out.println(" <img src=\"image/folderlist02.gif\" width=\"11px\" height=\"10px\" border=\"0\" align=\"absmiddle\"/> ..");
- out.println(" </td>");
- out.println("</tr>");
- strTrTemp = "<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">";
- nPrintRows = nPrintRows + 1;
- }
- if (objFolderList.exists())
- {
- File [] arFolderList = objFolderList.listFiles();
- for (int i = 0; i < arFolderList.length; i++)
- {
- if (arFolderList[i].isDirectory() && !arFolderList[i].isHidden())
- {
- strTrTemp = strTrTemp.equals("<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">") ? "<tr bgcolor=\"#F3F3F3\" onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor='#F3F3F3'\">":"<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">";
- out.println(strTrTemp);
- out.println(" <td width=\"363px\" height=\"30px\" onclick=\"submitByLink('"+arFolderList[i].getName()+"')\" style=\"cursor:default; padding-left:10px; \">");
- out.println(" <div style=\"overflow:hidden; width:350px; \"><nobr><img src=\"image/folderlist03.png\" width=\"21px\" height=\"18px\" border=\"0\" align=\"absmiddle\"/> "+arFolderList[i].getName()+"</nobr>");
- out.println(" </td>");
- out.println("</tr>");
-
- nPrintRows = nPrintRows + 1;
- }
- }
- }
- }
-
- if (nPrintRows < 5)
- {
- while (nPrintRows < 5)
- {
- strTrTemp = strTrTemp.equals("<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">") ? "<tr bgcolor=\"#F3F3F3\" onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor='#F3F3F3'\">":"<tr onmouseover=\"this.bgColor='#FFF8CE'\" onmouseout=\"this.bgColor=''\">";
- out.println(strTrTemp);
- out.println(" <td height=\"30px\"></td>");
- out.println("</tr>");
- nPrintRows = nPrintRows + 1;
- }
- }
- %>
- </table>
- </div>
- </td>
- </tr>
- <tr>
- <td width="400px" height="40px" align="center" valign="bottom">
- <%
- if (strPathType.equals("inputHtmlPath") || (strPathType.equals("inputXrwPath") && objFolderList.exists()))
- {
- out.println("<img src=\"image/modalButtOk_"+strLanguage+".gif\" style=\"background-color:#CCCCCC; cursor:hand; \" onclick=\"returnFolderPath();\" width=\"56px\" height=\"25px\" border=\"0\" title=\""+objAdminMessage.getTip("modal01")+"\" alt=\""+objAdminMessage.getTip("modal01")+"\"/> ");
- }
- %>
- <img src="image/modalButtClose_<%=strLanguage%>.gif" style="background-color:#CCCCCC; cursor:hand; " onclick="closeFolderList();" width="56px" height="25px" border="0" title="<%=objAdminMessage.getTip("modal03")%>" alt="<%=objAdminMessage.getTip("modal03")%>"/>
- </td>
- </tr>
- </table>
- <form id="formFolderList" name="formFolderList" method="post" action="folderlist.jsp">
- <input id="inputFolderPathType" name="inputFolderPathType" type="hidden" value="<%=strPathType%>"/>
- <input id="inputFolderPathNum" name="inputFolderPathNum" type="hidden" value="<%=strPathNum%>"/>
- <input id="inputFolderValue" name="inputFolderValue" type="hidden" value="<%=strCurrentPath%>"/>
- <input id="inputTargetValue" name="inputTargetValue" type="hidden"/>
- </form>
- </body>
- </html>
|