<%--
/**
 * 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.
 *
 *
 *
 */
--%>

<liferay-portlet:renderURL portletName="<%= CPPortletKeys.CP_SPECIFICATION_OPTIONS %>" varImpl="viewProductSpecificationOptionsURL">
	<portlet:param name="mvcPath" value="/view_specification_options.jsp" />
	<portlet:param name="specificationNavbarItemKey" value="specification-labels" />
</liferay-portlet:renderURL>

<liferay-portlet:renderURL portletName="<%= CPPortletKeys.CP_SPECIFICATION_OPTIONS %>" varImpl="viewProductOptionCategoriesURL">
	<portlet:param name="mvcRenderCommandName" value="/cp_specification_options/view_cp_option_categories" />
	<portlet:param name="specificationNavbarItemKey" value="specification-groups" />
</liferay-portlet:renderURL>

<%
List<NavigationItem> navigationItems = new ArrayList<>();

if (PortletPermissionUtil.contains(permissionChecker, CPPortletKeys.CP_SPECIFICATION_OPTIONS, ActionKeys.VIEW)) {
	NavigationItem cpSpecificationOptionsNavigationItem = new NavigationItem();

	cpSpecificationOptionsNavigationItem.setActive(specificationNavbarItemKey.equals("specification-labels"));
	cpSpecificationOptionsNavigationItem.setHref(viewProductSpecificationOptionsURL.toString());
	cpSpecificationOptionsNavigationItem.setLabel(LanguageUtil.get(request, "specification-labels"));

	navigationItems.add(cpSpecificationOptionsNavigationItem);
}

if (PortletPermissionUtil.contains(permissionChecker, CPPortletKeys.CP_OPTIONS, ActionKeys.VIEW)) {
	NavigationItem cpOptionCategoriesNavigationItem = new NavigationItem();

	cpOptionCategoriesNavigationItem.setActive(specificationNavbarItemKey.equals("specification-groups"));
	cpOptionCategoriesNavigationItem.setHref(viewProductOptionCategoriesURL.toString());
	cpOptionCategoriesNavigationItem.setLabel(LanguageUtil.get(request, "specification-groups"));

	navigationItems.add(cpOptionCategoriesNavigationItem);
}
%>

<clay:navigation-bar
	inverted="<%= false %>"
	navigationItems="<%= navigationItems %>"
/>