<%--
/**
 * 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="/panel_category/init.jsp" %>

<c:if test="<%= showBody %>">
	<liferay-application-list:panel-category-body
		panelApps="<%= panelApps %>"
		panelCategory="<%= panelCategory %>"
	/>
</c:if>

<c:if test="<%= !panelApps.isEmpty() && showHeader %>">
		</div>
	</div>

	<c:if test="<%= persistState %>">
		<aui:script position="auto">
			Liferay.on('liferay.collapse.hidden', function (event) {
				var panelId = event.panel.getAttribute('id');

				if (panelId === '<%= id %>') {
					Liferay.Util.Session.set(
						'<%= PanelCategory.class.getName() %><%= id %>',
						'closed'
					);
				}
			});

			Liferay.on('liferay.collapse.shown', function (event) {
				var panelId = event.panel.getAttribute('id');

				if (panelId === '<%= id %>') {
					Liferay.Util.Session.set(
						'<%= PanelCategory.class.getName() %><%= id %>',
						'open'
					);
				}
			});
		</aui:script>
	</c:if>
</c:if>