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

<%
' *****************************************************************************
' File:		/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/
'			ResourceBrowser/Management/ResourceReplace/
'			ResourceReplaceAcceptor.asp
'
' Author:	Microsoft Corporation.
' Purpose:	Process the uploading of the resource file.  There will be a file
'			read, then replace the resource based on the filename.
'
' Query String Parameters:
'			IDS_QPARAM_RESOURCE: The GUID of resource to be replaced
'
' Form Field Names:
'			IDS_FORM_RESOURCE_DESCRIPTION: Description of the resource
'			IDS_FORM_RESOURCE_DISPLAY_NAME: Display name of resource
'			IDS_FORM_RESOURCE_NAME: The resource file
' ************************************************************************

' ---- Initialize the ASPPageManager
Dim g_pASPPageManager
Set g_pASPPageManager = New CNCASPPageManager_ResourceReplaceAcceptor
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="Process the upload and replace the resource contents">
<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 %>>


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

<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.URLBack2ResourceReplaceLink %>"><%= IDS_UI_RESOURCE_REPLACE %></a> >
			<%= IDS_UI_RESOURCE_REPLACE_FAILURE %>
		</td>
		<td><img src="<%=IDS_TRANSPARENT_GIF%>"
			width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_SUBHEAD_HEIGHT%>" border="0"></td>
	</tr>
	<tr>
		<td><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_RESOURCE_NOT_FOUND) Then %>

		<!-- Display the fact that Resource Is Nothing -->
		<tr>
			<td class="WBC_styclsBackground1">
				<table width="100%" border="0" cellspacing="<%= C_INT_THICK_BORDER %>" cellpadding="5">
					<tr class="WBC_styclsBackground2">
						<td>
							<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_RESOURCE %>:</span>&nbsp;&nbsp;
							<span class="WBC_styclsTextColor1"><%= IDS_UI_RESOURCE_NOT_FOUND %></span>
						</td>
					</tr>
				</table>
			</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_styclsBackground2">
						<td>
							<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_RESOURCE %>:</span>&nbsp;&nbsp;
							<span class="WBC_styclsTextColor1">
								<%
									Call pASPUtils.MBCSWrite( pASPUtils.HTMLEncode(g_pASPPageManager.Resource.Parent.Path), g_pASPPageManager.CodePage)
									Call pASPUtils.MBCSWrite( pASPUtils.HTMLEncode(g_pASPPageManager.Resource.DisplayName), g_pASPPageManager.CodePage)
								%>
							</span>
						</td>
					</tr>
				</table>
			</td>
		</tr>

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

		<!-- Show the Content area -->
		<tr>
			<td valign="top" class="WBC_styclsBackground1">
				<table width="100%" border="0" cellspacing="2" cellpadding="5" >
					<tr class="WBC_styclsBackground2">
						<td valign="top" >
							<table width="100%" border="0" cellspacing="0" cellpadding="5" >

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

								<!-- Render FileUpload Error Description (Err.Description) -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_INIT_FORMREADER %></td>
									<td class="WBC_styclsTextColor1"><%= Err.Description %>&nbsp;</td>
								</tr>

							<%	ElseIf (g_pASPPageManager.Error = IDS_ERR_FILE_UPLOAD) Then %>

								<!-- Render FileUpload Error Description (Err.Description) -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_FILE_UPLOAD %></td>
									<td class="WBC_styclsTextColor1"><%= Err.Description %>&nbsp;</td>
								</tr>

							<%	ElseIf (g_pASPPageManager.Error = IDS_ERR_RESOURCE_SETCONTENT) Then %>

								<!-- Render Resource.SetContent Error Description -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_RESOURCE_SETCONTENT %></td>
									<td class="WBC_styclsTextColor1"><%= AutoSession.LastError.Description %>&nbsp;</td>
								</tr>

								<!-- Render Resource.SetContent Error Detailed Description -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_DETAILED_ERROR_DESCRIPTION %></td>
									<td class="WBC_styclsTextColor1"><%= AutoSession.LastError.InternalDetails %>&nbsp;</td>
								</tr>

							<%	ElseIf (g_pASPPageManager.Error = IDS_ERR_RESOURCE_SETPROPS) Then %>

								<!-- Render Resource SetProperties Error Description -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_RESOURCE_SETPROPS %></td>
									<td class="WBC_styclsTextColor1"><%= AutoSession.LastError.Description %>&nbsp;</td>
								</tr>

								<!-- Render Resource SetProperties Error Detailed Description -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_DETAILED_ERROR_DESCRIPTION %></td>
									<td class="WBC_styclsTextColor1"><%= AutoSession.LastError.InternalDetails %>&nbsp;</td>
								</tr>

							<%	ElseIf (g_pASPPageManager.Error = IDS_ERR_FILE_CLEANUP) Then %>

								<!-- Render FileUpload Error Description (Err.Description) -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_FILE_CLEANUP %></td>
									<td class="WBC_styclsTextColor1"><%= Err.Description %>&nbsp;</td>
								</tr>

							<%	End If %>

								<tr>
									<td colspan="2">&nbsp;</td>
								</tr>

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

	<%	End If %>


</table>

<%	Else %>

	<script language="JavaScript" type="text/javascript">
	<!--
		// refresh the main resource list window and close the Replace dialog itself

		if (!WBC_isOpenerWindowClosed())
		{
			window.opener.WBC_refreshResourcesListWindow();
		}
		window.close();

		// -->
	</script>

<%	End If %>

</body>

</html>