alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
<td width="100%" nowrap> <a class="nav" href="index"> »  <a class="nav" href="myprofile"> »  <fmt:message key="mvnforum.user.mymessage.title"/> (: <%=folder%>) </td> </tr> </table> <br/> <table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center"> <tr class="pagedesc"> <td> <fmt:message key="mvnforum.user.mymessage.guide"/> <p> <fmt:message key="mvnforum.common.prompt.choose_tasks"/>
<a class="command" href="addmessage">
<a class="command" href="mymessagefolder">
</td> </tr> </table> <br/> <% Collection messageBeans = (Collection) request.getAttribute("MessageBeans"); Collection messageFolderBeans = (Collection) request.getAttribute("MessageFolderBeans"); Collection messagePublicBeans = null; boolean enablePublicMessage = MVNForumConfig.getEnablePublicMessage(); if (enablePublicMessage) { messagePublicBeans = (Collection)request.getAttribute("MessagePublicBeans"); } int memberMessagesPerPage = onlineUser.getMessagesPerPage(); int totalMessages = ((Integer) request.getAttribute("TotalMessages")).intValue(); %> <script type="text/javascript"> function isCheckAll(checkboxes) { if (checkboxes == null) return true; if (checkboxes.length > 1) { // more than one checkboxes for (i = 0; i < checkboxes.length ; i++ ) { if (checkboxes[i].checked == false) return false; } } else { // only one checkbox if (checkboxes.checked == false) return false; } return true; } function checkAll(control, checkboxes) { if (checkboxes == null ) return; if (checkboxes.length > 1 ) { // more than one checkboxes for (i = 0; i< checkboxes.length; i ++ ) { checkboxes[i].checked = control.checked; } } else { // only one checkbox checkboxes.checked = control.checked; } } function change(control, checkboxes) { if (isCheckAll(checkboxes)) { control.checked = true; } else { control.checked = false; } } function SubmitMovingForm() { if (ValidateMovingForm() == true ) { //document.mvnform.submitbutton.disabled=true; document.mvnform.btnMoveFolder.value=1; document.mvnform.submit(); } } function ValidateMovingForm() { if (document.mvnform.DestinationFolder.value == '<%=folder%>' ) { alert('<fmt:message key="mvnforum.user.mymessage.error.same_folder"/>'); return false; } if (isBlank(document.mvnform.DestinationFolder, "<fmt:message key="mvnforum.user.mymessage.destination_folder"/>")) return false; return true; } </script> <table width="95%" align="center" class="messageText"> <tr> <td valign="bottom" nowrap class="messageText"> <form action="mymessage"> <input type="hidden" name="folder" value="<%=folder%>"> <fmt:message key="mvnforum.common.sort_by"/> <select name="sort"> <option value="MessageCreationDate" <%if (sort.equals("MessageCreationDate")) {%>selected<%}%>> <option value="MessageSenderName" <%if (sort.equals("MessageSenderName")) {%>selected<%}%>> <option value="MessageTopic" <%if (sort.equals("MessageTopic")) {%>selected<%}%>> <option value="MessageReadStatus" <%if (sort.equals("MessageReadStatus")) {%>selected<%}%>> </select> <fmt:message key="mvnforum.common.order"/> <select name="order"> <option value="ASC" <%if (order.equals("ASC")) {%>selected<%}%>> <option value="DESC" <%if (order.equals("DESC")) {%>selected<%}%>> </select> <input type="button" value=" </form> </td> <% double leftWidth = ((Double)request.getAttribute("QuotaRatio")).doubleValue(); final double BAR_WIDTH = 300; final double BAR_BORDER = 5; String percentImage = ""; if (leftWidth <= 30) { percentImage = "percent_low.gif"; } else if (leftWidth <= 70) { percentImage = "percent_med.gif"; } else { percentImage = "percent_high.gif"; } %> <td width="<%=BAR_WIDTH + BAR_BORDER%>" align="right"> <table width="<%=BAR_WIDTH + BAR_BORDER%>" border="0" cellspacing="<%=BAR_BORDER%>" cellpadding="1" align="center" bgcolor="#AABBCC"> <tr bgcolor="#FFFFFF"> <td align="left" height="17" nowrap class="messageText"> <img align='left' width="<%=Math.floor(leftWidth*(BAR_WIDTH/100))%>" height="15" src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/<%=percentImage%>" vspace='0' hspace='0'> </td> </tr> <tr>
</table> </td> </tr> </table> <pg:pager url="mymessage" items="<%= totalMessages %>" maxPageItems="<%= memberMessagesPerPage %>" isOffset="true" export="offset,currentPageNumber=pageNumber" scope="request"> <% String rowsType = MVNForumResourceBundle.getString(onlineUser.getLocale(), "mvnforum.common.numberof.private_messages"); %> <%-- keep track of preference --%> <pg:param name="sort"/> <pg:param name="order"/> <pg:param name="folder"/> <table border="0" cellpadding="0" cellspacing="0" width="95%" align="center"> <tr valign="top"> <td><%-- col 1 --%> <td>  <%-- col 2 --%> <td> <%@ include file="inc_pager.jsp"%> </td> </tr> <tr valign="top"> <td width="1%"><%-- col 1 --%> <table border="0" class="tborder" width="150" cellspacing="1" cellpadding="3" align="center"> <tr class="theader"> <td colspan="3" align="left"> </tr> <% int messageTotal = 0; int unreadMessageTotal = 0; String addressBookImageSource = contextPath + "/mvnplugin/mvnforum/images/icon/message_send.gif"; String foldersImageSource = contextPath + "/mvnplugin/mvnforum/images/icon/message_send.gif"; for (Iterator iterator = messageFolderBeans.iterator(); iterator.hasNext(); ) { MessageFolderBean messageFolderBean = (MessageFolderBean)iterator.next(); int messageCount = messageFolderBean.getMessageCount(); int unreadMessageCount = messageFolderBean.getUnreadMessageCount(); messageTotal += messageCount; unreadMessageTotal += unreadMessageCount; String folderName = messageFolderBean.getFolderName(); String folderImageSource = ""; if (folderName.equals("Inbox")) { folderImageSource = contextPath + "/mvnplugin/mvnforum/images/icon/folder_inbox.gif"; } else if (folderName.equals("Draft")) { folderImageSource = contextPath + "/mvnplugin/mvnforum/images/icon/folder_draft.gif"; } else if (folderName.equals("Trash")) { folderImageSource = contextPath + "/mvnplugin/mvnforum/images/icon/folder_trash.gif"; } else if (folderName.equals("Sent")) { folderImageSource = contextPath + "/mvnplugin/mvnforum/images/icon/folder_sent.gif"; } else { folderImageSource = contextPath + "/mvnplugin/mvnforum/images/icon/folder_default.gif"; } %> <tr class="trow1"> <td width="100%" class="messageText"> <img src="<%=folderImageSource%>" alt="<%=folderName%>" title="<%=folderName%>" align="middle" border="0" height="19" width="19"> <%if (folder.equals(folderName)) {%><%}%> <a href="mymessage?folder=<%=folderName%>"><%=folderName%> <%if (folder.equals(folderName)) {%><%}%> </td> <td align="right" nowrap class="messageText"> <%if (unreadMessageCount > 0 ) {%> <b><%=unreadMessageCount%>/<%=messageCount%> <%} else {%> <%=messageCount%> <%}%>  </td> </tr> <% }//for %> <tr class="trowfinal"> <td width="100%" align="right" class="messageText"> <fmt:message key="mvnforum.common.total"/>: </td> <td align="right" nowrap class="messageText"> <%if (unreadMessageTotal > 0 ) {%> <b><%=unreadMessageTotal%>/<%=messageTotal%> <%} else {%> <%=messageTotal%> <%}%>  </td> </tr> </table> </td><%-- end col 1 --%> <td><%-- col 2 --%> <td> <%-- col 3 --%> <form action="processmessage" method="post" name="mvnform"> <table class="tborder" width="100%" cellspacing="1" cellpadding="3" align="center"> <tr class="theader"> <td width="16" align="center"> <td width="16"> <td> <td align="center"> <td align="center"> </tr> <% int rowIndex = 0; boolean hasAnAttachment = false; boolean hasAnUnreadMessage = false; boolean hasAReadMessage = false; if ( enablePublicMessage ) {%> <tr class="tcat"> <%for (Iterator iterator = messagePublicBeans.iterator(); iterator.hasNext(); ) { MessageBean messageBean = (MessageBean)iterator.next(); if (messageBean.getFolderName().equalsIgnoreCase(MVNForumConstant.MESSAGE_FOLDER_DRAFT) && (messageBean.getMemberID() != onlineUser.getMemberID())) continue; %> <tr class="trow<%=(rowIndex++)%2 + 1%>"> <td width="16" align="center"> <%if (permission.canAdminSystem()) {%> <input type="checkbox" name="selectedmessage" value="<%=messageBean.getMessageID()%>" class="noborder" onclick="change(document.forms.mvnform.elements['checkall'], document.forms.mvnform.elements['selectedmessage']);"> <%}%> </td> <td width="16"> <td> <% if (messageBean.getFolderName().equalsIgnoreCase(MVNForumConstant.MESSAGE_FOLDER_DRAFT)) { %> [Draft] <% } %> <% if (messageBean.getMessageAttachCount() > 0) { hasAnAttachment = true; %> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/attach.gif"/> <% } %> <%=EnableEmotionFilter.filter(messageBean.getMessageIcon(), contextPath + MVNForumGlobal.EMOTION_DIR)%> <a href="viewmessage?message=<%=messageBean.getMessageID()%>"><%=messageBean.getMessageTopic()%> </td> <td align="center"><%=messageBean.getMessageSenderName()%> <td align="center"><%=onlineUser.getGMTTimestampFormat(messageBean.getMessageCreationDate())%> </tr> <%}//for public messages if (messagePublicBeans.size() == 0) { %> <tr class="trow1"> <%} //if size == 0 }//enablePublicMessage%> <tr class="tcat"> <% rowIndex = 0; for (Iterator iterator = messageBeans.iterator(); iterator.hasNext(); ) { MessageBean messageBean = (MessageBean)iterator.next(); %> <pg:item> <tr class="trow<%=(rowIndex++)%2 + 1%>"> <td width="16" align="center"> <td width="16"> <% if (messageBean.getMessageReadStatus() == MessageBean.MESSAGE_READ_STATUS_DEFAULT ) { hasAnUnreadMessage = true; %> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/message_unread.gif" border="0"> <% } else { hasAReadMessage = true; %> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/message_read.gif" border="0"> <% } %> </td> <td> <% if (messageBean.getMessageType() == MessageBean.MESSAGE_TYPE_PUBLIC) { %> <b>[] <% } %> <% if (messageBean.getMessageType() == MessageBean.MESSAGE_TYPE_QUOTE) { %> <b>[] <% } %> <% if (messageBean.getMessageAttachCount() > 0) { hasAnAttachment = true; %> <img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/attach.gif"/> <% } %> <%=EnableEmotionFilter.filter(messageBean.getMessageIcon(), contextPath + MVNForumGlobal.EMOTION_DIR)%> <a href="viewmessage?message=<%=messageBean.getMessageID()%>"> <% if (messageBean.getMessageReadStatus() == MessageBean.MESSAGE_READ_STATUS_DEFAULT ) { %> <b><%=messageBean.getMessageTopic()%> <% } else {%> <%=messageBean.getMessageTopic()%> <%}%> </a> </td> <td align="center"><%=messageBean.getMessageSenderName()%> <td align="center"><%=onlineUser.getGMTTimestampFormat(messageBean.getMessageCreationDate())%> </tr> </pg:item> <% }//for if (messageBeans.size() == 0) { %> <tr class="trow1"> <% } int publicSizeWithPermission = 0; if (permission.canAdminSystem()) { publicSizeWithPermission = messagePublicBeans.size(); } if ((messageBeans.size() + publicSizeWithPermission) > 0) { // also fix column width bug in IE %> </table> <table class="tborder" width="100%" cellspacing="1" cellpadding="3" align="center"> <tr class="trowfinal"> <td colspan="5"> <input type="submit" name="btnDelete" value=" <% if (messageBeans.size() > 0) { %> <input type="submit" name="btnUnreadMark" value=" <br/> <input type="button" name="btnMoveFolder1" value=" <input type="hidden" name="btnMoveFolder"> <select name="DestinationFolder"> <option value=""> <% for (Iterator iterator = messageFolderBeans.iterator(); iterator.hasNext(); ) { MessageFolderBean messageFolderBean = (MessageFolderBean)iterator.next(); String folderName = messageFolderBean.getFolderName(); if (folderName.equalsIgnoreCase(folder)==false && folderName.equalsIgnoreCase(MVNForumConstant.MESSAGE_FOLDER_SENT)==false && folderName.equalsIgnoreCase(MVNForumConstant.MESSAGE_FOLDER_DRAFT)==false) { %> <option value="<%=folderName%>"><%=folderName%> <%} }//for %> <% } // end if private size == 0 %> </select> </td> </tr> <% } %> </table> </form> <table width="100%" align="center"> <tr> <td colspan="2"> <%@ include file="inc_pager.jsp"%> </td> </tr> <% if (enablePublicMessage && messagePublicBeans.size() > 0) { %> <tr class="messageText"> <td width="16"> <td> </tr> <%}%> <% if (hasAnUnreadMessage) { %> <tr class="messageText"> <td width="16"> <td> </tr> <%}%> <% if (hasAReadMessage) {%> <tr class="messageText"> <td width="16"> <td> </tr> <%}%> <% if (hasAnAttachment) { %> <tr class="messageText"> <td width="16" align="center"> <td> </tr> <%}%> </table> <br/> </td><%-- end col 3 --%> </tr> </table> </pg:pager> <br/> </fmt:bundle> <%@ include file="footer.jsp"%> </body> </html>

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/user/mymessage.jsp,v 1.59 2005/02/21 18:33:42 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.59 $
 - $Date: 2005/02/21 18:33:42 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002-2005 by MyVietnam.net
 -
 - This program is free software; you can redistribute it and/or
 - modify it under the terms of the GNU General Public License
 - as published by the Free Software Foundation; either version 2
 - of the License, or any later version.
 -
 - All copyright notices regarding mvnForum MUST remain intact
 - in the scripts and in the outputted HTML.
 - The "powered by" text/logo with a link back to
 - http://www.mvnForum.com and http://www.MyVietnam.net in the
 - footer of the pages MUST remain visible when the pages
 - are viewed on the internet or intranet.
 -
 - This program 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 General Public License for more details.
 -
 - You should have received a copy of the GNU General Public License
 - along with this program; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -
 - Support can be obtained from support forums at:
 - http://www.mvnForum.com/mvnforum/index
 -
 - Correspondence and Marketing Questions can be sent to:
 - info@MyVietnam.net
 -
 - @author: Minh Nguyen  minhnn@MyVietnam.net
 - @author: Mai  Nguyen  mai.nh@MyVietnam.net
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.*" %>
<%@ page import="net.myvietnam.mvncore.util.ParamUtil" %>
<%@ page import="net.myvietnam.mvncore.filter.EnableEmotionFilter" %>
<%@ page import="net.myvietnam.mvncore.security.Encoder" %>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.MVNForumResourceBundle" %>
<%@ page import="com.mvnforum.MVNForumConfig" %>
<%@ page import="com.mvnforum.MVNForumConstant" %>
<%@ page import="com.mvnforum.MVNForumGlobal" %>

<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<html 
<head>
  <title> - 
  <%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
  <link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%@ include file="header.jsp"%>
<br/>

<%
String sort  = ParamUtil.getParameter(request, "sort");
String order = ParamUtil.getParameter(request, "order");
String folder = ParamUtil.getParameter(request, "folder");
if (sort.length() == 0) sort = "MessageCreationDate";
if (order.length() == 0) order = "DESC";
if (folder.length() == 0) folder = "Inbox";
%>
<table width="95%" align="center">
  <tr class="nav">
    <td>
<%=Math.round(leftWidth)%>% <%=MVNForumConfig.getMaxPrivateMessage()%>
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.