<%
' ********************************************************************
' 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/
'			PageOperation/EditMode/PageCopy/CNCTreeRenderer_InternalLinks.inc
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
' Purpose:	Responsible for Displaying Content Management Server hierarchy tree
'
' Implement NCLCRenderer Interface:
'	- Sub RenderContainerNode( pObject, pDOM, bExpanded )
'	- Sub RenderLeafNode( pObject, strObjName )
' ********************************************************************

Class CNCTreeRenderer_InternalLinks

	' ---- [Public] Render a Container node in the Tree
	Public Sub RenderContainerNode( pObject, pDOM, bExpanded )
	
		Dim pASPUtils
		Set pASPUtils = g_pASPPageManager.ASPUtilsObject
	    
		' -- determine Channel icon based on various properties of the Channel object
		Dim strOpenedChannelIconURL, strClosedChannelIconURL
		If (pObject.IsImportant And pObject.IsHiddenModePublished) Then
			strOpenedChannelIconURL = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_OPENED_CHANNEL_IMPORTANT_HIDDEN
			strClosedChannelIconURL = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_CLOSED_CHANNEL_IMPORTANT_HIDDEN
		ElseIf (pObject.IsImportant) Then
			strOpenedChannelIconURL = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_OPENED_CHANNEL_IMPORTANT
			strClosedChannelIconURL = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_CLOSED_CHANNEL_IMPORTANT
		ElseIf (pObject.IsHiddenModePublished) Then
			strOpenedChannelIconURL = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_OPENED_CHANNEL_HIDDEN
			strClosedChannelIconURL = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_CLOSED_CHANNEL_HIDDEN
		Else
			strOpenedChannelIconURL = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_OPENED_CHANNEL
			strClosedChannelIconURL = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_CLOSED_CHANNEL
		End If

		Dim lTimeStamp
		lTimeStamp = CDbl(CDate(now))

		Dim strURL
		strURL = pObject.URLModePublished

		' -- rendering Channel icon (closed or opened)
		Call pASPUtils.MBCSWrite(" <a " & "href='#' onclick='WBC_onTreeNodeClicked(""" & strURL & """);return false;'>", g_pASPPageManager.CodePage)
		If bExpanded Then
			Call Response.Write( "<img border=0 src='" & strOpenedChannelIconURL & "'>" )
		Else
			Call Response.Write( "<img border=0 src='" & strClosedChannelIconURL & "'>" )
		End If
		Call Response.Write( "</a>")

		' -- spacing between Channel icon and Channel name
		Response.Write( "&nbsp;&nbsp;" )

		' -- render Channel Name
		Call Response.Write("<span class='WBC_styclsHeavyTextColor0'>" )
		Call pASPUtils.MBCSWrite("<a " & "href='#' onclick='WBC_onTreeNodeClicked(""" & strURL & """);return false;'>", g_pASPPageManager.CodePage)
		Call pASPUtils.MBCSWrite(pASPUtils.HTMLEncode(pObject.DisplayName), g_pASPPageManager.CodePage)
		Call Response.Write( "</a></span>")
	End Sub

	' ---- [Public] Render a Leaf node in the Tree
	Public Sub RenderLeafNode( pObject, pDOM )
		Dim pASPUtils, strURL
		strURL = pObject.URLModePublished
		Set pASPUtils = g_pASPPageManager.ASPUtilsObject

		' -- determine Posting icon based on various properties
		Dim strPostingIcon
		strPostingIcon = IDS_INTERNALLINKS_IMG_PATH & IDS_IMG_ICON_POSTING

		' -- render Posting Name
		Call Response.Write("<span class='WBC_styclsTextColor0'>&nbsp;<img border='0' src='" & strPostingIcon & "'> " )
		Call pASPUtils.MBCSWrite("<a " & "href='#' onclick='WBC_onTreeNodeClicked(""" & strURL & """);return false;'>", g_pASPPageManager.CodePage)
		Call pASPUtils.MBCSWrite(pASPUtils.HTMLEncode(pObject.DisplayName), g_pASPPageManager.CodePage)
		Call Response.Write( "</a></span>")
	End Sub

End Class
%>
