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

META-INF.resources.message_boards.view_thread_message.jsp Maven / Gradle / Ivy

There is a newer version: 5.0.117
Show newest version
<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
--%>

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



<%
MBCategory category = (MBCategory)request.getAttribute("edit_message.jsp-category");
Boolean editable = (Boolean)request.getAttribute("edit_message.jsp-editable");
MBMessage message = (MBMessage)request.getAttribute("edit_message.jsp-message");
Boolean showDeletedAttachmentsFileEntries = (Boolean)request.getAttribute("edit-message.jsp-showDeletedAttachmentsFileEntries");
Boolean showPermanentLink = (Boolean)request.getAttribute("edit-message.jsp-showPermanentLink");
Boolean showRecentPosts = (Boolean)request.getAttribute("edit-message.jsp-showRecentPosts");
MBThread thread = (MBThread)request.getAttribute("edit_message.jsp-thread");
%>



<% String messageUserName = "anonymous"; if (!message.isAnonymous()) { messageUserName = message.getUserName(); } Date modifiedDate = message.getModifiedDate(); String modifiedDateDescription = LanguageUtil.getTimeDescription(request, System.currentTimeMillis() - modifiedDate.getTime(), true); String userDisplayText = LanguageUtil.format(request, "x-modified-x-ago", new Object[] {messageUserName, modifiedDateDescription}); %>
<%= userDisplayText %>

"> <%= HtmlUtil.escape(message.getSubject()) %> <%= HtmlUtil.escape(message.getSubject()) %> ()

<% MBStatsUser statsUser = MBStatsUserLocalServiceUtil.getStatsUser(scopeGroupId, message.getUserId()); int posts = statsUser.getMessageCount(); String[] ranks = MBUtil.getUserRank(mbGroupServiceSettings, themeDisplay.getLanguageId(), statsUser); User messageUser = UserLocalServiceUtil.fetchUser(message.getUserId()); %> <%= HtmlUtil.escape(ranks[1]) %> <%= HtmlUtil.escape(ranks[0]) %> : <%= posts %> : <%= dateFormatDate.format(messageUser.getCreateDate()) %>
<% boolean hasDeletePermission = !thread.isLocked() && (thread.getMessageCount() > 1) && MBMessagePermission.contains(permissionChecker, message, ActionKeys.DELETE); boolean hasMoveThreadPermission = (message.getParentMessageId() != MBMessageConstants.DEFAULT_PARENT_MESSAGE_ID) && MBCategoryPermission.contains(permissionChecker, scopeGroupId, category.getCategoryId(), ActionKeys.MOVE_THREAD); boolean hasPermissionsPermission = !thread.isLocked() && !message.isRoot() && MBMessagePermission.contains(permissionChecker, message, ActionKeys.PERMISSIONS); boolean hasReplyPermission = MBCategoryPermission.contains(permissionChecker, scopeGroupId, message.getCategoryId(), ActionKeys.REPLY_TO_MESSAGE); boolean hasUpdatePermission = !thread.isLocked() && MBMessagePermission.contains(permissionChecker, message, ActionKeys.UPDATE); boolean showAnswerFlag = false; if (!message.isRoot()) { MBMessage rootMessage = MBMessageLocalServiceUtil.getMessage(thread.getRootMessageId()); showAnswerFlag = MBMessagePermission.contains(permissionChecker, rootMessage, ActionKeys.UPDATE) && (thread.isQuestion() || MBThreadLocalServiceUtil.hasAnswerMessage(thread.getThreadId())); } %> <% String taglibQuickReplyURL = "javascript:" + liferayPortletResponse.getNamespace() + "addQuickReply('reply', '" + message.getMessageId() + "');"; %> <% PortletURL categoryURL = liferayPortletResponse.createRenderURL(); if (message.getCategoryId() == MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID) { categoryURL.setParameter("mvcRenderCommandName", "/message_boards/view"); } else { categoryURL.setParameter("mvcRenderCommandName", "/message_boards/view_category"); categoryURL.setParameter("mbCategoryId", String.valueOf(message.getCategoryId())); } %>
<% String msgBody = message.getBody(); if (message.isFormatBBCode()) { msgBody = MBUtil.getBBCodeHTML(msgBody, themeDisplay.getPathThemeImages()); } %>
<%= msgBody %>
<% String assetTagNames = (String)request.getAttribute("edit_message.jsp-assetTagNames"); %>
<% int attachmentsFileEntriesCount = message.getAttachmentsFileEntriesCount(); int deletedAttachmentsFileEntriesCount = message.getDeletedAttachmentsFileEntriesCount(); %>

:

<% List attachmentsFileEntries = message.getAttachmentsFileEntries(); for (FileEntry fileEntry : attachmentsFileEntries) { if (MimeTypesUtil.isWebImage(fileEntry.getMimeType())) { %>

<liferay-ui:message escapeAttribute=" key="attachment" />" class="crop-img" src="<%= PortletFileRepositoryUtil.getPortletFileEntryURL(themeDisplay, fileEntry, StringPool.BLANK) %>" />

<% } } %>
    <% for (FileEntry fileEntry : attachmentsFileEntries) { %>
  • <% StringBundler sb = new StringBundler(4); sb.append(fileEntry.getTitle()); sb.append(StringPool.OPEN_PARENTHESIS); sb.append(TextFormatter.formatStorageSize(fileEntry.getSize(), locale)); sb.append(StringPool.CLOSE_PARENTHESIS); AssetRendererFactory assetRendererFactory = AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(DLFileEntry.class.getName()); AssetRenderer assetRenderer = assetRendererFactory.getAssetRenderer(fileEntry.getFileEntryId()); %>
  • <% } %>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy