<!-- #include virtual="/NR/System/WBC/Internals/Main/WBCApp.inc"-->

<!-- #include virtual="/NR/System/WBC/Internals/ServerControls/StateControl/CNCStateControl.inc"-->

<!-- #include virtual="/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/RevisionBrowser/Page/RevisionHistory/CNCStateRenderer_Filter.inc"-->

<!-- #include virtual="/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/RevisionBrowser/Page/Common/PageRevisionServer.inc"-->
<!-- #include virtual="/NR/System/WBC/Customizable/WBCFuncPagesConfig/UIStringConstants/PageRevisionUIStrings.inc" -->
<!-- #include virtual="/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/RevisionBrowser/Page/Common/ProgrammingConstants.inc"-->


<%
' ********************************************************************
' Copyright (C) 2001 Microsoft Corporation. All rights reserved.
'
'	IMPORTANT.  Please read the legal.txt file, located in the
'	"<CMS Install Directory>\Server\httpexec\WBC\Internals"
'	directory, governing the use of this internal file."
' ********************************************************************

' ********************************************************************
' File:		/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/RevisionBrowser/
'			Page/RevisionHistory/m_bPersistedAcrossSessionsInfo.asp
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
' Purpose:	Encapsulate the ASP logic associated with PageRevisionDlg.asp
'
' Implements the INCASPPageManager interface:
'	- Sub InitManager()
'
' Exposes the following properties:
'	- Property CurrentPage
'	- Property FilterChkboxStateControl
'	- Property PageRevisionInfoURL
'	- Property PageHistoryURL
'	- Property PageCompareURL
' ********************************************************************

Class CNCASPPageManager_PageRevisionInfo

	' -- Object for current Page
	Public CurrentPage

	' -- Object needed for "Check box"
	Public FilterChkboxStateControl

	' --- URL for other page
	Public PageRevisionInfoURL
	Public PageHistoryURL
	Public PageCompareURL

	' --- Date to compare
	Public DateCompareFrom
	Public DateCompareTo
	Public TypeCompareFrom
	Public TypeCompareTo
	Public ValueCompareFrom
	Public ValueCompareTo

	Private m_pFormReader

	' ---- [Public] InitManaer will take care of all programming logic in the ASP page
	Public Sub InitManager()
		' set update a form reader
		Call SetupFormReader()

		' -- Set up a set of StateControls to keep the checkbox status
		Call SetupChkboxStateControl()

		' -- Set up Page and Page configure control to control the list view of the Page Revision
		Call SetupCurrentPage()
		Call SetupPageRevisionInfoURL()
		Call SetupPageHistoryURL()
		Call SetupPageCompareURL()
		Call SetupCompareInfo()
	End Sub

	' ---- [Private] Sets up a set of state control for checkbox option
	Private Sub SetupChkboxStateControl()
		Dim pStateRenderer
		Set pStateRenderer = New CNCStateRenderer_Filter
		Set FilterChkboxStateControl = New CNCStateControl

		Call FilterChkboxStateControl.InitStateControl( IDS_CHKBOX_INSTANCE_ID, pStateRenderer, IDS_CHK_POSTING, true )
		Call FilterChkboxStateControl.AddState( IDS_CHK_NONE )
		Call FilterChkboxStateControl.AddState( IDS_CHK_RESOURCE )
		Call FilterChkboxStateControl.AddState( IDS_CHK_POSTING )
		Call FilterChkboxStateControl.AddState( IDS_CHK_ALL )

		' update the checkbox state
		If ( m_pFormReader.Form( IDS_CHECKBOX_FILTER_STATE ) <> "") Then
			FilterChkboxStateControl.CurrentState = CStr( m_pFormReader.Form( IDS_CHECKBOX_FILTER_STATE ) )
		End If
	End Sub

	' ---- [Private] Sets up the current Page.
	Private Sub SetupCurrentPage()
		Set CurrentPage = AutoSession.ThisPosting
	End Sub

	' ---- [Private] return the URL for Page History.
	Private Sub SetupPageRevisionInfoURL()
		PageRevisionInfoURL = IDS_PAGEREVISION_INFO_URL & CurrentPage.QueryString
	End Sub

	' ---- [Private] return the URL for Page History.
	Private Sub SetupPageHistoryURL()
		PageHistoryURL = IDS_PAGEREVISION_HISTORY_URL & CurrentPage.QueryString & "&" & IDS_QSTR_FILTER_STATE & "=" & FilterChkboxStateControl.CurrentState
	End Sub

	' ---- [Private] return the URL for Page comparison.
	Private Sub SetupPageCompareURL()
		PageCompareURL =  IDS_COMPAREDLG_URL & CurrentPage.QueryString
	End Sub

	' ---- [Public] Return the Compare from date and type.
	Public Sub SetupCompareInfo()
		DateCompareFrom = m_pFormReader.Form( IDS_COMPAREFROM_DATE )
		DateCompareTo = m_pFormReader.Form( IDS_COMPARETO_DATE )

		TypeCompareFrom = m_pFormReader.Form( IDS_COMPAREFROM_TYPE )
		TypeCompareTo = m_pFormReader.Form( IDS_COMPARETO_TYPE )

		ValueCompareFrom = m_pFormReader.Form( IDS_COMPAREFROM_VALUE )
		ValueCompareTo = m_pFormReader.Form( IDS_COMPARETO_VALUE )
	End Sub

	Private sub SetupFormReader()
		Set m_pFormReader = GetInitializedFormReaderSafe( false )
	End Sub
End Class

%>