<%@ Page Language="C#" EnableTheming="false" Title="Subtext 管理 - 关键字" MasterPageFile="~/Admin/WebUI/AdminPageTemplate.Master"  Codebehind="EditKeyWords.aspx.cs" AutoEventWireup="True" Inherits="Subtext.Web.Admin.Pages.EditKeyWords" %>

<asp:Content ID="actions" ContentPlaceHolderID="actionsHeading" runat="server">菜单</asp:Content>

<asp:Content ID="categoryListTitle" ContentPlaceHolderID="categoryListHeading" runat="server"></asp:Content>

<asp:Content ID="categoriesLinkListing" ContentPlaceHolderID="categoryListLinks" runat="server"></asp:Content>

<asp:Content ID="entryEditor" ContentPlaceHolderID="pageContent" runat="server">
    <st:MessagePanel id="Messages" runat="server"></st:MessagePanel>
	<st:AdvancedPanel id="Results" runat="server" LinkStyle="Image" LinkBeforeHeader="True" DisplayHeader="True"
		HeaderCssClass="CollapsibleHeader" HeaderText="关键字" LinkText="[toggle]" Collapsible="True">
		<ASP:Repeater id="rprSelectionList" runat="server" OnItemCommand="rprSelectionList_ItemCommand">
			<HeaderTemplate>
				<table id="Listing" class="Listing highlightTable" cellspacing="0" cellpadding="0" border="0" style="<%= CheckHiddenStyle() %>">
					<tr>
						<th width="50">字符串</th>
						<th width="150">替换为</th>
						<th width="150">标题</th>
						<th>链接地址</th>
						<th width="150">Rel</th>
						<th width="50">&nbsp;</th>
						<th width="50">&nbsp;</th>
					</tr>
			</HeaderTemplate>
			<ItemTemplate>
				<tr>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Word") %>
					</td>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Text") %>
					</td>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Title")%>
					</td>
					<td>
						<a target="_blank" href='<%# DataBinder.Eval(Container.DataItem, "Url") %>'>
							<%# DataBinder.Eval(Container.DataItem, "Url") %>
						</a>
					</td>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Rel") %>
					</td>
					<td>
						<asp:LinkButton id="lnkEdit" CssClass="buttonSubmit" CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="编辑" runat="server" /></td>
					<td>
						<asp:LinkButton id="lnkDelete" CssClass="buttonSubmit" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="删除" runat="server" /></td>
				</tr>
			</ItemTemplate>
			<AlternatingItemTemplate>
				<tr class="Alt">
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Word") %>
					</td>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Text") %>
					</td>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Title")%>
					</td>
					<td>
						<a target="_blank" href='<%# DataBinder.Eval(Container.DataItem, "Url") %>'>
							<%# DataBinder.Eval(Container.DataItem, "Url") %>
						</a>
					</td>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Rel") %>
					</td>
					<td>
						<asp:LinkButton id="Linkbutton1" CssClass="buttonSubmit" CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="编辑" runat="server" /></td>
					<td>
						<asp:LinkButton id="Linkbutton2" CssClass="buttonSubmit" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="删除" runat="server" /></td>
				</tr>
			</AlternatingItemTemplate>
			<FooterTemplate>
				</table>
			</FooterTemplate>
		</ASP:Repeater>
		<st:PagingControl id="resultsPager" runat="server" 
			PrefixText="<div>分页</div>" 
			LinkFormatActive='<a href="{0}" class="Current">{1}</a>' 
			UrlFormat="EditKeyWords.aspx?pg={0}" 
			CssClass="Pager" />
		<br class="clear" />
	</st:AdvancedPanel>
	<asp:Button id="btnCreate" runat="server" CssClass="buttonSubmit" Text="新建" OnClick="btnCreate_Click" ValidationGroup="btnCreate" />
	<st:AdvancedPanel id="Edit" runat="server" LinkStyle="Image" DisplayHeader="True" HeaderCssClass="CollapsibleTitle"
		HeaderText="编辑关键字" Collapsible="False">
		<div class="Edit"><!-- DEBUG -->
			<p class="Label">字符串<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="txbWord" ForeColor="#990066" ErrorMessage="必须输入一个关键字"></asp:RequiredFieldValidator></p>
			<p><asp:TextBox id="txbWord" runat="server" max="100" columns="255" width="98%"></asp:TextBox></p>
			<p class="Label">替换为<asp:RequiredFieldValidator id="Requiredfieldvalidator2" runat="server" ControlToValidate="txbText" ForeColor="#990066" ErrorMessage="请输入替换后的字符串"></asp:RequiredFieldValidator></p>
			<p><asp:TextBox id="txbText" runat="server" columns="255" width="98%"></asp:TextBox></p>
			<p class="Label">链接地址<asp:RequiredFieldValidator id="Requiredfieldvalidator3" runat="server" ControlToValidate="txbUrl" ForeColor="#990066" ErrorMessage="必须输入一个URL地址"></asp:RequiredFieldValidator></p>
			<p><asp:TextBox id="txbUrl" runat="server" columns="255" width="98%"></asp:TextBox></p>
			<p class="Label">标题</p>
			<p><asp:TextBox id="txbTitle" runat="server" columns="255" width="98%"></asp:TextBox></p>
			<p class="Label">Rel data</p>
			<p><asp:TextBox id="txbRel" runat="server" columns="255" width="98%"></asp:TextBox></p>
			<p class="ValueLabel">
			    <asp:CheckBox id="chkNewWindow" runat="server" textalign="left"></asp:CheckBox>在新窗口中打开
				<asp:CheckBox id="chkFirstOnly" runat="server" textalign="left"></asp:CheckBox>仅在第一次出现时替换
				<asp:CheckBox id="chkCaseSensitive" runat="server" textalign="left"></asp:CheckBox>大小写匹配
			</p>
			<div>
				<asp:Button id="lkbPost" runat="server" CssClass="buttonSubmit" Text="保存" OnClick="lkbPost_Click"></asp:Button>
				<asp:Button id="lkbCancel" runat="server" CssClass="buttonSubmit" Text="取消" CausesValidation="false" OnClick="lkbCancel_Click" />&nbsp;
			</div>
		</div>
	</st:AdvancedPanel>
</asp:Content>