<%@ Import Namespace="Microsoft.SharePoint.Administration" %> <%@ Import Namespace="Microsoft.SharePoint.Administration.Backup" %> <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %> <%@ Import Namespace="System.IO" %> <%@ Assembly Name="Microsoft.SharePoint.ApplicationPages.Administration, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> <%@ Page Language="C#" Inherits="Microsoft.SharePoint.ApplicationPages.BackupHistoryPage" MasterPageFile="~/_admin/admin.master" %> <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="AdminControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint.ApplicationPages.Administration" %> <%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %> <% if (IsRestore) { %> <% } else { %> <% } %>

<% SPBackupRestoreHistoryList list = null; bool dirError = false; bool isRestore = false; String filter = Request.QueryString.Get("filter"); int iFilter = 0; if (String.IsNullOrEmpty(filter)) { } else if (filter == "1") { iFilter = 1; } else if (filter == "2") { iFilter = 2; } String strRestore = Request.QueryString.Get("restore"); if (!String.IsNullOrEmpty(strRestore) && strRestore == "1") { isRestore = true; } String dir = TxtBackupPath.Text; String strPage = Request.QueryString.Get("page"); int page = 0; int PER_PAGE = 20; if (strPage != null && strPage.Length > 0) { try { page = Int32.Parse(strPage); } catch { } } int baseIndex = page * PER_PAGE; int max = baseIndex + PER_PAGE; if (!String.IsNullOrEmpty(dir) && !BackupAdminPageBase.IsValidDirectory(dir)) { dirError = true; } { %>

<% if (String.IsNullOrEmpty(dir) || dirError) { } else if (iFilter > 0) { list = SPBackupRestoreConsole.GetHistory(dir, iFilter == 1 ? true : false); } else { list = SPBackupRestoreConsole.GetHistory(dir); } if (list == null || list.Count == 0) { %>

<% } else { %>

<%=SPHttpUtility.HtmlEncode(SPResource.GetString(Strings.ListResults, baseIndex+1, (max > list.Count) ? list.Count : max, list.Count)) %>

 
<% if (IsBoxAdmin) { %> <% } %> <% SPWeb web = SPControl.GetContextWeb(Context); if (iFilter > 0) { list = SPBackupRestoreConsole.GetHistory(dir, iFilter == 1 ? true : false); } else { list = SPBackupRestoreConsole.GetHistory(dir); } for (int i = baseIndex; list != null && (i < max && i < list.Count); i++) { SPBackupRestoreHistoryObject ho = (SPBackupRestoreHistoryObject)list[i]; bool hasCompleted = ho.StartTime <= ho.EndTime; if (i % 2 == 0) { %> <% } else { %> <% } %> <% if (IsBoxAdmin) { if (hasCompleted && ho.IsBackup) { %> <% } else { %><% } } %> <% } %>
<%=SPHttpUtility.NoEncode(SPResource.GetString(Strings.TreeExpand))%>   <% if (ho.ConfigurationOnly) { %> <% } %> <% if (ho.IsFailure) { %> <% } %> <% if (ho.IsBackup) Response.Write(SPHttpUtility.HtmlEncode(SPResource.GetString(Strings.Backup))); else Response.Write(SPHttpUtility.HtmlEncode(SPResource.GetString(Strings.Restore))); %> <% if (ho.IsBackup) { Response.Write(SPHttpUtility.HtmlEncode(BackupAdminPageBase.LocalizeBackupMethod(ho.BackupMethod))); } else { Response.Write(SPHttpUtility.HtmlEncode(BackupAdminPageBase.LocalizeRestoreMethod(ho.RestoreMethod))); } %> <% if (hasCompleted) { %> <%=SPHttpUtility.HtmlEncode(SPUtility.FormatDate(web, ho.EndTime, SPDateFormat.DateTime))%> <% } %> <% if (ho.IsFailure) { Response.Write(ho.FailureMessage); } %>
<% } if (list != null) { %>
<% if (baseIndex > 0) { %> Previous <% } if (baseIndex > 0 && max < list.Count) %>     <% if (max < list.Count) { %> Next <% } } %>
<% } %>