<%
' ********************************************************************
' 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/
'			Common/PageRevisionServer.inc
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
' Purpose:	Helper function for HTML scripting
'
' ********************************************************************

' ---- [Public]	Write Page general information html tags in Revision History
Sub WBC_writePageInfoHTML( pASPPageManager )
	Dim pASPUtils
    Dim strDisplayName

    Set pASPUtils = GetInitializedASPUtils()
	strDisplayName = pASPUtils.HTMLEncode( pASPPageManager.CurrentPage.DisplayName )
%>
	<table width="100%" border="0" cellspacing="0" cellpadding="<%= C_INT_THICK_BORDER %>" class="WBC_styclsBackground1">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="5" class="WBC_styclsBackground2">
				<tr class="WBC_styclsBackground2">
					<td class="WBC_styclsHeavyTextColor1" width="20%">
						<%= IDS_UI_LABEL_PAGE %>
					</td>
					<td class="WBC_styclsTextColor1">
						<% Call pASPUtils.MBCSWrite( strDisplayName, pASPPageManager.CurrentPage.CodePage ) %>
					</td>
				</tr>
			</table>
		</td>
	</table>
<%
End Sub

' ---- [Public]	Write Page Filtering configuration information html tags in Revision History
Sub WBC_writeConfigDisplayTypeHTML( pASPPageManager )
%>
	<table width="100%" border="0" cellspacing="0" cellpadding="<%= C_INT_THICK_BORDER %>" class="WBC_styclsBackground1">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="5" class="WBC_styclsBackground2">
				<td>
					<table width="100%" height="<%= ID_CONFIG_TABLE_HEIGHT %>" border="0" cellspacing="0" cellpadding="0" class="WBC_styclsBackground2">
						<tr valign="top">
							<td class="WBC_styclsHeavyTextColor1" colspan="2">
								<nobr><%= IDS_UI_LABEL_CONFIG_DESCRIPTION %></nobr>
							</td>
						</tr>
						<% Call pASPPageManager.FilterChkboxStateControl.DisplayStateControl() %>
						<tr>
							<td colspan=3><img src="<%=IDS_TRANSPARENT_GIF%>"
								width="15" height="<%= C_INT_XSMALL_SPACING %>" border="0"></td>
						</tr>
						<tr valign="top">
							<td align="right" valign="bottom">
								<a href="#" onclick="WBC_onClickApplyButton(); return false;">
									<img name="WBC_imgApply" src="<%= IDS_PATH_IMAGES_COMMON & IDS_IMG_BTN_APPLY_OFF_GIF %>" border="0" alt=""></a>
							</td>
						</tr>
					</table
				</td>
			</table>
		</td>
	</table>
<%
End Sub

' ---- [Public]	Write Page Comparison date information html tags in Revision History
Sub WBC_writeDisplayCompareInfoHTML( pASPPageManager )
%>
	<table width="100%" border="0" cellspacing="0" cellpadding="<%= C_INT_THICK_BORDER %>" class="WBC_styclsBackground1">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="5" class="WBC_styclsBackground2">
				<td>
					<table width="100%" height="<%= ID_CONFIG_TABLE_HEIGHT %>" border="0" cellspacing="0" cellpadding="0" class="WBC_styclsBackground2">
						<tr valign="top">
							<td class="WBC_styclsHeavyTextColor1" colspan="2">
								<%= IDS_UI_LABEL_COMPARE_DESCRIPTION %>
							</td>
						</tr>
						<tr>
							<td class="WBC_styclsTextColor1">
								<%= IDS_UI_LABLE_COMPARE %>:
							</td>
							<td class="WBC_styclsTextColor1">
								&nbsp;&nbsp;<input class="WBC_styclsTextColor1" type="text" Readonly onfocus="this.blur(); return true;"
									name="WBC_intxtCompareFrom" size="<%= IIf( isIE, ID_LARGE_INPUTBOX_IE, ID_SMALL_INPUTBOX_NS) %>"
									style="background-color:transparent;" value="">
								<input type="hidden" name="<%= IDS_COMPAREFROM_DATE %>" value="<%= pASPPageManager.DateCompareFrom %>">
								<input type="hidden" name="<%= IDS_COMPAREFROM_VALUE %>" value="<%= pASPPageManager.ValueCompareFrom %>">
								<input type="hidden" name="<%= IDS_COMPAREFROM_TYPE %>" value="<%= Server.HTMLEncode(pASPPageManager.TypeCompareFrom) %>">
							</td>
						</tr>
						<tr>
							<td class="WBC_styclsTextColor1">
								<%= IDS_UI_LABLE_TO %>:
							</td>
							<td class="WBC_styclsTextColor1">
								&nbsp;&nbsp;<input class="WBC_styclsTextColor1" type="text" Readonly onfocus="this.blur(); return true;"
									name="WBC_intxtCompareTo" size="<%= IIf( isIE, ID_LARGE_INPUTBOX_IE, ID_SMALL_INPUTBOX_NS) %>"
									style="background-color:transparent;" value="">
								<input type="hidden" name="<%= IDS_COMPARETO_DATE %>" value="<%= pASPPageManager.DateCompareTo %>">
								<input type="hidden" name="<%= IDS_COMPARETO_VALUE %>" value="<%= pASPPageManager.ValueCompareTo %>">
								<input type="hidden" name="<%= IDS_COMPARETO_TYPE %>" value="<%= Server.HTMLEncode(pASPPageManager.TypeCompareTo) %>">
							</td>
						</tr>
						<tr  valign="bottom">
							<td>&nbsp;</td>
							<td align="right">
								<a href="#" onclick="WBC_openCompareDlg('<%= pASPPageManager.PageCompareURL %>'); return false;">
										<img name="WBC_imgCompareBtn" src="<%= IDS_PATH_IMAGES_COMMON & IDS_IMG_BTN_COMPARE_GIF %>" border="0" alt=""></a>
								&nbsp;
								<a href="#" onclick="WBC_onClickClearBtn(); return false;">
										<img name="WBC_imgClearBtn" src="<%= IDS_PATH_IMAGES_COMMON & IDS_IMG_BTN_CLEAR_GIF %>" border="0" alt=""></a>
							</td>
						</tr>
					</table>
				</td>
			</table>
		</td>
	</table>
