⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filesys_list.asp

📁 一个很好的asp cms管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
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

If Not Admin.Logined Then
    FLib.Alert "对不起,你已经超时或未登录","./",1
    Response.End
End If

If Not Admin.CheckPopedom("TSYS_GROUP4_FILESYS") Then
    FLib.Alert "权限不足", "BACK", 0
    Response.End
ENd If

Dim Tfs_CreateResult
Tfs.CurrIndex = Request("CurrIndex")
Tfs.CurrPath = Request("CurrPath")
Tfs_CreateResult = Tfs.Init()

If Tfs.CurrIndex <> -1 AND Not Tfs.IsAvailable Then
    Set Tfs = Nothing
    FLib.Alert "目录已不存在", "BACK", 0
    Response.End
End If

Select Case Request("Work")
    Case "CreateFolder"
        CreateFolder()
    Case "DeleteItem"
        DeleteItem()
    Case "MoveItem"
        MoveItem()
End Select
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Tsys FileSystem</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="inc/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
BODY {
    border: none;
}
-->
</style>
<SCRIPT LANGUAGE="JavaScript" src="inc/FunctionLib.js"></script>
<!-- 右键菜单 开始-->
<link href="lib/ContextMenu/css/WebFX-ContextMenu.css" rel="stylesheet" type="text/css">
<script src="lib/ContextMenu/js/ieemu.js"></script>
<script src="lib/ContextMenu/js/ContextMenu.js"></script>
<!-- 右键菜单 结束-->
<script>
if (moz) {
	extendEventObject();
	emulateEventHandlers(["click", "mouseover", "mouseout"]);
	extendElementModel();
	// needed to attach keydown
	emulateAttachEvent();
}

/* 文件系统Js代码-开始 */
var ParentPath = "<%=Tfs.ParentPath%>";
var CurrPath = "<%=Tfs.CurrPath%>";
var CurrIndex = "<%=Tfs.CurrIndex%>";
var VisitUrl = "<%=Tfs.VisitUrl%>";
var EnableEdit = <%If Tfs.EnableEdit Then Response.Write "true" Else Response.Write "false" End If%>;
var EnableMove = <%If Tfs.EnableMove Then Response.Write "true" Else Response.Write "false" End If%>;
var EnableDelete = <%If Tfs.EnableDelete Then Response.Write "true" Else Response.Write "false" End If%>;
var EnableCreate = <%If Tfs.EnableCreate Then Response.Write "true" Else Response.Write "false" End If%>;

function ViewFile(fName)
{
    window.open(VisitUrl + fName);
}

function OpenFolder(PathName)
{
    location.href = "?CurrIndex=" + CurrIndex + "&CurrPath=" + PathName;
}

function ChangeRoot(obj)
{
    if(obj.options[obj.selectedIndex].value == "") return false;
    location.href = "?CurrIndex=" + obj.options[obj.selectedIndex].value;
}

function CreateFolder()
{
    var FolderName = prompt("请输入要建立的目录名称:","")
    if(FolderName){
        self.location.href = "?Work=CreateFolder&CurrIndex=" + CurrIndex + "&CurrPath=" + CurrPath + "&FolderName=" + FolderName;
    }
}

function DeleteItem(ItemList)
{
    if(ItemList == "") return false;
    if(confirm("是否确定要删除?"))
    {
        self.location.href = "?Work=DeleteItem&CurrIndex=" + CurrIndex + "&CurrPath=" + CurrPath + "&ItemList=" + ItemList;
    }else{
        return false;
    }
}

function MoveItem(ItemList)
{
    if(ItemList == "") return false;
    var TargetPath = prompt("请输入目标目录名称:\n“/目录A/目录B”,表示从根目录开始算起", ParentPath?ParentPath:"/");
    if(TargetPath){
        self.location.href = "?Work=MoveItem&CurrIndex=" + CurrIndex + "&CurrPath=" + CurrPath + "&ItemList=" + ItemList + "&TargetPath=" + TargetPath;
    }else{
        return false;
    }
}

function EditFile(fName)
{
    OpenWin2("","FileSYS_Editor.asp?CurrIndex=" + CurrIndex + "&CurrPath=" + CurrPath + "&FileName="+ fName, 600, 500);
}

function CopyUrl(val)
{
    window.clipboardData.setData("Text",val);
}

var PathLabelColor = "#000000";

function contextForFolder(PathName)
{
   var eobj,popupoptions
   popupoptions = [
                    new ContextItem("打开",function(){OpenFolder(CurrPath + "/" + PathName)}),
                    new ContextItem("复制地址",function(){CopyUrl(CurrPath + "/" + PathName)}),
                    new ContextSeperator(),
                    new ContextItem("移动",function(){MoveItem(PathName)}, !EnableMove),
                    new ContextItem("删除",function(){DeleteItem(PathName)}, !EnableDelete),
                    new ContextSeperator(),
                    new ContextItem("新建目录",function(){CreateFolder()}, !EnableCreate)
                  ]
   ContextMenu.display(popupoptions)
}

function contextForFile(fName)
{
   var eobj,popupoptions
   popupoptions = [
                    new ContextItem("打开", function(){ViewFile(fName)}),
                    new ContextItem("复制地址", function(){CopyUrl(VisitUrl + fName)}),
                    new ContextItem("编辑文件", function(){EditFile(fName)}, !EnableEdit),
                    new ContextSeperator(),
                    new ContextItem("移动", function(){MoveItem(fName)}, !EnableMove),
                    new ContextItem("删除", function(){DeleteItem(fName)}, !EnableDelete),
                    new ContextSeperator(),
                    new ContextItem("新建目录", function(){CreateFolder()}, !EnableCreate)
                  ]
   ContextMenu.display(popupoptions)
}

function contextForBody()
{
   var eobj,popupoptions
   popupoptions = [
                    new ContextItem("返选",function(){SelectAllCheckBox('ItemList')}),
                    new ContextItem("移动",function(){MoveItem(GetCheckBoxList('ItemList'))}, !EnableMove),
                    new ContextItem("删除",function(){DeleteItem(GetCheckBoxList('ItemList'))}, !EnableDelete),
                    new ContextItem("新建目录",function(){CreateFolder()}, !EnableCreate),
                    new ContextSeperator(),
                    new ContextItem("刷新",function(){window.location.reload()}),
                    new ContextItem("源码",function(){window.location = 'view-source:' + window.location.href})

                  ]
   ContextMenu.display(popupoptions)
}
/* 文件系统Js代码-结束 */
//-->
</script>
</head>

<body bgcolor="#FFFFFF" onLoad="ContextMenu.intializeContextMenu()" oncontextmenu="contextForBody()">

⌨️ 快捷键说明

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