<!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>
<!--SKCMS版权所有 未经许可严禁修改并传播本代码, www.skcms.net-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="../conn/sk.Function.cs"-->
<title>SKCMS模板</title>
<script type="text/javascript">var api = frameElement.api, W = api.opener;
</script>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<%
if skweb_ROOT<>"" then sRootDir=skweb_ROOT else sRootDir=""
Set FsoObj = Server.CreateObject("scripting.filesystemobject")

if Request("sid")<>"" then
Application(SkcmsCookies & "SKCMSidgetname") = Request("sid")
end if
 
 
 
ShowVirtualPath = Request("ShowVirtualPath")
CurrPath = Replace(Request("CurrPath"),"//","/")

style="skcms_style/"
if CurrPath = "" then
	CurrPath = MyDbPath&style&skweboa.SK_sys(18)    '顶级目录
	ParentPath = ""
else
	ParentPath = Mid(CurrPath,1,InstrRev(CurrPath,"/")-1)
	if ParentPath = "" then
		ParentPath =sRootDir
	end if
end If
On Error Resume Next
Set FolderObj = FsoObj.GetFolder(Server.MapPath(CurrPath))
Set SubFolderObj = FolderObj.SubFolders
Set FileObj = FolderObj.Files
 %>
<div><a href="javascript:OpenParentFolder('<% = ParentPath %>')"  title="上级目录<% = ParentPath %>"   ><img src="../adminimages/f6.gif" alt="返回上级目录" width="110" height="26" border="0"></a> </div>
 <ul class="gallery">
 <% for each FsoItem In SubFolderObj %>
 
<% If FsoItem.name<>"function" and FsoItem.name<>"images" and FsoItem.name<>"thumb" and FsoItem.name<>"mode"  Then %> 
 <li>
 <div  class="pl"> <a href="javascript:OpenFolder('<% = FsoItem.name %>')"   Path="<% = FsoItem.name %>" title="打开文件夹" ><img src="folder-64.gif" alt="打开文件夹"  ></a><% = FsoItem.name %></div>
 </li>	
 <% End If %>
 
<% next %>


<!--读取文件开始-->

<% for each FsoItem In FileObj
	FileExtName = LCase(Mid(FsoItem.name,InstrRev(FsoItem.name,".")+1))
	if True then
%>
<%
Dim PreviewImagePath,FileIconDic,FileIcon,AvailableShowTypeStr,PicPara
PreviewImagePath = ""&CurrPath&"/thumb/"&FsoItem.name&""    '预览图位置
AvailableShowTypeStr = "asp,html,htm,"      '显示文件
Set FileIconDic = CreateObject("Scripting.Dictionary")
if InStr(AvailableShowTypeStr,FileExtName) = 0 then
FileIcon = FileIconDic.Item(LCase(FileExtName))
else
%>
  <li> <div  class="pl" ><a href="javascript:SelectFile('<% = FsoItem.name %>')"   File="<% = FsoItem.name %>"  > <IMG src="<% = PreviewImagePath %>.gif"  title="点击选中此模板"  onerror="this.onerror=null;this.src='/SKCMS/images/tempNO.gif';" ></a></div> <% = FsoItem.name %></li>   
  
<%
end if
Set FileIconDic = Nothing
end if
next
%>
<div class="c"></div></ul>
<div id="skbody"></div>
<script language="JavaScript">
api.zindex();
var CurrPath='<% = CurrPath %>';
var skweb_ROOT='<% = skweb_ROOT %>';
var ShowVirtualPath='<% = ShowVirtualPath %>';
var SelectedObj=null;
var ContentMenuArray=new Array();
DocumentReadyTF=false;
 
function SelectFile(Obj)  /*点击动作*/
{
 
    var Url='';
	var Path=escape();
	if (CurrPath=='/') Path=escape(CurrPath+Obj);
	else Path=escape(CurrPath+'/'+Obj);
	if (skweb_ROOT!='')
	Path=Path.slice(skweb_ROOT.length+1)
	Path=Path.replace('<%=MyDbPath %>skcms_style/<%= skweboa.SK_sys(18) %>/','');	 /*去除风格目录*/
    document.getElementById('skbody').innerHTML=Path; 
	<% If Request("qt")="t" Then %>
		api.get('editlablexefunc').document.getElementById('<%= Application(SkcmsCookies & "SKCMSidgetname") %>').value = document.getElementById('skbody').innerHTML;
	<% Else %>
	W.document.getElementById('<%= Application(SkcmsCookies & "SKCMSidgetname") %>').value = document.getElementById('skbody').innerHTML;
	<% End If %>
	 
    api.close();
}

function OpenFolder(Obj)
{
	var SubmitPath='';
	if (CurrPath=='/') SubmitPath=CurrPath+Obj;
	else SubmitPath=CurrPath+'/'+Obj;
	location.href='?CurrPath='+SubmitPath;
	AddFolderList(parent.document.all.FolderSelectList,SubmitPath,SubmitPath);
}
</script>

<!--读取文件结束-->
<script language="JavaScript">
function OpenParentFolder(Obj)  /*返回目录*/
{
	location.href='?CurrPath='+Obj;
	SearchOptionExists(parent.document.all.FolderSelectList,Obj);
}
</script>
</body>
</html>