<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/init.jsp" %>

<%
String tabs2 = ParamUtil.getString(request, "tabs2", "export");

String returnToFullPageURL = ParamUtil.getString(request, "returnToFullPageURL");

PortletURL portletURL = PortletURLBuilder.createRenderURL(
	renderResponse
).setMVCRenderCommandName(
	"/export_import/export_import"
).setRedirect(
	ParamUtil.getString(request, "redirect")
).setPortletResource(
	portletResource
).setParameter(
	"returnToFullPageURL", returnToFullPageURL
).buildPortletURL();
%>

<c:choose>
	<c:when test="<%= !GroupPermissionUtil.contains(permissionChecker, themeDisplay.getScopeGroup(), ActionKeys.MANAGE_STAGING) %>">
		<div class="alert alert-info">
			<liferay-ui:message key="you-do-not-have-permission-to-access-the-requested-resource" />
		</div>
	</c:when>
	<c:otherwise>
		<clay:navigation-bar
			navigationItems='<%=
				new JSPNavigationItemList(pageContext) {
					{
						portletURL.setParameter("tabs2", "export");

						add(
							navigationItem -> {
								navigationItem.setActive(tabs2.equals("export"));
								navigationItem.setHref(portletURL.toString());
								navigationItem.setLabel(LanguageUtil.get(httpServletRequest, "export"));
							});

						portletURL.setParameter("tabs2", "import");

						add(
							navigationItem -> {
								navigationItem.setActive(tabs2.equals("import"));
								navigationItem.setHref(portletURL.toString());
								navigationItem.setLabel(LanguageUtil.get(httpServletRequest, "import"));
							});
					}
				}
			%>'
		/>

		<div class="portlet-export-import-container" id="<portlet:namespace />exportImportPortletContainer">
			<liferay-util:include page="/export_import_error.jsp" servletContext="<%= application %>" />

			<c:choose>
				<c:when test='<%= tabs2.equals("export") %>'>
					<liferay-util:include page="/export_portlet.jsp" servletContext="<%= application %>" />
				</c:when>
				<c:when test='<%= tabs2.equals("import") %>'>
					<liferay-util:include page="/import_portlet.jsp" servletContext="<%= application %>" />
				</c:when>
			</c:choose>
		</div>
	</c:otherwise>
</c:choose>