<%@ Register TagPrefix="CP" Namespace="CommunityServer.ControlPanel.Controls" Assembly="CommunityServer.Web" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="CA" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<%@ Register TagPrefix="TWC" Namespace="Telligent.Web.UI" Assembly="Telligent.Web.UI" %>
<%@ Page Language="c#" Codebehind="RssCtrlManage.aspx.cs" AutoEventWireup="false" Inherits="CommunityServer.ControlPanel.Tools.RssCtrlManage" %>
<cp:controlpanelselectednavigation selectednavitem="RssCtrls" runat="server" id="SelectedNavigation1" />
<CS:MPContainer runat="server" ID="MPContainer" ThemeMasterFile="SetupControlPanelMaster.ascx">
<cs:mpcontent id="DescriptionRegion" runat="server"><cp:resourcecontrol id="RegionTitle" runat="Server" resourcename="CP_Tools_ManageRSSCtrls_Title" /></cs:mpcontent> 
<cs:mpcontent id="TaskRegion" runat="Server">
<script type="text/javascript">
   function onInsert(item)
  {
        return true; 
  }
  
  function onUpdate(item)
  {
      return true; 
  }
  
  function onCallbackError(excString)
  {
    if (confirm('Invalid data has been entered. View details?')) alert(excString); 
    gridFeeds.Page(1); 
  }

  function onDelete(item)
  {
      if (confirm("Delete record?"))
        return true; 
      else
        return false; 
  }
  
  function editGrid(rowId)
  {
    <%= gridFeeds.ClientID %>.Edit(<%= gridFeeds.ClientID %>.GetRowFromClientId(rowId)); 
  }
  
  function editRow(rowId)
  {
    <%= gridFeeds.ClientID %>.EditComplete();
  }

  function insertRow()
  {
    <%= gridFeeds.ClientID %>.EditComplete();
  }
  
  function editCancel()
  {
    <%= gridFeeds.ClientID %>.EditCancel(); 
  }

  function deleteRow(rowId)
  {
    <%= gridFeeds.ClientID %>.Delete(<%= gridFeeds.ClientID %>.GetRowFromClientId(rowId)); 
  }
  </script>