<%
End Sub

' ---- [Public]	Write Page Unapproval table html tags in Revision History
Sub WBC_writeUnApprovalInfoHTML( pThisObject )
    Dim strLastModifiedDate
    Dim strCurrentPagePropsURL
    Dim strRevisionDate

	strLastModifiedDate = FormatDate( pThisObject.LastModifiedDate )
	strRevisionDate = FormatDate( pThisObject.RevisionDate )
	strCurrentPagePropsURL = IDS_FRAMEWORK_VIRTUAL_PATH & IDS_PROPERTIES_URL & pThisObject.QueryString
%>
	<table width="100%' border="0" cellspacing="1" cellpadding="5">
		<tr class="WBC_styclsBackground2">
			<td class="WBC_styclsHeavyTextColor1" align="center" width="50">
				<img border="0" src="<%= IDS_PATH_IMAGES_COMMON & IDS_IMG_ICON_COMPARE_GIF %>">
			</td>
			<td class="WBC_styclsHeavyTextColor1" align="center" width="300">
				<%= IDS_UI_LABEL_LAST_MODIFIED_DATE %>
			</td>
			<td class="WBC_styclsHeavyTextColor1" align="center" width="50">
				<%= IDS_UI_LABEL_PROPERTIES %>
			</td>
			<td class="WBC_styclsHeavyTextColor1" align="center">
				<%= IDS_UI_LABEL_STATUS %>
			</td>
		</tr>
		<tr class="WBC_styclsAlternateRowBg1">
			<td valign="top" class="WBC_styclsTextColor0" align="center">
				<input type="checkbox" name="WBC_inchkRevisionPage"
					onclick="WBC_onClickRevisionPage('<%= strLastModifiedDate %>', '<%= CDbl( pThisObject.RevisionDate ) %>', '<%= IDS_UI_LABEL_CAUSEBY_PAGE %>', this );"
					value="<%= strLastModifiedDate %>">
			</td>
			<td valign="top" class="WBC_styclsTextColor0">
				<a href="#" onClick="WBC_onClickPreviewIcon('<%= pThisObject.URL %>'); return false;">
					<img alt="<%= IDS_UI_TOOLTIP_PREVIEW %>" border="0" src="<%= IDS_PATH_IMAGES_COMMON & IDS_IMG_ICON_PREVIEW_GIF %>"></a>
					<script language="JavaScript" type="text/javascript">
					<!--
						WBC_writeUTC2Local( '<%= strLastModifiedDate %>' );
					// -->
					</script>
			</td>
			<td valign="top" class="WBC_styclsTextColor0"  align="center">
				<a href="#" onclick="WBC_openPropertiesDlg( '<%= strCurrentPagePropsURL %>' ); return false;">
					<img alt="<%= IDS_UI_TOOLTIP_PROPERTIES %>" border="0" src="<%= IDS_PATH_IMAGES_COMMON & IDS_IMG_ICON_PROPERTIES_GIF %>"></a>
			</td>
			<td valign="top" class="WBC_styclsTextColor0">
				<%= pThisObject.StateUnapprovedVersion %>
			</td>
		</tr>

	</table>
<%
End Sub

' ---- [Public]	Write Page comparison information html tags in Compare Dialog
Sub WBC_writeCompareInfoHTML( pASPPageManager )
	Dim pASPUtils
    Dim strDisplayName
    Dim strApprovalDate

    Set pASPUtils = GetInitializedASPUtils()
	strDisplayName = pASPUtils.HTMLEncode( pASPPageManager.CurrentPage.DisplayName )
%>
	<table width="100%" border="0" cellspacing="0" cellpadding="2" class="WBC_styclsBackground1">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="5" class="WBC_styclsBackground2">
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="2" class="WBC_styclsBackground2">
						<tr class="WBC_styclsBackground2">
							<td class="WBC_styclsHeavyTextColor1" width="35%">
								<%= IDS_UI_LABEL_PAGE %>
							</td>
							<td class="WBC_styclsTextColor1">
					 			<% Call pASPUtils.MBCSWrite( strDisplayName, pASPPageManager.CodePage ) %>
							</td>
						</tr>
						<tr class="WBC_styclsBackground2">
							<td class="WBC_styclsHeavyTextColor1">
								<%= IDS_UI_LABEL_COMPARE_FROM %>
							</td>
							<td class="WBC_styclsTextColor1">
								<script language="JavaScript" type="text/javascript">
								<!--
									WBC_writeUTC2Local("<%= pASPPageManager.DateCompareFrom %>");
								// -->
								</script>
								&nbsp;<%= pASPPageManager.TypeCompareFrom %>
							</td>
						</tr>
						<tr class="WBC_styclsBackground2">
							<td class="WBC_styclsHeavyTextColor1">
								<%= IDS_UI_LABEL_COMPARE_TO %>
							</td>
							<td class="WBC_styclsTextColor1">
								<script language="JavaScript" type="text/javascript">
								<!--
									WBC_writeUTC2Local("<%= pASPPageManager.DateCompareTo %>");
								// -->
								</script>
								&nbsp;<%= pASPPageManager.TypeCompareTo %>
							</td>
						</tr>
					</table>
				</td>
			</table>
		</td>
	</table>
<%
End Sub

' ---- [Public]	Write Display name
Sub WBC_writeDisplayNameHTML( pThisObject )
	Dim pASPUtils
    Dim strDisplayName

    Set pASPUtils = GetInitializedASPUtils()
	strDisplayName = pASPUtils.HTMLEncode( pThisObject.DisplayName )
%>
	<table width="100%" border="0" cellspacing="0" cellpadding="<%= C_INT_THICK_BORDER %>" class="WBC_styclsBackground1">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="5" class="WBC_styclsBackground2">
				<tr class="WBC_styclsBackground2">
					<td class="WBC_styclsHeavyTextColor1" width="180">
						<%= IDS_UI_LABEL_PAGE %>
					</td>
					<td class="WBC_styclsTextColor1">
			 			<% Call pASPUtils.MBCSWrite( strDisplayName, pThisObject.CodePage ) %>
					</td>
				</tr>
			</table>
		</td>
	</table>


<%
End Sub


' ---- [Private] Write option list for months
Sub WBC_writeMonthList()
	Dim i
	For i = 0 to 11
%>
				<option value="<%= i+1 %>"><%= IDCOL_MONTH(i) %></option>
<%
	Next
End Sub

' ---- [Private] Write option list for days
Sub WBC_writeDayList()
	Dim i
	For i = 1 to 31
		If i < 10 Then
%>
				<option value="<%= i %>">0<%= i %></option>
<%		Else %>
				<option value="<%= i %>"><%= i %></option>
<%
		End If
	Next
End Sub


' ---- [Private] Write option list for years
Sub WBC_writeYearList()
	Dim i
	For i = 1997 to 2010
%>
				<option value="<%= i %>"><%= i %></option>
<%
	Next
End Sub


' ---- [Private] Write option list for hours
Sub WBC_writeHoursList()
%>
				<option value="12">12</option>
<%
	Dim i
	For i = 1 to 11
		If i < 10 Then
%>
				<option value="<%= i %>">0<%= i %></option>
<%		Else %>
				<option value="<%= i %>"><%= i %></option>
<%
		End If
	Next
End Sub


' ---- [Private]	Write option list for minutes
Sub WBC_writeMinutesList()
	Dim i
	For i = 0 to 59
		If i < 10 Then
%>
				<option value="<%= i %>">0<%= i %></option>
<%		Else %>
				<option value="<%= i %>"><%= i %></option>
<%
		End If
	Next
End Sub


' ---- [Private]	retrieve the ralated revision type
Function WBC_getRevisionType( strRevisionType )
	Dim strType

	If (strRevisionType = IDS_CAUSEBY_PAGE) Then
		strType = IDS_UI_LABEL_CAUSEBY_PAGE
	ElseIf (strRevisionType = IDS_CAUSEBY_TEMPLATE) Then
		strType = IDS_UI_LABEL_CAUSEBY_TEMPLATE
	ElseIf (strRevisionType = IDS_CAUSEBY_RESOURCE) Then
		strType = IDS_UI_LABEL_CAUSEBY_RESOURCE
	Else
		strType = ""
	End If

	WBC_getRevisionType = strType
End Function
%>