<%
' ********************************************************************
' 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/
'			AuthPreview/AuthPreviewConnectedSel/CNCGridDecorator_AuthPreviewConnectedSelDlg.inc
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
' Purpose:	Implements the INCGridDecorator Interface for the Connected Pages
'			selected for preview in authoring mode
'
' Implement INCGridDecorator Interface:
'	- Sub RenderColumnHeadTRAttrib()
'	- Sub RenderColumnHeadTDAttrib( strColumnIndex )
'	- Sub RenderColumnHeadTDContent( strColumnIndex )
'	- Sub RenderItemTRAttrib( pObject, nCollectionIndex, nDisplayIndex )
'	- Sub RenderItemTDAttrib( pObject, nCollectionIndex, nDisplayIndex, strColumnIndex )
'	- Sub RenderItemTDContent( pObject, nCollectionIndex, nDisplayIndex, strColumnIndex )
'	- Sub SortCollection( strSortByColumn, colObjects, bAscending )
'	- Sub RenderEmptyGrid()
' ********************************************************************

Class CNCGridDecorator_AuthPreviewConnectedSelDlg

	' ---- [Public] Render the column head <TR> attributes
	Public Sub RenderColumnHeadTRAttrib()
		Response.Write( "class='WBC_styclsBackground2' " )
	End Sub

	' ---- [Public] Render the column head <TD> attributes
	Public Sub RenderColumnHeadTDAttrib( strColumnIndex )
		Response.Write( "class='WBC_styclsHeavyTextColor1' align='center' " )
	End Sub

	' ---- [Public] Render the column head <TD> content
	Public Sub RenderColumnHeadTDContent( strColumnIndex )
		Select Case strColumnIndex
			Case IDS_GRIDINDEX_AUTHPREVIEW_DISPLAYNAME
				Response.Write( IDS_UI_LABEL_DISPLAYNAME )
			Case IDS_GRIDINDEX_AUTHPREVIEW_LOCATION
				Response.Write( IDS_UI_LABEL_LOCATION )
		End Select
	End Sub

	' ---- [Public] Render the column head <TR> attributes
	Public Sub RenderItemTRAttrib( pObject, nCollectionIndex, nDisplayIndex )
		If (nDisplayIndex Mod 2 = 0) Then
			Response.Write( "class='WBC_styclsAlternateRowBg1' " )
		Else
			Response.Write( "class='WBC_styclsAlternateRowBg2' " )
		End If
	End Sub


	' ---- [Public]
	Public Sub RenderItemTDAttrib( pObject, nCollectionIndex, nDisplayIndex, strColumnIndex )


		Response.Write( "class='WBC_styclsTextColor0' " )
	End Sub

	' ---- [Public]
	Public Sub RenderItemTDContent( pObject, nCollectionIndex, nDisplayIndex, strColumnIndex )

		Dim strPreviewURL

		If pObject.IsFramed Then
			strPreviewURL = pObject.URLPostingFrame(False) & "&" &  IDS_QPARAM_WBCACCEPT & "=" & IDS_ACCEPTCONTENT_PHS
		Else
			strPreviewURL = pObject.URL &  "&" & IDS_QPARAM_WBCACCEPT & "=" & IDS_ACCEPTCONTENT_PHS
		End If


		Select Case strColumnIndex

			Case IDS_GRIDINDEX_AUTHPREVIEW_DISPLAYNAME
				Response.write("<a target='_blank' " & "href='#' ")
				Response.write("onClick='javascript:WBC_onSelectPreviewEntry(" & """" & strPreviewURL & """" &"); return false;'>")
				Response.write("<img border=0 src='" & IDS_AUTHPREVIEW_IMG_PATH & IDS_IMG_ICON_PREVIEW & "'></a> ")
				Call g_pASPPageManager.ASPUtilsObject.MBCSWrite( g_pASPPageManager.ASPUtilsObject.HTMLEncode(pObject.DisplayName), g_pASPPageManager.CodePage )

			Case IDS_GRIDINDEX_AUTHPREVIEW_LOCATION
				Call g_pASPPageManager.ASPUtilsObject.MBCSWrite( g_pASPPageManager.ASPUtilsObject.HTMLEncode( pObject.Parent.DisplayPath ), g_pASPPageManager.CodePage )

		End Select

	 End Sub

	' ---- [Public] Gives Decorator a chance to sort the collection
	Public Sub SortCollection( strSortByColumn, colObjects, bAscending )
		Select Case strSortByColumn
			Case IDS_GRIDINDEX_AUTHPREVIEW_DISPLAYNAME
				Call colObjects.SortByDisplayName( bAscending )
			Case IDS_GRIDINDEX_AUTHPREVIEW_LOCATION
				Call colObjects.SortByDisplayPath( bAscending )
		End Select
	End Sub

' ---- [Public] Render the Grid content area when there are no items to show
	Public Sub RenderEmptyGrid()
		Response.Write( "<span class='WBC_styclsTextColor1'>" & IDS_UI_NO_CONNECTED_POSTINGS_AVAILABLE & "</span>" )
	End Sub


End Class

%>