<%
' ********************************************************************
' 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/ResourceBrowser/Management
'				CNCListRenderer_ResourcesBrowse.inc
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
' Purpose:	Responsible for Displaying Content Management Server hierarchy tree
'
' Implement NCLCRenderer Interface:
'	- Sub RenderSubdivisionHeadTDAttrib( nSubdivisionIndex )
'	- Sub RenderSubdivisionHeadTDContent( nSubdivisionIndex )
'	- Sub RenderItemTDAttrib( pObject, nCollectionIndex, nDisplayIndex, nSubdivisionIndex )
'	- Sub RenderItemTDContent( pObject, nCollectionIndex, nDisplayIndex, nSubdivisionIndex )
' ********************************************************************



Class CNCListRenderer_ResourcesBrowse

	' ---- [Public]
	Public Sub RenderSubdivisionHeadTDAttrib( nSubdivisionIndex )
	End Sub

	' ---- [Public]
	Public Sub RenderSubdivisionHeadTDContent( nSubdivisionIndex )
		Response.Write( "</font></b>" )
	End Sub

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

	' ---- [Public]
	Public Sub RenderItemTDContent( pObject, nCollectionIndex, nDisplayIndex, nSubdivisionIndex )
		Dim strImgURL

		Dim pASPUtils
		Set pASPUtils = GetInitializedASPUtils()
		Dim lCodePage
		lCodePage = GetCodePageForResource(g_pASPPageManager.ResourceGallery, pASPUtils)

		Response.write("<table border=0 width=100% cellpadding=0 cellspacing=5><tr>")

		' -- render the checkbox for Delete
		Response.write("<td valign=top width=20>")
		If pObject.CanDelete then
			g_pASPPageManager.EnableDeleteButton = true
			Response.write("<input type='checkbox' name='NC_Resource' " & _
					   "value=""" & pObject.GUID & """>")
			Response.write("<input type='hidden' name='NC_" & pObject.GUID & "'" & "value=""" )
			Call pASPUtils.MBCSWrite(pASPUtils.HTMLEncode(pObject.DisplayName), lCodePage)
			Call Response.write("""" & ">")
		Else
			strImgURL = IDS_RESOURCEBROWSER_IMG_PATH & IDS_IMG_ICON_INACTIVE_CHECKBOX
			Response.write("<name='NC_DummyImg'>  <img alt='" & IDS_UI_TOOLTIP_NORIGHTS_DELETE & "' src='" & strImgURL & "' border='0'>" )
		End If
		Response.write("</td>")

		' -- rendering the Thumbnail and magnifying glass
		Response.write("<td align=center valign=top width=138>")

		Response.write("<a href='#' onClick='WBC_openWindowOnFocus(""" & pObject.Url & """,IDS_WIN_PREVIEW, WBC_getPoppedUpWindowFeatures(IDS_WIN_PREVIEW_FEATURES, window.top));")
		Response.write("return false;'>")

		Response.write("<img src='" & pObject.URLThumbnail & "'" & "alt='")
		Call pASPUtils.MBCSWrite(pASPUtils.HTMLEncode(pObject.DisplayName), lCodePage)
		Response.write("' border='0'></a></td>")

		' -- render the DisplayName and Size
		Response.write("<td><table border=0 cellpadding=0 cellspacing=0><tr>")
		Response.write("<td>")

		Response.write("<a href='#' onClick='WBC_openWindowOnFocus(""" & pObject.Url & """,IDS_WIN_PREVIEW, WBC_getPoppedUpWindowFeatures(IDS_WIN_PREVIEW_FEATURES, window.top));")
		Response.write("return false;'>")

		Response.write("<img alt='" & IDS_UI_TOOLTIP_PREVIEW & "' border='0' src='" & IDS_RESOURCEBROWSER_IMG_PATH & IDS_IMG_ICON_PREVIEW & "'></a>")
		Response.write("&nbsp;<span class='WBC_styclsTextColor0'>")
		Call pASPUtils.MBCSWrite( pASPUtils.HTMLEncode(pObject.DisplayName), lCodePage )
		Response.write( "</span>&nbsp;&nbsp;")
		Response.write( "<span class='WBC_styclsSmallTextColor0'>" & RoundUp(pObject.Size / 1024) & "k" & "</span></td></tr>" )

		' -- render spacing before Last Modified Date row
		Response.write("<tr><td height=5><img border=0 src='" & IDS_TRANSPARENT_GIF & "'></td></tr>")

		' -- render the LastModifiedDate
		Response.write("<tr><td class='WBC_styclsSmallTextColor0'><nobr>")
		Response.write(IDS_UI_LABEL_LASTMOD & ": ")
%>
		<script language="JavaScript" type="text/javascript">
		<!--
			WBC_writeUTC2Local("<%= FormatDate(pObject.LastModifiedDate) %>");
		// -->
		</script>
<%
		Response.write("</nobr></td></tr>")

		' -- render spacing before Replace and Properties icon
		Response.write("<tr><td height=10><img border=0 src='" & IDS_TRANSPARENT_GIF & "'></td></tr>")

		' -- render the Replace, and Properties icon links
		Dim strReplaceURL
		strReplaceURL = "../ResourceReplace/ResourceReplace.asp?" & IDS_QPARAM_RESOURCE & "=" & pObject.GUID

		Response.write("<tr><td><nobr>")
		If pObject.CanSetContent then
			Response.write("<a href='#' onclick='WBC_openWindowOnFocus(""" & strReplaceURL & """")
			Response.write(", IDS_WIN_RESREPLACE_NAME, IDS_WIN_RESREPLACE_FEATURES" & ");")
			Response.write("return false;'>")

			Response.write( "<img border=0 alt='" & IDS_UI_TOOLTIP_REPLACE & "' src='" & IDS_RESOURCEBROWSER_IMG_PATH & IDS_IMG_ICON_REPLACE_LINK & "'>")
			Response.write( "</a>")
		Else
			Response.write( "<img border=0 alt='" & IDS_UI_TOOLTIP_NORIGHTS_REPLACE & "' src='" & IDS_RESOURCEBROWSER_IMG_PATH & IDS_IMG_ICON_REPLACE_LINK & "'>")
		End If

		Response.write("&nbsp;&nbsp;")

		Dim strPropertiesURL
		strPropertiesURL = "../ResourceProperties/ResourcePropertiesShow.asp?" & IDS_QPARAM_RESOURCE & "=" & pObject.GUID

		Response.write("<a href='#' onclick='WBC_openWindowOnFocus(""" & strPropertiesURL & """")
		Response.write(", IDS_WIN_RESPROPS_NAME, IDS_WIN_RESPROPS_FEATURES" & ");")
		Response.write("return false;'>" & "<img border=0 alt='" & IDS_UI_TOOLTIP_PROPERTIES & "' src='" & IDS_RESOURCEBROWSER_IMG_PATH & IDS_IMG_ICON_PROPERTIES & "'></a>")

		Response.write("</nobr></td></tr></table>")


		Response.write("</tr></table>")

	 End Sub

End Class

%>