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

<%
'************************************************************************************
' File:		/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/PageCreationWizard/
'			TemplateBrowse/TemplateBrowse.asp
' Author:	Microsoft Corporation.
' Purpose:	Display a list of template.  Entry point will be the
'			the TemplateGalleriesBrowse.asp.  Exit pt is authoring page
'
' Query String Parameters:
'
' IDS_QSTR_PAGECREATIONWIZARD_DESTINATIONCHANNEL: The channel in GUID that the new page is going to place into
' IDS_QSTR_PAGECREATIONWIZARD_TEMPLATEGALLERY The Template Gallery in GUID that the new page is going to pick
'                                             the template from
' IDS_QSTR_PAGECREATIONWIZARD_CONNECTEDPAGE: Original page GUID that is chosen to create a connected page
'											 If creation of simple page, this query string will be empty
'*************************************************************************************

' we can only run in unpublished mode
if AutoSession.IsModeUnpublished = false then
	Response.End
end if

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

Dim pASPUtils
Set pASPUtils = g_pASPPageManager.ASPUtilsObject
%>

<!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 template ">
	<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 %>
</head>

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

<form>

<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 Main Header -->
				<tr class="WBC_styclsBackground1">
					<td align=right><img border=0 src="<%=IDS_PATH_IMAGE_LOGO %>"></td>
					<td width=100% valign="middle"  class="WBC_styclsHeaderText">
<%	If (g_pASPPageManager.CreatingConnectedPage) Then %>
						<%= IDS_UI_CREATE_CONNECTED_PAGE %>
<%	Else %>
						<%= IDS_UI_CREATE_SIMPLE_PAGE %>
<%	End If%>
					</td>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
								width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_HEADER_HEIGHT%>" border="0"></td>
				</tr>

				<!-- Show the Sub Header -->
				<tr class="WBC_styclsBackground2">
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="15" height="<%=C_INT_SUBHEAD_HEIGHT%>" border="0"></td>
					<td height="25" class="WBC_styclsSubheadText">
<%	If (g_pASPPageManager.CreatingConnectedPage) Then %>
						<a href='<%=g_pASPPageManager.URLGoBackChannel %>'> <%=IDS_UI_SEL_DESTINATION_CHANNEL %></a>  >  <a href='<%=g_pASPPageManager.URLGoBackGalleries %>'> <%=IDS_UI_SEL_TEMPLATE_GALLERY%></a>  >  <%=IDS_UI_SEL_TEMPLATE %>
<%	Else %>
						<a href='<%=g_pASPPageManager.URLGoBackGalleries %>'> <%=IDS_UI_SEL_TEMPLATE_GALLERY%></a>  >  <%=IDS_UI_SEL_TEMPLATE%>
<%	End If %>
					</td>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="15" 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>


				<!-- Write the status box -->
				<tr>
					<td class="WBC_styclsBackground1">
						<table width="100%" border="0" cellspacing="<%= C_INT_THICK_BORDER %>" cellpadding="5">
							<tr class="WBC_styclsBackground3">
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<!-- No error so we show the status box -->
<%	If (g_pASPPageManager.Error = "") Then

		' Connected Page case, we need to display he page name
		If (g_pASPPageManager.CreatingConnectedPage) Then %>
										<tr>
											<td align='left' valign='top' width='1%' NOWRAP><span class="WBC_styclsHeavyTextColor1"><%=IDS_UI_PAGE_DISPLAY_NAME%></span>&nbsp;&nbsp;</td>
											<td align='left' valign='top'><span class="WBC_styclsTextColor1">
											<%= pASPUtils.MBCSWrite( pASPUtils.HTMLEncode(g_pASPPageManager.CurrentPageNode.DisplayName ), g_pASPPageManager.CodePage)%>
											</span></td>
										</tr>
										<tr>
											<td><span class="WBC_styclsHeavyTextColor1"><%=IDS_UI_PAGE_CHANNEL%></span>&nbsp;&nbsp;</td>
											<td><span class="WBC_styclsTextColor1">
											<%= pASPUtils.MBCSWrite( pASPUtils.HTMLEncode(g_pASPPageManager.CurrentPageNode.Parent.Path), g_pASPPageManager.CodePage)%>
											</span></td>
										</tr>
