<% /** * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ %>
"><%= HtmlUtil.escape(message.getSubject()) %>
()
<%= dateFormatDateTime.format(message.getModifiedDate()) %> <% MBMessage parentMessage = null; try { parentMessage = MBMessageLocalServiceUtil.getMessage(message.getParentMessageId()); } catch (Exception e) {} %> <% PortletURL parentMessageURL = renderResponse.createRenderURL(); parentMessageURL.setParameter("struts_action", "/message_boards/view_message"); parentMessageURL.setParameter("messageId", String.valueOf(parentMessage.getMessageId())); String author = parentMessage.isAnonymous() ? LanguageUtil.get(pageContext, "anonymous") : PortalUtil.getUserName(parentMessage.getUserId(), parentMessage.getUserName()); %> <%= LanguageUtil.format(pageContext, "posted-as-a-reply-to", author) %>
    <% if (!message.isRoot()) { MBMessage rootMessage = MBMessageLocalServiceUtil.getMessage(thread.getRootMessageId()); if (MBMessagePermission.contains(permissionChecker, rootMessage, ActionKeys.UPDATE) && !MBMessageFlagLocalServiceUtil.hasAnswerFlag(message.getMessageId()) && (MBMessageFlagLocalServiceUtil.hasQuestionFlag(rootMessage.getMessageId()) || MBMessageFlagLocalServiceUtil.hasAnswerFlag(rootMessage.getMessageId()))) { %>
  • <% String taglibMarkAsAnswerURL = "javascript: " + renderResponse.getNamespace() + "addAnswerFlag('" + message.getMessageId() + "');"; %>
  • <% } } %>
<% /*String msgBody = message.getBody(); String codeStart = "
CODE
"; String codeEnd = "
"; while (true) { int x = msgBody.indexOf(codeStart); int y = msgBody.indexOf(codeEnd, x); if ((x == -1) || (y == -1)) { break; } String code = msgBody.substring(x + codeStart.length(), y); code = StringUtil.replace(code, "
", "\n"); code = StringUtil.replace(code, " ", " "); code = StringUtil.replace(code, "<", "<"); code = StringUtil.replace(code, ">", ">"); msgBody = msgBody.substring(0, x) + "[code]" + code + "[/code]" + msgBody.substring(y + codeEnd.length(), msgBody.length()); } String quoteBegin1 = ""; while (true) { int x = msgBody.indexOf(quoteBegin1); int y = msgBody.indexOf(quoteBegin2, x); if ((x == -1) || (y == -1)) { break; } String replace = msgBody.substring(x, y + quoteBegin2.length()); msgBody = StringUtil.replace(msgBody, replace, "[quote]"); } quoteBegin1 = ""; while (true) { int x = msgBody.indexOf(quoteBegin1); int y = msgBody.indexOf(quoteBegin2, x); if ((x == -1) || (y == -1)) { break; } String replace = msgBody.substring(x, y + quoteBegin2.length()); msgBody = StringUtil.replace(msgBody, replace, "[quote]"); } String quoteEnd = "
"; msgBody = StringUtil.replace(msgBody, quoteEnd, "[/quote]"); String urlStart = "http://forums.liferay.com/index.php"; while (true) { int x = msgBody.indexOf(urlStart); if (x == -1) { break; } int spacePos = msgBody.indexOf(" ", x); int singleQuotePos = msgBody.indexOf("'", x); int doubleQuotePos = msgBody.indexOf("\"", x); int lessThanPos = msgBody.indexOf("<", x); int y = -1; if (spacePos != -1) { y = spacePos; } if ((y == -1) || ((singleQuotePos != -1) && (y > singleQuotePos))) { y = singleQuotePos; } if ((y == -1) || ((doubleQuotePos != -1) && (y > doubleQuotePos))) { y = doubleQuotePos; } if ((y == -1) || ((lessThanPos != -1) && (y > lessThanPos))) { y = lessThanPos; } if (y == -1) { break; } String url = msgBody.substring(x, y); String entryStart = "&#entry"; int entryIdPos = url.indexOf(entryStart); if (entryIdPos != -1) { long messageId = GetterUtil.getLong(url.substring(entryIdPos + entryStart.length(), url.length())); url = "http://www.liferay.com/web/guest/devzone/forums/message_boards/message/" + messageId; } else { String topicId = HttpUtil.getParameter(url, "showtopic", false); if (Validator.isNotNull(topicId)) { url = "http://www.liferay.com/web/guest/devzone/forums/message_boards/topic/" + topicId; } else { break; } } msgBody = msgBody.substring(0, x) + url + msgBody.substring(y, msgBody.length()); } msgBody = StringUtil.replace(msgBody, "style_emoticons/<#EMO_DIR#>", "@theme_images_path@/emoticons"); String emoticonsPath = "@theme_images_path@/emoticons"; int x = 0; x = msgBody.indexOf(emoticonsPath, x); while (x != -1) { int y = msgBody.indexOf(".gif", x); String emotionImage = msgBody.substring(x + emoticonsPath.length() + 1, y) + ".gif"; x = msgBody.indexOf(emoticonsPath, x + 1); }*/ String msgBody = BBCodeUtil.getHTML(message); msgBody = StringUtil.replace(msgBody, "@theme_images_path@/emoticons", themeDisplay.getPathThemeImages() + "/emoticons"); %> <%= msgBody %> <% String[] attachmentsFiles = message.getAttachmentsFiles(); for (int j = 0; j < attachmentsFiles.length; j++) { String fileName = FileUtil.getShortFileName(attachmentsFiles[j]); if (StringUtil.endsWith(fileName, ".gif") || StringUtil.endsWith(fileName, ".jpg") || StringUtil.endsWith(fileName, ".png")) { %>
<liferay-ui:message key=" src="<%= themeDisplay.getPathMain() %>/message_boards/get_message_attachment?messageId=<%= message.getMessageId() %>&attachment=<%= HttpUtil.encodeURL(fileName) %>" />

<% } } %>
: <% for (int j = 0; j < attachmentsFiles.length; j++) { String fileName = FileUtil.getShortFileName(attachmentsFiles[j]); long fileSize = DLServiceUtil.getFileSize(company.getCompanyId(), CompanyConstants.SYSTEM, attachmentsFiles[j]); %> ">"><%= fileName %> (<%= TextFormatter.formatKB(fileSize, locale) %>k)<%= (j < (attachmentsFiles.length - 1)) ? ", " : "" %> <% } %>
  • <% String topHREF = "#" + renderResponse.getNamespace() + "message_0"; %>
  • <% PortletURL categoryURL = renderResponse.createRenderURL(); categoryURL.setParameter("struts_action", "/message_boards/view"); categoryURL.setParameter("categoryId", String.valueOf(message.getCategoryId())); %>