META-INF.resources.message_boards.view_message_content.jsp Maven / Gradle / Ivy
<%--
/**
* 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" %>
<%
String redirect = ParamUtil.getString(request, "redirect");
String backURL = redirect;
MBMessageDisplay messageDisplay = (MBMessageDisplay)request.getAttribute(WebKeys.MESSAGE_BOARDS_MESSAGE_DISPLAY);
MBMessage message = messageDisplay.getMessage();
MBCategory category = messageDisplay.getCategory();
MBThread thread = messageDisplay.getThread();
if (Validator.isNull(redirect)) {
PortletURL backPortletURL = renderResponse.createRenderURL();
if ((category == null) || (category.getCategoryId() == MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID)) {
backPortletURL.setParameter("mvcRenderCommandName", "/message_boards/view");
}
else {
backPortletURL.setParameter("mvcRenderCommandName", "/message_boards/view_category");
backPortletURL.setParameter("mbCategoryId", String.valueOf(category.getCategoryId()));
}
backURL = backPortletURL.toString();
}
boolean portletTitleBasedNavigation = GetterUtil.getBoolean(portletConfig.getInitParameter("portlet-title-based-navigation"));
if (portletTitleBasedNavigation) {
portletDisplay.setShowBackIcon(true);
portletDisplay.setURLBack(backURL);
renderResponse.setTitle(message.getSubject());
}
%>
<%
MBMessage rootMessage = null;
if (message.isRoot()) {
rootMessage = message;
}
else {
rootMessage = MBMessageLocalServiceUtil.getMessage(message.getRootMessageId());
}
%>
<%
MBTreeWalker treeWalker = messageDisplay.getTreeWalker();
AssetUtil.addLayoutTags(request, AssetTagLocalServiceUtil.getTags(MBMessage.class.getName(), thread.getRootMessageId()));
%>
<%
viewableThread = GetterUtil.getBoolean((String)request.getAttribute(WebKeys.MESSAGE_BOARDS_TREE_WALKER_VIEWABLE_THREAD));
%>
<%
MBMessage rootMessage = treeWalker.getRoot();
%>
$('# moreMessages').on(
'click',
function(event) {
var form = $('# fm');
var data = Liferay.Util.ns(
' ',
{
index: form.fm('index').val(),
rootIndexPage: form.fm('rootIndexPage').val()
}
);
$.ajax(
'<%= getMessagesURL.toString() %>',
{
data: data,
success: function(data) {
$('# messageContainer').append(data);
}
}
);
}
);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy