<!--#include file="CNCASPPageManager_ResourcesBrowse.inc" -->

<%
' ************************************************************************
' File:		/NR/System/WBC/PopUp/Cross-Browser/ResourceBrowser/Management/
'				ResourceGallery.asp
' Author:	Microsoft Corporation.
' Purpose:	Display list of resources in a Gallery for user to perform CRUD
'			operations on the resources.
'
' Query String Parameters:
'   IDS_QPARAM_GALLERY_GUID: Specifies Resource Gallery to list resources
'	IDS_QPARAM_PAGESTATUS: This is used to tell ResourceGallery Page that a delete has happened. Valid value is
'                          IDS_PAGESTATUS_AFTDELETE
'	IDS_QPARAM_TIMESTAMP:  This is used for make sure ResourceGallery Page is unique.
' ************************************************************************

' ---- Initialize the ASPPageManager
Dim g_pASPPageManager
Set g_pASPPageManager = New CNCASPPageManager_ResourcesBrowse
Call g_pASPPageManager.InitManager()

Dim pASPUtils
Set pASPUtils = g_pASPPageManager.ASPUtils
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta name="Author" content="Microsoft Corporation.">
<meta name="Description" content="Display a list of resource gallery items for user to view/edit">
<meta name="robots" content="NOINDEX,NOFOLLOW">
<meta http-equiv="Content-Type" content="text/html;charset=<%= g_pASPPageManager.Charset %>">
<title><%= IDS_UI_BROWSER_TITLE %></title>
<% Call EmbedWBCHeadSection %>

<script language="JavaScript"
		type="text/javascript">
<!--
	// ---- [Public] To refresh the current page
	function WBC_refreshResourcesListWindow()
	{
		window.top.location = '<%= g_pASPPageManager.URLRefreshPage %>';
	}
// -->
</script>

<script language="JavaScript"
		src="/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/ResourceBrowser/Management/ResourceGalleryProcess.js"
		type="text/javascript"></script>
</head>

<body <%= IDS_BODYSETTING %> class="WBC_styclsTextColor0">

<form name="WBC_ResourceGalleryForm" action="ResourceDelete.asp?<%=URLEncodedQueryString()%>" method="post"  enctype="multipart/form-data">

<!--
	WARNING:
	========
	For the following HTML that has <td><img src=...></td>,
	do NOT break them into separate lines as it will alter
	the layout of the rendered page
-->

<table height="90%" width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr valign="top">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<!-- Show the Top Title -->
				<tr class="WBC_styclsBackground1">
					<td align=right><img border=0 src="<%=IDS_PATH_IMAGE_LOGO %>"></td>
					<td width=100% valign="middle"  class="WBC_styclsHeaderText">
						<%= IDS_UI_RESOURCE_MANAGER %>
					</td>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
								width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_HEADER_HEIGHT%>" border="0"></td>
				</tr>

				<!-- Show the breadcrumb trail -->
				<tr class="WBC_styclsBackground2">
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_SUBHEAD_HEIGHT%>" border="0"></td>
					<td class="WBC_styclsSubheadText">
						<a href='<%= g_pASPPageManager.URLGoBackLink %>'><%= IDS_UI_SEL_RESOURCE_GALLERY %></a> > <%= IDS_UI_MANAGE_RESOURCES %>
					</td>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_SUBHEAD_HEIGHT%>" border="0"></td>
				</tr>
				<tr>
					<td colspan=3><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
				</tr>

				<!-- Set the margin width for the rest of the page -->
				<tr>
					<td rowspan="999"><img src="<%=IDS_TRANSPARENT_GIF%>"
								width="<%= C_INT_MAIN_MARGIN %>" height="1" border="0"></td>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
								width="100%" height="1" border="0"></td>
					<td rowspan="999"><img src="<%=IDS_TRANSPARENT_GIF%>"
								width="<%= C_INT_MAIN_MARGIN %>" height="1" border="0"></td>
				</tr>

<%	If (g_pASPPageManager.Error = IDS_ERR_GALLERY_NOT_FOUND) Then %>

				<!-- Display the fact that ResourceGallery Is Nothing -->
				<tr>
					<td class="WBC_styclsBackground1">
						<table width="100%" border="0" cellspacing="<%= C_INT_THICK_BORDER %>" cellpadding="5">
							<tr class="WBC_styclsBackground3">
								<td>
									<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_RESOURCE_GALLERY %>:</span>&nbsp;&nbsp;
									<span class="WBC_styclsTextColor1"><%= IDS_UI_GALLERY_NOT_FOUND %></span>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan=3><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
				</tr>

