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

<%
' *****************************************************************************
' File:		/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/
'			PageOperation/AuthoringMode/PageSave/NewPageSave/
'			NewPageSave.asp
'
' Author:	Microsoft Corporation.
' Purpose:	Process the saving of the placeholder
'
' Query String Parameters:
'	IDS_QSTR_PAGEOPERATIONAUTHORING_CONTINUEAUTHORING: Indicate what is the return URL mode
' ************************************************************************

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

%>

<!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 saving of a posting">
<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>

<form name="NC_NewAuthoringSave"
	  action=""
	  method="post"
	  enctype="multipart/form-data"
	  onsubmit="return false;">

<%	If (g_pASPPageManager.ErrorString() <> IDS_E_NO_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_CREATE_NEW_PAGE %>
			</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">
				<%= IDS_UI_SAVING_A_PAGE %>
			</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>

		<!-- Display the fact that there is an error -->
		<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_ERROR %>:</span>&nbsp;&nbsp;
<%		If g_pASPPageManager.ErrorString() = IDS_E_PAGE_DOES_NOT_EXIST Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_PAGE_DOES_NOT_EXIST %></span>

<%		ElseIf g_pASPPageManager.ErrorString() = IDS_E_ERR_SOURCE_PAGE_NOT_FOUND Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_SOURCE_PAGE_NOT_FOUND %></span>

<%		ElseIf g_pASPPageManager.ErrorString() = IDS_E_ERR_IN_PAGE_CREATION Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_IN_PAGE_CREATION %></span>

<%		ElseIf g_pASPPageManager.ErrorString() = IDS_E_ERR_IN_PAGE_UPDATE Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_IN_PAGE_UPDATE %></span>

<%		Else %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_UNKNOWN %></span>

<%		End If %>

						</td>
					</tr>
					<tr class="WBC_styclsBackground2">
						<td>
							<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERROR_DESCRIPTION %>:</span>&nbsp;&nbsp;
							<span class="WBC_styclsTextColor1"><%= AutoSession.LastError.Description %></span>
						</td>
					</tr>
					<tr class="WBC_styclsBackground2">
						<td>
							<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERROR_DETAILS %>:</span>&nbsp;&nbsp;
							<span class="WBC_styclsTextColor1"><%= AutoSession.LastError.InternalDetails %></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>
		<tr>
			<td colspan=3><%= IDS_UI_PLEASE_TRY_AGAIN %></td>
		</tr>
		<tr>
			<td colspan=3>
				<li>
					<a target="_self" href="#" onclick="WBC_submitForm('NC_NewAuthoringSave', '<%= g_pASPPageManager.URLRetrySaveLink %>'); return false">
					<%=IDS_UI_SAVE_AGAIN%> </a>
				</li>

				<li>
					<a target="_self" href="#" onclick="WBC_submitForm('NC_NewAuthoringSave', '<%= g_pASPPageManager.URLEditAgainLink %>'); return false">
					<%=IDS_UI_RESUME_EDIT%> </a>
				</li>

				<li>
					<a target="_top" href="<%=g_pASPPageManager.URLCancelEditLink%>">
					<%=IDS_UI_CANCEL_EDIT%> </a>
				</li>


		  <%Call g_pASPPageManager.GenerateRoundTripFormElementsForReSubmit()%>
			</td>
		</tr>
	</table>

<%	  Else

			If (g_pASPPageManager.ContinueToAuthoring) Then
				'No error encountered after creating the posting and updating it, so we
				'chk for filtering msg box and return user back to the editing mode
				If (Not g_pASPPageManager.HookFailed) Then
					If(g_pASPPageManager.ShowWarningReport) Then%>
					<script language="JavaScript" type="text/javascript">
					<!--
						alert(IDS_CONTENT_STRIPPED)
						window.top.location =  '<%= g_pASPPageManager.URLGoToAuthoringMode %>'
					// -->
					</script>
<%					Else
						call ServerSideRedirect(g_pASPPageManager.URLGoToAuthoringMode)
					End If
				Else
					' Note: Depending on which part of the hook failed,
					'		 the URLGoToAuthoringMode is going to be based on
					'        the virtual node / real physical node%>
					<script language="JavaScript" type="text/javascript">
					<!--
						window.top.location =  '<%= g_pASPPageManager.URLGoToAuthoringMode %>'
					// -->
					</script>
				<%
				End If  'Continue Authoring = true
			Else
				If ( Not g_pASPPageManager.HookFailed) Then
				'No error occur but user has requested not to go back to Authoring.
					If (g_pASPPageManager.ShowWarningReport) Then%>
					<script language="JavaScript" type="text/javascript">
					<!--
						alert(IDS_CONTENT_STRIPPED)
						window.top.location =  '<%= g_pASPPageManager.URLGoToEditMode %>'
					// -->
					</script>
<%					Else
						call ServerSideRedirect(g_pASPPageManager.URLGoToEditMode)
					End If
				Else
					' Note: Depending on which part of the hook failed,
					'		 the URLGoToAuthoringMode is going to be based on
					'        the virtual node / real physical node %>
					<script language="JavaScript" type="text/javascript">
					<!--
						window.top.location =  '<%= g_pASPPageManager.URLGoToEditMode %>'
					// -->
					</script>
<%				End If 'Hook failed = true
			End If 'Continue Authoring = false
	  End If %>

</form>

</body>
</html>
