<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Template_Savepath.aspx.cs" Inherits="TotCms.Web.Admin.Template_Savepath" %>

<%@ Register src="UI/main_top.ascx" tagname="main_top" tagprefix="uc1" %>

<!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 runat="server">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>选择栏目保存路径</title>
  <link href="style/global.css" rel="stylesheet" type="text/css" />
  <style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.selectitem {
	CURSOR: default; COLOR: white; BACKGROUND-COLOR:#003399;
}
.item {
	CURSOR: hand; 
}
-->
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
      <uc1:main_top ID="main_top1" runat="server" />
    
    </div>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
      <tr>
        <td width="46%" height="25" bgcolor="#F5F5F5"><div align="center">标题</div></td>
        <td width="32%" bgcolor="#F5F5F5"><div align="center">修改日期</div></td>
      </tr>
        <tr>
        <td height="22" colspan="2" bgcolor="#FFFFFF">&nbsp;&nbsp;<a href="#" onclick="javascript:history.back();" title="back"><img src="images/icon/back.gif" alt="BACK" width="15" height="15" border="0" /></a> 提示：双击名称进入下一级</td>
      </tr>
      <asp:Repeater ID="FileList" runat="server">
        <ItemTemplate>
          <tr>
          <td height="22" bgcolor="#FFFFFF">
	          <div align="left">&nbsp;
	          <img src='images/icon/<%# Convert.ToBoolean(Eval("IsFolder"))?"folder1.gif":"file.gif"%>' width="18" height="18" border="0" align="absmiddle" alt="" />
	          <span onclick="clicks(this);" class="item" title='<%# Request.QueryString["folder"]+"/"+Eval("Name")%>' ondblclick="openFolder(this);"><%# Eval("Name")%></span>
	          </div>	
	        </td>
          <td bgcolor="#FFFFFF"><div align="center"><%# Eval("LastUpdated") %></div></td>
        </tr>
        </ItemTemplate>
      </asp:Repeater>      
    </table>
    <div align="center" style="margin:10px 0;">
      <input type="button" name="Button" value="确 定" onclick="SelectPath()" />&nbsp;&nbsp;
      <input type="button" name="Submit2" value="取 消" onclick="javascript:window.close();" />
    </div>
    </form>
    <script type="text/javascript">
    var selectPath='';
    function clicks(obj){
	    var span=document.getElementsByTagName("span");
	    for(var i=0;i<span.length;i++){
	      span[i].setAttribute("class","item");
	    }
	    obj.setAttribute("class","selectitem");
	    selectPath=obj.getAttribute("title");	    
    }
    function openFolder(obj){
	    location.href="?folder="+obj.getAttribute("title");
    }
    function SelectPath()
    {	
	    var opener=window.opener;
	    var cateobj=opener.document.form1.SavePath;
	    var retvalue='';
	    if(selectPath==''){
		    retvalue='/';
	    }
	    else{
		    retvalue=selectPath;
	    }
	    retvalue=retvalue.replace(/\\/g,"/");
	    cateobj.value=retvalue;
	    window.close();
    }
    function SelectFolder()
    {
	    Obj=event.srcElement;
	    for (var i=0;i<document.all.length;i++)
	    {
		    if (document.all(i).className=='selectitem') document.all(i).className='item';
	    }
	    if (Obj.title!=null)
	    {
		    Obj.className='selectitem';
		    SelectedFolder=Obj.title;
	    }	
    }
    </script>
</body>
</html>
