<%@ Page Language="C#" EnableTheming="false" Title="Subtext 管理 - 链接" MasterPageFile="~/Admin/WebUI/AdminPageTemplate.Master" Codebehind="EditLinks.aspx.cs" AutoEventWireup="True" Inherits="Subtext.Web.Admin.Pages.EditLinks" %>
<%@ Register TagPrefix="st" TagName="CategoryLinks" Src="~/Admin/UserControls/CategoryLinkList.ascx" %>

<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">
    <st:CategoryLinks ID="categoryLinks" runat="server" CategoryType="LinkCollection" />
</asp:Content>

<asp:Content ID="linkContent" 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">
			<HeaderTemplate>
				<table id="Listing" class="Listing highlightTable" cellSpacing="0" cellPadding="0" border="0" style="<%= CheckHiddenStyle() %>">
					<tr>
						<th>名称</th>
						<th width="50">网址</th>
						<th width="50">&nbsp;</th>
						<th width="50">&nbsp;</th>
					</tr>
			</HeaderTemplate>
			<ItemTemplate>
				<tr>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Title") %>
					</td>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Url") %>
					</td>
					<td>
						<asp:linkbutton id="lnkEdit" CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="编辑" runat="server" /></td>
					<td>
						<asp:linkbutton id="lnkDelete" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="删除" runat="server" /></td>
				</tr>
			</ItemTemplate>
			<AlternatingItemTemplate>
				<tr class="Alt">
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Title") %>
					</td>
					<td>
						<%# DataBinder.Eval(Container.DataItem, "Url") %>
					</td>
					<td>
						<asp:linkbutton id="lnkEdit" CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' Text="编辑" runat="server" />
					</td>
					<td>
						<asp:linkbutton id="lnkDelete" 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="EditLinks.aspx?pg={0}" 
			CssClass="Pager" />
		<br class="clear" />
	</st:AdvancedPanel>
	<st:AdvancedPanel id="ImportExport" runat="server" LinkStyle="Image" LinkBeforeHeader="True" DisplayHeader="True"
		HeaderCssClass="CollapsibleTitle" HeaderText="导入/导出" Collapsible="True" BodyCssClass="Edit"
		visible="false">
		<div style="HEIGHT: 0px"><!-- IE bug hides label in following div without this -->
			<div>
				<div>
					<p class="Block"><LABEL class="Block">本地文件路径 (*.opml)</LABEL></p>
					<input class="FileUpload" id="OpmlImportFile" type="file" size="62" name="ImageFile" runat="server" />
					<p>分类</p>
					<p>
						<asp:DropDownList id="ddlImportExportCategories" runat="server"></ASP:DropDownList></p>
				</div>
				<div style="MARGIN-TOP: 8px">
					<asp:Button id="lkbImportOpml" runat="server" CssClass="Button" Text="导入" onclick="lkbImportOpml_Click"></asp:Button><A class="Button" href="Export.aspx?command=opml">Export</A>
					<BR class="clear">
					&nbsp;
				</div>
			</div>
		</div>
	</st:AdvancedPanel>
	<st:AdvancedPanel id="Edit" runat="server" LinkStyle="Image" DisplayHeader="True" HeaderCssClass="CollapsibleTitle"
		HeaderText="编辑链接" Collapsible="False">
		<div class="Edit"><!-- DEBUG -->
			<p>
				<label>链接 ID</label>
				<asp:Label id="lblEntryID" runat="server"></asp:Label>
			</p>
			<p>
				<label for="Edit_txbTitle" AccessKey="t">名称</label>
				<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="txbTitle" ForeColor="#990066"
					ErrorMessage="Your link must have a title"></asp:RequiredFieldValidator></p>
			<p>
				<asp:TextBox id="txbTitle" runat="server" CssClass="textinput"></asp:TextBox></p>
			<p>
				<label for="Edit_txbUrl" AccessKey="w">网址</label>
				<asp:RequiredFieldValidator id="Requiredfieldvalidator2" runat="server" ControlToValidate="txbUrl" ForeColor="#990066"
					ErrorMessage="Your link must have a url"></asp:RequiredFieldValidator></p>
			<p>
				<asp:TextBox id="txbUrl" runat="server" CssClass="textinput"></asp:TextBox></p>
			<p><label for="Edit_txbRss" AccessKey="r">Rss 地址</label></p>
			<p>
				<asp:TextBox id="txbRss" runat="server" CssClass="textinput"></asp:TextBox></p>
			<p><label for="Edit_ddlCategories" AccessKey="c">分类</label></p>
			<p>
				<asp:DropDownList id="ddlCategories" runat="server"></ASP:DropDownList></p>
			<p>
				<asp:CheckBox id="ckbIsActive" runat="server" textalign="Left" Text="显示"></asp:CheckBox>&nbsp; 
					<asp:CheckBox id="chkNewWindow" runat="server" textalign="Left" Text="新窗口"></asp:CheckBox>
				</p>
			<div>
				<asp:Button id="lkbPost" runat="server" CssClass="buttonSubmit" Text="保存" onclick="lkbPost_Click" />
				<asp:Button id="lkbCancel" runat="server" CssClass="buttonSubmit" Text="取消" onclick="lkbCancel_Click" />
				&nbsp;
			</div>
		</div>
	</st:AdvancedPanel>
</asp:Content>