📄 filesys_select.asp
字号:
<%
Option Explicit
'----------------------------------------------------------------------------------
'本页:
' 文件系统列表页面
'说明:
'
'----------------------------------------------------------------------------------
%>
<!--#include file="inc/Config.class.asp"-->
<!--#include file="inc/DBControl.class.asp"-->
<!--#include file="inc/FunctionLib.class.asp"-->
<!--#include file="inc/Manager.class.asp"-->
<!--#include file="inc/FileSys.class.asp"-->
<%
Dim Cfg, Db, FLib, Admin, Tfs
Set Cfg = New Config
Set Db = New DBControl
Set FLib = New FunctionLib
Set Admin = New Manager
Set Tfs = New TFileSys
Dim Tfs_CreateResult
Dim FItem, SelecteState, UpFileName,ShowPhotopath
UpFileName = Request("FileName")
Tfs.CurrPath = Request("CurrPath")
If Request("CurrIndex")="" Then
If Tfs.HaveFolderItem Then
For Each FItem In Tfs.FolderItems
Tfs.CurrIndex = FItem.selectSingleNode("./index").Text
Next
End If
Else
Tfs.CurrIndex = Request("CurrIndex")
End If
Tfs_CreateResult = Tfs.Init()
If Tfs.CurrIndex <> -1 AND Not Tfs.IsAvailable Then
Set Tfs = Nothing
FLib.Alert "目录已不存在", "BACK", 0
Response.End
End If
If UpFileName = "" Then
ShowPhotopath ="../html/temp/subfile/logo.gif"
Else
ShowPhotopath =ShowCurrentPath_showphoto&UpFileName
End IF
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图片文件选择</title>
<link href="inc/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
BODY {
border: none;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.bottom_1px {
border-bottom-width: 1px;
border-bottom-style: dashed;
border-bottom-color: #666666;
}
-->
</style>
<script>
function ChangeRoot(obj)
{
if(obj.options[obj.selectedIndex].value == "") return false;
location.href = "?CurrIndex=" + obj.options[obj.selectedIndex].value;
}
function Changeshowphoto(filename)
{
var pics=window.document.showphoto;
var filepath = "<%=ShowCurrentPath_showphoto%>";
pics.src = filepath + filename;
}
function BackURL(filename)
{
var filepath = "<%=ShowCurrentPath_showphoto%>";
<% if Request.QueryString("openertype")=1 then %>
opener.document.all.small_img.value = filepath + filename;
<% else %>
opener.document.all.d_fromurl.value = filepath + filename;
<% End if %>
self.close();
}
</script>
</head>
<body>
<table width="720" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" colspan="2" class="bottom_1px">选择系统目录
<select name="FolderList" class="select_list" id="FolderList">
<%
If Tfs.HaveFolderItem Then
For Each FItem In Tfs.FolderItems
If CInt(FItem.selectSingleNode("./index").Text) = Tfs.CurrIndex Then
SelecteState = "Selected"
Else
SelecteState = ""
End If
Response.Write " <option value=""" & FItem.selectSingleNode("./index").Text & """ " & SelecteState & ">" & FItem.selectSingleNode("./title").Text & "</option>" & vbCrLf
Next
End If
%>
</select>
<input name="Submit" type="button" class="input_button" onClick="ChangeRoot(document.all.FolderList)" value="转到"></td>
</tr>
<tr>
<td height="5" colspan="2"></td>
</tr>
<tr>
<td width="170" height="20"><div align="center">选择图片</div></td>
<td width="550">图片预览 <%=ShowCurrentPath_showphoto%></td>
</tr>
<tr>
<td height="330" valign="top"><div align="center">
<%
If Tfs_CreateResult Then
Dim SubItems,TempSelect
Set SubItems = Tfs.SubItems("file")
%>
<select name="select_photo" size="22" class="select_list" id="select_photo" onChange="Changeshowphoto(this.options[this.selectedIndex].value)">
<option value="">---------------------</option>
<% For Each FItem In Tfs.SubItems("file")
TempSelect = ""
If Server.HtmlEncode(FItem.Name) = Server.HtmlEncode(UpFileName) Then
TempSelect = " selected = selected"
End if
%>
<option value="<%=Server.HtmlEncode(FItem.Name)%>"<%=TempSelect%>><%=FItem.Name%></option>
<% Next %>
</select>
<% End If %>
</div></td>
<td rowspan="2"><div align="center"><img id="showphoto" src="<%=ShowPhotopath%>" name="showphoto" border="0" /></div></td>
</tr>
<tr>
<td height="30"><div align="center">
<input name="Submit" type="button" class="input_button" value="选 取" onClick="BackURL(document.all.select_photo.value)" />
</div></td>
</tr>
<tr>
<td height="5" colspan="2" class="bottom_1px"> </td>
</tr>
<tr>
<td height="5" colspan="2"></td>
</tr>
<tr>
<form name="form1" enctype="multipart/form-data" method="post" action="FileSYS_Upload_Select.asp" onSubmit="if(this.file.value == '') return false;" <%If Not Tfs.EnableUpload Then Response.Write "Disabled" End If%>>
<td colspan="2">
上传文件:
<input name="CurrIndex" type="hidden" id="CurrIndex" value="<%=Tfs.CurrIndex%>">
<input name="CurrPath" type="hidden" id="CurrPath" value="<%=Tfs.CurrPath%>">
<input name="file" type="file" class="input_text">
<input name="Submit2" type="submit" class="input_button" value="上传" <%If Not Tfs.EnableUpload Then Response.Write "Disabled" End If%>>
<input name="AutoRename" type="checkbox" id="AutoRename" value="1" checked="checked">
<label for="AutoRename">上传后自动重命名</label>
</td>
</form>
</tr>
</table>
</body>
</html>
<%
'函数:显示当前路径'
'返回:路径串'
Function ShowCurrentPath_showphoto()
If Not Tfs_CreateResult Then
ShowCurrentPath = ""
Exit Function
End If
ShowCurrentPath_showphoto = Tfs.CurrUrl
If Tfs.IsRoot Then
Exit Function
End If
Dim arrPath, parentPath, I, parentPathName
arrPath = Split(Tfs.CurrPath, "/")
parentPath = ""
For I=0 To Ubound(arrPath)
parentPath = parentPath & arrPath(I)
parentPathName = arrPath(I)
ShowCurrentPath = ShowCurrentPath &Server.HtmlEncode(parentPathName)
If I <> Ubound(arrPath) Then
parentPath = parentPath & "/"
ShowCurrentPath_showphoto = ShowCurrentPath & "/"
End If
Next
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -