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

📄 newstemplet_list.asp

📁 asp源码 图片ASP整站
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<% Option Explicit %>
<!--#include file="../../../Inc/Cls_DB.asp" -->
<!--#include file="../../../Inc/Const.asp" -->
<!--#include file="../../../Inc/Function.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../../Inc/Session.asp" -->
<!--#include file="../../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P030700") then Call ReturnError1()
Dim NewsTempletPath,FS,FolderObj,SubFolderObj,FileObj,FileItem,FolderItem,FileIconDic,ParentPath
NewsTempletPath = Request("Path")
if NewsTempletPath = "" then
	if SysRootDir = "" then
		NewsTempletPath = "/"
		ParentPath = ""
	else
		NewsTempletPath = "/" & SysRootDir
		ParentPath = ""
	end if
else
	ParentPath = Mid(NewsTempletPath,1,InstrRev(NewsTempletPath,"/")-1)
	if ParentPath = "" then
		ParentPath = "/" & SysRootDir
	end if
end if
Set FS = Server.CreateObject(G_FS_FSO)
Set FolderObj = FS.GetFolder(Server.MapPath(NewsTempletPath))
Set SubFolderObj = FolderObj.SubFolders
Set FileObj = FolderObj.Files
Set FileIconDic = CreateObject("Scripting.Dictionary")
FileIconDic.Add "txt","../../Images/FileIcon/txt.gif"
FileIconDic.Add "gif","../../Images/FileIcon/gif.gif"
FileIconDic.Add "exe","../../Images/FileIcon/exe.gif"
FileIconDic.Add "asp","../../Images/FileIcon/asp.gif"
FileIconDic.Add "html","../../Images/FileIcon/html.gif"
FileIconDic.Add "htm","../../Images/FileIcon/html.gif"
FileIconDic.Add "jpg","../../Images/FileIcon/jpg.gif"
FileIconDic.Add "jpeg","../../Images/FileIcon/jpg.gif"
FileIconDic.Add "pl","../../Images/FileIcon/perl.gif"
FileIconDic.Add "perl","../../Images/FileIcon/perl.gif"
FileIconDic.Add "zip","../../Images/FileIcon/zip.gif"
FileIconDic.Add "rar","../../Images/FileIcon/zip.gif"
FileIconDic.Add "gz","../../Images/FileIcon/zip.gif"
FileIconDic.Add "doc","../../Images/FileIcon/doc.gif"
FileIconDic.Add "xml","../../Images/FileIcon/xml.gif"
FileIconDic.Add "xsl","../../Images/FileIcon/xml.gif"
FileIconDic.Add "dtd","../../Images/FileIcon/xml.gif"
FileIconDic.Add "vbs","../../Images/FileIcon/vbs.gif"
FileIconDic.Add "js","../../Images/FileIcon/vbs.gif"
FileIconDic.Add "wsh","../../Images/FileIcon/vbs.gif"
FileIconDic.Add "sql","../../Images/FileIcon/script.gif"
FileIconDic.Add "bat","../../Images/FileIcon/script.gif"
FileIconDic.Add "tcl","../../Images/FileIcon/script.gif"
FileIconDic.Add "eml","../../Images/FileIcon/mail.gif"
FileIconDic.Add "swf","../../Images/FileIcon/flash.gif"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>模板列表</title> 
</head>
<link href="../../../CSS/FS_css.css" rel="stylesheet">
<script language="JavaScript" src="../../SysJS/PublicJS.js"></script>
<script language="JavaScript" src="../../SysJS/ContentMenu.js"></script>
<script language="JavaScript">
var CurrPath=escape('<% = NewsTempletPath %>');
var ListObjArray = new Array();
var ContentMenuArray=new Array();
var DocumentReadyTF=false;
function document.onreadystatechange()
{
	if (DocumentReadyTF) return;
	IntialListObjArray();
	InitialClassListContentMenu();
	DocumentReadyTF=true;
}
function InitialClassListContentMenu()
{
	ContentMenuArray[ContentMenuArray.length]=new ContentMenuFunction("parent.PreEditTemplet();",'可视编辑','disabled');
	ContentMenuArray[ContentMenuArray.length]=new ContentMenuFunction("parent.TxtEditTemplet();",'文本编辑','disabled');
	ContentMenuArray[ContentMenuArray.length]=new ContentMenuFunction("parent.AddFile();",'新建文件','');
	ContentMenuArray[ContentMenuArray.length]=new ContentMenuFunction("parent.EditFolder();",'重命名','disabled');
	ContentMenuArray[ContentMenuArray.length]=new ContentMenuFunction("parent.DelFolderOrFile();",'删除','');
}
function ContentMenuShowEvent()
{
	ChangeTempletMenuStatus();
}
function ChangeTempletMenuStatus()
{
	var EventObjInArray=false,SelectFolder='',SelectFile='',DisabledContentMenuStr='';
	for (var i=0;i<ListObjArray.length;i++)
	{
		if (event.srcElement==ListObjArray[i].Obj)
		{
			if (ListObjArray[i].Selected==true) EventObjInArray=true;
			break;
		}
	}
	for (var i=0;i<ListObjArray.length;i++)
	{
		if (event.srcElement==ListObjArray[i].Obj)
		{
			ListObjArray[i].Obj.className='TempletSelectItem';
			ListObjArray[i].Selected=true;
			if (ListObjArray[i].Obj.Path!=null)
			{
				if (SelectFolder=='') SelectFolder=ListObjArray[i].Obj.Path;
				else SelectFolder=SelectFolder+'***'+ListObjArray[i].Obj.Path
			}
			if (ListObjArray[i].Obj.File!=null)
			{
				if (SelectFile=='') SelectFile=ListObjArray[i].Obj.File;
				else SelectFile=SelectFile+'***'+ListObjArray[i].Obj.File
			}
		}
		else
		{
			if (!EventObjInArray)
			{
				ListObjArray[i].Obj.className='TempletItem';
				ListObjArray[i].Selected=false;
			}
			else
			{
				if (ListObjArray[i].Selected==true)
				{
					if (ListObjArray[i].Obj.Path!=null)
					{
						if (SelectFolder=='') SelectFolder=ListObjArray[i].Obj.Path;
						else SelectFolder=SelectFolder+'***'+ListObjArray[i].Obj.Path
					}
					if (ListObjArray[i].Obj.File!=null)
					{
						if (SelectFile=='') SelectFile=ListObjArray[i].Obj.File;
						else SelectFile=SelectFile+'***'+ListObjArray[i].Obj.File
					}
				}
			}
		}
	}
	if ((SelectFolder=='')&&(SelectFile=='')) DisabledContentMenuStr=',可视编辑,删除,预览,文本编辑,重命名,';
	else
	{
		if (SelectFile=='') DisabledContentMenuStr=',可视编辑,预览,文本编辑,';
		else
		{
			if (SelectFile.indexOf('***')!=-1) DisabledContentMenuStr=',可视编辑,预览,文本编辑,';
			else
			{
				if (SelectFolder!='') DisabledContentMenuStr=',可视编辑,预览,文本编辑,';
				else DisabledContentMenuStr='';
			}
		}
	}
	for (var i=0;i<ContentMenuArray.length;i++)
	{
		if (DisabledContentMenuStr.indexOf(ContentMenuArray[i].Description)!=-1) ContentMenuArray[i].EnabledStr='disabled';
		else  ContentMenuArray[i].EnabledStr='';
	}
}
function ContentMenuFunction(ExeFunction,Description,EnabledStr)
{
	this.ExeFunction=ExeFunction;
	this.Description=Description;
	this.EnabledStr=EnabledStr;
}
function AddFolder()
{
	OpenWindow('../../FunPages/Frame.asp?PageTitle=创建栏目&FileName=AddFolder.asp&Path='+CurrPath,200,90,window);
}
function AddFile()
{
	OpenWindow('../../FunPages/Frame.asp?PageTitle=创建文件&FileName=AddFile.asp&Path='+CurrPath,200,90,window);
}
function DelFolderOrFile()
{
	var SelectedFolder='',SelectedFile='';
	for (i=0;i<ListObjArray.length;i++)
	{
		if (ListObjArray[i].Selected==true)
		{
			if (ListObjArray[i].Obj.Path!=null)
			{
				if (SelectedFolder=='') SelectedFolder=ListObjArray[i].Obj.Path;
				else  SelectedFolder=SelectedFolder+'***'+ListObjArray[i].Obj.Path;
			}
			if (ListObjArray[i].Obj.File!=null)
			{
				if (SelectedFile=='') SelectedFile=ListObjArray[i].Obj.File;
				else  SelectedFile=SelectedFile+'***'+ListObjArray[i].Obj.File;
			}
		}
	}
	SelectedFile=escape(SelectedFile);
	SelectedFolder=escape(SelectedFolder);
	if ((SelectedFile!='')||(SelectedFolder!=''))
	OpenWindow('../../FunPages/Frame.asp?PageTitle=删除文件&Path='+CurrPath+'&FileName=DelFolderAndFile.asp&DelFolder='+SelectedFolder+'&DelFile='+SelectedFile,200,90,window);
	else alert('没有选择要删除的目录或者文件');
}
function ImportTempletFile()
{
	OpenWindow('../../FunPages/Frame.asp?FileName=UpFileForm.asp&PageTitle=上传文件&Path='+CurrPath,350,170,window);
}
function TxtEditTemplet()
{
	var SelectedFolder='',SelectedFile='';
	for (i=0;i<ListObjArray.length;i++)
	{
		if (ListObjArray[i].Selected==true)
		{
			if (ListObjArray[i].Obj.Path!=null)
			{
				if (SelectedFolder=='') SelectedFolder=ListObjArray[i].Obj.Path;
				else  SelectedFolder=SelectedFolder+'***'+ListObjArray[i].Obj.Path;
			}
			if (ListObjArray[i].Obj.File!=null)
			{
				if (SelectedFile=='') SelectedFile=ListObjArray[i].Obj.File;
				else  SelectedFile=SelectedFile+'***'+ListObjArray[i].Obj.File;
			}
		}
	}
	SelectedFile=escape(SelectedFile);
	if (SelectedFile!='')
	{
		if (SelectedFile.indexOf('***')==-1) location='../../Editer/TextEditer.asp?Path='+CurrPath+'&FileName='+SelectedFile;
		else alert('一次只能够编辑一个文件');
	}
	else alert('请选择要编辑的文件');
}
function PreEditTemplet()
{
	var SelectedFolder='',SelectedFile='';
	for (i=0;i<ListObjArray.length;i++)
	{
		if (ListObjArray[i].Selected==true)
		{
			if (ListObjArray[i].Obj.Path!=null)
			{
				if (SelectedFolder=='') SelectedFolder=ListObjArray[i].Obj.Path;
				else  SelectedFolder=SelectedFolder+'***'+ListObjArray[i].Obj.Path;
			}
			if (ListObjArray[i].Obj.File!=null)
			{
				if (SelectedFile=='') SelectedFile=ListObjArray[i].Obj.File;
				else  SelectedFile=SelectedFile+'***'+ListObjArray[i].Obj.File;
			}
		}
	}
	SelectedFile=escape(SelectedFile);
	if (SelectedFile!='')
	{
		if (SelectedFile.indexOf('***')==-1) location='Templet_Edit.asp?Path='+CurrPath+'&FileName='+SelectedFile;
		else alert('一次只能够编辑一个文件');
	}
	else alert('请选择要编辑的文件');
}
function PreviewTemplet()
{
	var SelectedFolder='',SelectedFile='';
	for (i=0;i<ListObjArray.length;i++)
	{
		if (ListObjArray[i].Selected==true)
		{
			if (ListObjArray[i].Obj.Path!=null)
			{
				if (SelectedFolder=='') SelectedFolder=ListObjArray[i].Obj.Path;
				else  SelectedFolder=SelectedFolder+'***'+ListObjArray[i].Obj.Path;
			}
			if (ListObjArray[i].Obj.File!=null)
			{
				if (SelectedFile=='') SelectedFile=ListObjArray[i].Obj.File;
				else  SelectedFile=SelectedFile+'***'+ListObjArray[i].Obj.File;
			}
		}
	}
	if (SelectedFile!='')

⌨️ 快捷键说明

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