<%@ Page Title="" Language="VB" MasterPageFile="~/App_MasterPage/mpManager.master" AutoEventWireup="false" CodeFile="TemplateURL.aspx.vb" Inherits="Manager_TemplateURL" %>
<%@ Register assembly="ControlPageing" namespace="ControlPageing" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="chpPageTitle" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="chpHead" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="chpScript" Runat="Server">
<script type="text/javascript" src="/App_Themes/ManagerTheme/Js/jquery.min.js"></script>
<script type="text/javascript" src="/App_Themes/ManagerTheme/js/lhgdialog.min.js"></script>
<script language="javascript" type="text/javascript">
    function confirmWindow(url) {
        $.dialog.confirm('<div style="width:240px;line-height:25px;">单击确定将删除此映射，删除后将无法恢复！<br />你确定要删除这个映射吗？</div>', function() {
            window.location = url;
        });
    }
</script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="chpTitle" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="chpContent" Runat="Server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View_Edit" runat="server">
        <script language="javascript" type="text/javascript">
            function insertNum() {
                var objtxt = document.getElementById("<%=txtLookFor.ClientID %>");
                objtxt.value = objtxt.value + "(\\d{0,8})";
            }
            function CopyPath() {
                var strPath = $("#TempPath").html();
                $('#<%=txtSendTo.ClientID %>').attr('value', $('#<%=txtSendTo.ClientID %>').attr('value') + strPath.replace('~/',''));
            }
        </script>
    	    <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" class="line_table">
	    	<tr>
                    <td align="right" width="20%">模板：&nbsp;&nbsp;</td>
                    <td width="30%">
                        <asp:DropDownList ID="dplTmplateClass" runat="server" AutoPostBack="True">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dplTemplate" runat="server" AutoPostBack="True">
                        </asp:DropDownList>
                    </td>
                    <td width="50%"><font color="red">*</font></td>
                </tr>	    	<tr>
                    <td align="right" width="20%">虚拟地址：~/</td>
                    <td width="30%">
                        <asp:TextBox ID="txtLookFor" runat="server"  Width="96%" ></asp:TextBox>
                    </td>
                    <td width="50%"><font color="red">*插入：<span onclick="insertNum();" style=" cursor:pointer;">数字</span></font></td>
                </tr>	    	<tr>
                    <td align="right" width="20%">真实地址：~/</td>
                    <td width="30%">
                        <asp:TextBox ID="txtSendTo" runat="server"  Width="96%" ></asp:TextBox>
                    </td>
                    <td width="50%"><font color="red">*</font></td>
                </tr>                                                                                             	            
                <tr>
                    <td align="right" width="20%">
                        说明：</td>
                    <td colspan="2" width="30%">
                        1、虚拟地址中的规则可自由设定，需传递的类似文章ID等要按正则表达式规则输入。<br />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 例如：虚拟地址 ~/Article/(\d{0,8})\.html&nbsp;&nbsp;&nbsp;&nbsp; 真实地址&nbsp; 
                        ~/Sites/Site34/Template12/ArticleIndex.aspx?ID=$1<br />
                        2、当前文件路径为<asp:Label ID="lblPath" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" colspan="3">
                        <p align="center">
                　          <asp:ImageButton ID="imgSave" runat="server" 
                                ImageUrl="~/App_Themes/ManagerTheme/Images/tj.jpg" style="height: 22px" ToolTip="添加" />
                        </p>
                    </td>
                </tr>
	    </table>        
        </asp:View>
        <asp:View ID="View_List" runat="server">
    	    <div style="text-align: right;" class="edittd">
        	<asp:CheckBox ID="cbSelectAll" runat="server" AutoPostBack="True" Text="全部" />&nbsp;
        	<asp:LinkButton ID="lnkBtnDel" runat="server"><img src="/App_Themes/ManagerTheme/Images/Delete.gif" style=" border:0px"/>&nbsp;删除选中</asp:LinkButton>
        	&nbsp;&nbsp;
        	<a href="/Manager/Template/TemplateURL.aspx?Action=Add&ClassID=<%=Request("ClassID") %>"><img src="/App_Themes/ManagerTheme/Images/add.gif" style=" border:0px" />&nbsp;添加</a>
    	    </div>       
            <asp:Repeater ID="rptList" runat="server">
                <HeaderTemplate>
                    <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" class="line_table">
			<tr>
			    <td width="5%" align="center" class="left_bt2">选择</td>
			    <td width="20%" align="left" class="left_bt2">模板名称</td>
			    <td width="25%" align="left" class="left_bt2">虚拟地址</td>
			    <td width="35%" align="left" class="left_bt2">真实地址</td>
			    <td align="center" width="15%" class="left_bt2">操作</td>
			</tr>
	        </HeaderTemplate>
                <ItemTemplate>
                    <tr class="menuout"   onMouseOver="this.className='menuin'" onMouseOut="this.className='menuout'">
			<td width="5%" align="center"><asp:CheckBox ID="CheckOn" runat="server" ToolTip='<%#Eval("ID")%>' /></td>
			<td width="20%" align="left"><%#Eval("TmpName")%></td>
			<td width="25%" align="left"><%#Eval("LookFor")%></td>
			<td width="35%" align="left"><%#Eval("SendTo")%></td>
			<td width="15%" align="center"><a href="/Manager/Template/TemplateURL.aspx?Action=Edit&ID=<%#Eval("ID") %>">
				<img src="/App_Themes/ManagerTheme/Images/Edit.gif" style=" border:0px" />&nbsp;编辑</a>&nbsp;&nbsp;&nbsp;
				<span style="cursor:pointer" onclick="confirmWindow('/Manager/Template/TemplateURL.aspx?Action=Del&ID=<%#Eval("ID") %>');"><img src="/App_Themes/ManagerTheme/Images/Delete.gif" style=" border:0px" />&nbsp;删除</span></td>
			        </tr>
                </ItemTemplate>
                <FooterTemplate></table></FooterTemplate>
            </asp:Repeater>
            <div style="text-align:center"> <cc1:iPaging ID="ListPaging" runat="server" /></div>        
        </asp:View>        
    </asp:MultiView>
</asp:Content>