<%		End If %>
										<tr>
											<td align='left' valign='top' width='1%' NOWRAP><span class="WBC_styclsHeavyTextColor1"><%=IDS_UI_DESTINATION_CHANNEL%></span>&nbsp;&nbsp;</td>
											<td align='left' valign='top' ><span class="WBC_styclsTextColor1">
											<%= pASPUtils.MBCSWrite( pASPUtils.HTMLEncode(g_pASPPageManager.CurrentChannelNode.Path), g_pASPPageManager.CodePage)%>
											</span></td>
										</tr>

										<tr>
											<td><span class="WBC_styclsHeavyTextColor1"><%=IDS_UI_DESTINATION_TEMPLATEGALLERY%></span>&nbsp;&nbsp;</td>
											<td><span class="WBC_styclsTextColor1">
											<%= pASPUtils.MBCSWrite( pASPUtils.HTMLEncode(g_pASPPageManager.CurrentTemplateGalleryNode.Path), g_pASPPageManager.CodePage)%>
											</span></td>
										</tr>
	<!-- We have some sort of error, but we need to chk for each one --->
<%	ElseIf (g_pASPPageManager.Error = IDS_UI_ERR_PAGE_NOT_FOUND ) Then %>
										<tr>
											<td align='left' valign='top' width='1%' NOWRAP><span class="WBC_styclsHeavyTextColor1"><%=IDS_UI_PAGE_DISPLAY_NAME%></span>&nbsp;&nbsp;</td>
											<td align='left' valign='top' ><span class="WBC_styclsTextColor1"><%=IDS_UI_ERR_PAGE_NOT_FOUND%></span></td>
										</tr>

<%	ElseIf (g_pASPPageManager.Error = IDS_UI_ERR_CHANNEL_NOT_FOUND ) Then %>
										<tr>
											<td align='left' valign='top' width='1%' NOWRAP><span class="WBC_styclsHeavyTextColor1"><%=IDS_UI_DESTINATION_CHANNEL%></span>&nbsp;&nbsp;</td>
											<td align='left' valign='top' ><span class="WBC_styclsTextColor1"><%=IDS_UI_ERR_CHANNEL_NOT_FOUND%></span></td>
										</tr>
<%	ElseIf (g_pASPPageManager.Error = IDS_UI_ERR_TEMPLATE_GALLERY_NOT_FOUND ) Then %>
										<tr>
											<td align='left' valign='top' width='1%' NOWRAP><span class="WBC_styclsHeavyTextColor1"><%=IDS_UI_DESTINATION_TEMPLATEGALLERY%></span>&nbsp;&nbsp;</td>
											<td align='left' valign='top' ><span class="WBC_styclsTextColor1"><%=IDS_UI_ERR_TEMPLATE_GALLERY_NOT_FOUND%></span></td>
										</tr>
<%	End If %>
									</table>
								</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>

	<!-- No Errors so we can show the details of the template  -->
<%	If (g_pASPPageManager.Error = "") Then %>


				<!-- 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.GridStartItem %> - <%= g_pASPPageManager.GridEndItem %>  </b><%=IDS_UI_OF%> <b><%= g_pASPPageManager.Templates.Count %></b>
								</td>
								<td width=50% align=right class="WBC_styclsTextColor0">
									<%=IDS_UI_ITEMS_PER_PAGE%>&nbsp;
									<% Call g_pASPPageManager.GridPagingConfigControl.DisplayPagingConfigControl() %>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td><img src="<%=IDS_TRANSPARENT_GIF%>"
							width="15" height="<%=C_INT_XSMALL_SPACING%>" border="0"></td>
				</tr>


				<!-- Display Separator -->
				<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>


				<tr>
					<td>
						<%
							Call g_pASPPageManager.GridControlForDisplay.DisplayGrid()
						%>
					</td>
				</tr>

<%  End If  %>
			</table>
		</td>
	</tr>

</table>

	<!--No Errors so we can show the paging links  -->
<%	If (g_pASPPageManager.Error = "") Then %>
	<table height="10%" width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr valign=top>
			<td align=center class="WBC_styclsTextColor0">
				<%	Call g_pASPPageManager.GridPagingControl.DisplayPagingLinks %>
			</td>
		</tr>
	</table>

<%	End If %>

</form>


</body>

</html>