<cs:StatusMessage runat="server" id="Status" />
<asp:label id=StatusMessage runat="Server"></asp:label>
<br />
<TWC:TabbedPanes id="EditorTabs" runat="server"
	PanesCssClass="CommonPane"
	TabSetCssClass="CommonPaneTabSet"
	TabCssClasses="CommonPaneTab,CommonPaneTab1,CommonPaneTab2"
	TabSelectedCssClasses="CommonPaneTabSelected,CommonPaneTabSelected1,CommonPaneTabSelected2"
	TabHoverCssClasses="CommonPaneTabHover,CommonPaneTabHover1,CommonPaneTabHover2"
	>
	<TWC:TabbedPane runat="server">
		<Tab><CP:ResourceControl runat="server" ResourceName="CP_Tools_ManageRSSCtrls_Tab_ControlSettings" /></Tab>
		<Content>
		    <TABLE cellSpacing=0 cellPadding=0 border=0>
		      <TR>
                <TD class="CommonFormFieldName">
                    <cp:helpicon id="Helpicon3" runat="server" resourcename="CP_Tools_ManageRSSCtrls_LabelName_Help"></cp:helpicon>
                    <cp:formlabel id="Formlabel3" runat="Server" resourcename="CP_Tools_ManageRSSCtrls_LabelName" controltolabel="Name"></cp:formlabel></TD>
                <TD class="CommonFormField">
                    <cp:formlabel id="FormlabelName" runat="Server" controltolabel="Name"></cp:formlabel></TD></TD></TR>
              <TR>
                <TD class="CommonFormFieldName">
                    <cp:helpicon id="Helpicon1" runat="server" resourcename="CP_Tools_ManageRSSCtrls_LabelTitle_Help"></cp:helpicon>
                    <cp:formlabel id="Formlabel1" runat="Server" resourcename="CP_Tools_ManageRSSCtrls_LabelTitle" controltolabel="CtrlTitle"></cp:formlabel></TD>
                <TD class="CommonFormField">
                    <asp:textbox id="CtrlTitle" runat="Server" width="200" cssclass="ControlPanelTextInput"></asp:textbox>
                    <asp:requiredfieldvalidator runat="server" errormessage="*" font-bold="True" controltovalidate="CtrlTitle" id="CtrlTitleValidator" /></TD></TR>
              <TR>
                <TD class="CommonFormFieldName">
                    <cp:helpicon id="Helpicon5" runat="server" resourcename="CP_Tools_ManageRSSCtrls_LabelExcerptSize_Help"></cp:helpicon>
                    <cp:formlabel id="Formlabel5" runat="Server" resourcename="CP_Tools_ManageRSSCtrls_LabelExcerptSize" controltolabel="PostCount"></cp:formlabel></TD>
                <TD class="CommonFormField">
                    <asp:textbox id="ExcerptSize" runat="Server" width="60" cssclass="ControlPanelTextInput"></asp:textbox>
                    <asp:requiredfieldvalidator runat="server" errormessage="*" font-bold="True" controltovalidate="ExcerptSize" id="ExcerptSizeValidator" />
                    </TD></TR>
              <TR>
              <TR>
                <TD class="CommonFormFieldName">
                    <cp:helpicon id="Helpicon2" runat="server" resourcename="CP_Tools_ManageRSSCtrls_LabelPostCount_Help"></cp:helpicon>
                    <cp:formlabel id="Formlabel2" runat="Server" resourcename="CP_Tools_ManageRSSCtrls_LabelPostCount" controltolabel="ExcerptSize"></cp:formlabel></TD>
                <TD class="CommonFormField">
                    <asp:textbox id="PostCount" runat="Server" width="50" cssclass="ControlPanelTextInput"></asp:textbox>
                    <asp:requiredfieldvalidator runat="server" errormessage="*" font-bold="True" controltovalidate="PostCount" id="PostCountValidator" />
                    </TD></TR>
              <TR>
                <TD class="CommonFormFieldName">
                    <cp:helpicon id="Helpicon4" runat="server" resourcename="CP_Tools_ManageRSSCtrls_Save_Help"></cp:helpicon>
                    <cp:formlabel id="Formlabel4" runat="Server" resourcename="CP_Tools_ManageRSSCtrls_Save" controltolabel="CtrlSaveButton"></cp:formlabel></TD>
                <TD class="CommonFormField">
                    <cp:ResourceLinkButton id="CtrlSaveButton" runat="Server" cssclass="CommonTextButton" resourcename="Save" /></TD></TR>
                <TD class="CommonFormFieldName">
                    <cp:helpicon id="Helpicon16" runat="server" resourcename="CP_Tools_ManageRSSCtrls_Purge_Help"></cp:helpicon>
                    <cp:formlabel id="Formlabel6" runat="Server" resourcename="CP_Tools_ManageRSSCtrls_Purge" controltolabel="CtrlPurgeButton"></cp:formlabel></TD>
                <TD class="CommonFormField">
                    <cp:ResourceLinkButton id="CtrlPurgeButton" runat="Server" cssclass="CommonTextButton" resourcename="CP_Tools_ManageRSSCtrls_Purge" /></TD></TR>
            </TABLE>
            <asp:textbox id="hiddenUniqueID" runat="Server"></asp:textbox>
		</Content>
	</TWC:TabbedPane>
	<TWC:TabbedPane runat="server">
		<Tab><CP:ResourceControl runat="server" ResourceName="CP_Tools_ManageRSSCtrls_Tab_Feeds" /></Tab>
		<Content>
		<div id="GrayGrid">
              <CA:Grid id="gridFeeds"
                EnableViewState="false"
                EditOnClickSelectedItem="false"
                AllowEditing="true"
                AutoCallBackOnInsert="true"
                AutoCallBackOnUpdate="true"
                AutoCallBackOnDelete="true"
                AllowTextSelection="true"
                ShowHeader="False"
                FooterCssClass="GridFooter"
                RunningMode="Callback" 
                PagerStyle="Numbered"
                PagerTextCssClass="PagerText" 
                PageSize="10" 
                ImagesBaseUrl="../../utility/caimages/"
                ClientSideOnInsert="onInsert"
                ClientSideOnUpdate="onUpdate"
                ClientSideOnDelete="onDelete"
                ClientSideOnCallbackError="onCallbackError"
                width="440"
                LoadingPanelClientTemplateId="LoadingFeedbackTemplate"
                LoadingPanelPosition="MiddleCenter"
                runat="server">
                <Levels>
                  <CA:GridLevel 
                    DataKeyField="UrlID"
                    ShowTableHeading="false" 
                    ShowSelectorCells="false" 
                    SelectorCellCssClass="SelectorCell"
                    SelectorCellWidth="18"
                    SelectorImageUrl="selector.gif"
                    SelectorImageWidth="17"
                    SelectorImageHeight="15"
                    HeadingSelectorCellCssClass="SelectorCell" 
                    HeadingCellCssClass="HeadingCell" 
                    HeadingRowCssClass="HeadingRow" 
                    HeadingTextCssClass="HeadingCellText"            
                    DataCellCssClass="DataCell" 
                    RowCssClass="Row" 
                    SelectedRowCssClass="SelectedRow"
                    SortImageWidth="10" 
                    SortImageHeight="10" 
                    EditCellCssClass="EditDataCell"
                    EditFieldCssClass="EditDataField"
                    EditCommandClientTemplateId="EditCommandTemplate"
                    InsertCommandClientTemplateId="InsertCommandTemplate"
                    >
                    <Columns>
                        <CA:GridColumn DataField="CtrlID" Visible="false"/>
                       <CA:GridColumn DataField="UrlID" Visible="false"/>
                        <CA:GridColumn DataField="Title" />
                      <CA:GridColumn DataField="Url" />
                      <CA:GridColumn DataField="SiteUrl" />
                      <CA:GridColumn DataField="IntervalMinutes" />
                     
                      <CA:GridColumn HeadingText="Action" DataCellClientTemplateId="EditTemplate" EditControlType="EditCommand" Width="100" Align="Center" />
                    </Columns>
                  </CA:GridLevel>
                </Levels>
                <ClientTemplates>
                  <CA:ClientTemplate Id="EditTemplate">
                    <a href="javascript:editGrid('## DataItem.ClientId ##');">Edit</a> | <a href="javascript:deleteRow('## DataItem.ClientId ##')">Delete</a>
                  </CA:ClientTemplate>
                  <CA:ClientTemplate Id="EditCommandTemplate">
                    <a href="javascript:editRow('## DataItem.ClientId ##');">Update</a> | <a href="javascript:editCancel();">Cancel</a>
                  </CA:ClientTemplate>
                  <CA:ClientTemplate Id="InsertCommandTemplate">
                    <a href="javascript:insertRow();">Insert</a> | <a href="javascript:editCancel();">Cancel</a>
                  </CA:ClientTemplate>
                  <CA:ClientTemplate Id="LoadingFeedbackTemplate">
                  <table cellspacing="0" cellpadding="0" border="0">
                  <tr>
                    <td style="font-size:10px;">Loading...&nbsp;</td>
                    <td><img src="/images/spinner.gif" width="16" height="16" border="0" /></td>
                  </tr>
                  </table>
                  </CA:ClientTemplate>
                </ClientTemplates>
              </CA:Grid>
              </div>
              <br/>
              <table width="100%" cellpadding="0" cellspacing="0" border="0">
              <tr>
                <td align="left" valign="top"><input type="button" onclick="<%= gridFeeds.ClientID %>.Table.AddRow()" value="Add Feed" /></td>
               </tr>
              </table>
			</Content>
		</TWC:TabbedPane>
</TWC:TabbedPanes>
</cs:mpcontent>
</CS:MPContainer>