<%	Else %>

				<!-- Show area displaying info about current object -->
				<tr>
					<td class="WBC_styclsBackground1">
						<table width="100%" border="0" cellspacing="<%= C_INT_THICK_BORDER %>" cellpadding="5">
							<tr class="WBC_styclsBackground3">
								<td>
									<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_RESOURCE_GALLERY %>:</span>&nbsp;&nbsp;
									<span class="WBC_styclsTextColor1"><%= pASPUtils.MBCSWrite( pASPUtils.HTMLEncode( g_pASPPageManager.ResourceGallery.Path ), g_pASPPageManager.CodePage ) %></span>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan=3><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
				</tr>


			<!-- Show the "View as Thumbnail" or "View As List" link -->
				<tr>
					<td colspan=3 class="WBC_styclsTextColor0"><% Call g_pASPPageManager.ViewStateControl.DisplayStateControl() %></td>
				</tr>

				<tr>
					<td colspan=3><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
				</tr>


				<!-- Display info about subset being shown and the PagingConfigControl -->
				<tr>
					<td width="100%" align="right">
						<table width=100% border=0 cellspacing=0 cellpadding=0>
							<tr>
								<td width=50% align=left  class="WBC_styclsTextColor0">
									<%=  IDS_UI_ITEMS  %> <b> <%= g_pASPPageManager.StartItem %> - <%= g_pASPPageManager.EndItem %>  </b><%=IDS_UI_OF%> <b><%= g_pASPPageManager.Resources.Count%></b>
								</td>
								<td width=50% align=right class="WBC_styclsTextColor0">
									<%=IDS_UI_ITEMS_PER_PAGE%>&nbsp;
									<% Call g_pASPPageManager.PagingConfigControl.DisplayPagingConfigControl() %>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
							width="15" height="<%=C_INT_XSMALL_SPACING%>" border="0"></td>
				</tr>
				<tr>
					<td class="WBC_styclsBackground1"><img src="<%=IDS_TRANSPARENT_GIF%>"
																	width="15" height="<%=C_INT_SEPARATOR_HEIGHT%>"></td>
				</tr>
				<tr>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
							width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
				</tr>


				<!-- If current view is Thumbnail, show the sorting links as well -->
				<% If (g_pASPPageManager.ViewStateControl.CurrentState = IDS_STATE_VIEWAS_THUMBNAIL) Then %>
				<tr>
					<td>
						<table border=0 cellpadding=0 cellspacing=0>
							<tr>
								<td class="WBC_styclsTextColor0"><%=IDS_UI_SORT_BY%></td>
								<td class="WBC_styclsTextColor0"><% Call g_pASPPageManager.GridControlForThumbnailSort.DisplayGrid() %></td>
							</tr>
						</table>
					</td>
				</tr>
				<% End If %>

				<tr>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>" width="15" height="<%=C_INT_MINOR_SPACING%>"></td>
				</tr>

				<!-- Show the list of objects ("View As List" or "View As Thumbnail") -->
				<tr>
					<td>
					<%
						If (g_pASPPageManager.ViewStateControl.CurrentState = IDS_STATE_VIEWAS_LIST) Then
							Call g_pASPPageManager.GridControlForViewAsList.DisplayGrid()
						Else
							Call g_pASPPageManager.ListControlForViewAsThumbnail.DisplayList()
						End If
					%>
					</td>
				</tr>
				<tr>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>" width="15" height="<%=C_INT_MINOR_SPACING%>"></td>
				</tr>

				<!--Show the Check All and Clear All Buttons -->
				<tr>
					<td class="WBC_styclsSmallTextColor0">
						<a href="#" onclick="WBC_checkAllResource(true);return false">Check All</a>
						&nbsp;
						<a href="#" onclick="WBC_checkAllResource(false);return false">Clear All</a>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>

				<tr>
					<td>
						<!-- Show the "Delete Checked" button -->
						<%	If (g_pASPPageManager.EnableDeleteButton = True) Then %>
								<!--- Show the delete button ---->
								<a target="_self" href="#" onclick="WBC_procsCheckingAndSubmit('WBC_ResourceGalleryForm', '<%= g_pASPPageManager.URLDeleteButton %>');return false">
								<img src="<%=IDS_RESOURCEBROWSER_IMG_PATH%><%=IDS_IMG_BTN_DELETE%>" name="NCRes_Delete" border="0" alt="<%=IDS_UI_TOOLTIP_DELETE%>"></a>
						<%	Else %>
								<img src="<%=IDS_RESOURCEBROWSER_IMG_PATH%><%=IDS_IMG_BTN_DELETE%>" name="NCRes_Delete" border="0" alt="<%=IDS_UI_TOOLTIP_DELETE%>"></a>
						<%	End If %>
						&nbsp;&nbsp;
						<!-- Show the "Add New..." button -->
						<%	If (g_pASPPageManager.ResourceGallery.CanCreateResources = True) Then %>
								<a href='#' onclick="WBC_openWindowOnFocus('<%= g_pASPPageManager.URLAddButton %>', IDS_WIN_RESCREATE_NAME, IDS_WIN_RESCREATE_FEATURES); return false">
											<img src="<%=IDS_RESOURCEBROWSER_IMG_PATH%><%=IDS_IMG_BTN_ADD_NEW_RESOURCE%>" border="0" alt="<%=IDS_UI_TOOLTIP_ADD%>"></a>
						<%	Else %>
								<img src="<%=IDS_RESOURCEBROWSER_IMG_PATH%><%=IDS_IMG_BTN_ADD_NEW_RESOURCE%>" border="0" alt="<%=IDS_UI_TOOLTIP_ADD%>">
						<%	End If %>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>

<%	End If %>

			</table>
		</td>
	</tr>
</table>


<%	If (g_pASPPageManager.Error = "") Then %>

<table height="10%" width="100%" border="0" cellspacing="0" cellpadding="0">
	<!--- Show the paging index link ---->
	<tr valign="top">
		<td align=center class="WBC_styclsTextColor0">
			<% Call g_pASPPageManager.PagingControl.DisplayPagingLinks() %>
		</td>
	</tr>
</table>

<%	End If %>



</form>
</div>

</body>



</html>