All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.display.content_root_selector.jsp Maven / Gradle / Ivy

The newest version!
<%--
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */
--%>

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

<%
KBArticle kbArticle = (KBArticle)request.getAttribute(KBWebKeys.KNOWLEDGE_BASE_KB_ARTICLE);

KBNavigationDisplayContext kbNavigationDisplayContext = (KBNavigationDisplayContext)request.getAttribute(KBWebKeys.KNOWLEDGE_BASE_KB_NAVIGATION_DISPLAY_CONTEXT);

String currentKBFolderURLTitle = kbNavigationDisplayContext.getCurrentKBFolderURLTitle();

long rootResourcePrimKey = kbDisplayPortletInstanceConfiguration.resourcePrimKey();

long rootKBFolderId = KBFolderConstants.DEFAULT_PARENT_FOLDER_ID;
String rootKBFolderName = LanguageUtil.get(resourceBundle, "home");
String rootKBFolderURLTitle = StringPool.BLANK;

if (rootResourcePrimKey != KBFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
	KBFolder rootKBFolder = KBFolderServiceUtil.getKBFolder(rootResourcePrimKey);

	rootKBFolderId = rootKBFolder.getKbFolderId();
	rootKBFolderName = rootKBFolder.getName();
	rootKBFolderURLTitle = rootKBFolder.getUrlTitle();
}

List kbFolders = KBUtil.getAlternateRootKBFolders(scopeGroupId, kbDisplayPortletInstanceConfiguration.resourcePrimKey());
%>


	
		
	


<%= HtmlUtil.escape(kbDisplayPortletInstanceConfiguration.contentRootPrefix() + " " + rootKBFolderName) %> <% for (KBFolder kbFolder : kbFolders) { %> <%= HtmlUtil.escape(kbDisplayPortletInstanceConfiguration.contentRootPrefix() + " " + kbFolder.getName()) %> <% } %>
var form = document.getElementById( 'updateRootKBFolderIdFm' ); if (form) { document .getElementById('rootKBFolderId') .addEventListener('change', () => { form.submit(); }); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy