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

META-INF.resources.admin.common.attachments.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="/admin/common/init.jsp" %>

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

resourcePrimKey = BeanParamUtil.getLong(kbArticle, request, "resourcePrimKey");

List attachmentsFileEntries = new ArrayList();

if (kbArticle != null) {
	attachmentsFileEntries = kbArticle.getAttachmentsFileEntries();
}
%>

<% for (FileEntry fileEntry : attachmentsFileEntries) { %>
<% String taglibURL = "javascript:" + liferayPortletResponse.getNamespace() + "deleteFileEntry('" + fileEntry.getFileEntryId() + "');"; %>
<% } %>
new Liferay.Upload({ 'boundingBox': '#fileUpload', 'deleteFile': '', <% DLConfiguration dlConfiguration = ConfigurationProviderUtil.getSystemConfiguration(DLConfiguration.class); %> 'fileDescription': '<%= StringUtil.merge(dlConfiguration.fileExtensions()) %>', 'maxFileSize': '<%= DLValidatorUtil.getMaxAllowableSize(themeDisplay.getScopeGroupId(), null) %> B', 'metadataContainer': '#selectedFileNameMetadataContainer', 'metadataExplanationContainer': '#metadataExplanationContainer', 'namespace': '', 'tempFileURL': { method: Liferay.Service.bind('/kb.kbarticle/get-temp-attachment-names'), params: { groupId: <%= scopeGroupId %>, tempFolderName: '<%= KBWebKeys.TEMP_FOLDER_NAME %>', }, }, 'strings.dropFilesText': '', 'uploadFile': '', }); window['deleteFileEntry'] = function (fileEntryId) { var removeFileEntryIdsInput = document.getElementById( 'removeFileEntryIds' ); var fileEntries = removeFileEntryIdsInput.value; if (fileEntries.length) { fileEntries += ','; } fileEntries += fileEntryId; removeFileEntryIdsInput.value = fileEntries; var fileEntryIdWrapper = document.getElementById( 'fileEntryIdWrapper' + fileEntryId ); if (fileEntryIdWrapper) { fileEntryIdWrapper.style.display = 'none'; } };




© 2015 - 2025 Weber Informatics LLC | Privacy Policy