[jboss-svn-commits] JBL Code SVN: r9829 - in labs/jbossforums/branches/forums101P26/forums/src: main/org/jboss/portlet/forums/impl and 5 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Feb 27 19:17:44 EST 2007
Author: unibrew
Date: 2007-02-27 19:17:44 -0500 (Tue, 27 Feb 2007)
New Revision: 9829
Modified:
labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java
labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml
Log:
[JBFORUMS-168] Massive commit for ForumView L&F change.
Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java 2007-02-28 00:13:12 UTC (rev 9828)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java 2007-02-28 00:17:44 UTC (rev 9829)
@@ -561,6 +561,14 @@
*/
ForumWatch findForumWatchById(Integer forumWatchID) throws ModuleException;
+ /**
+ *
+ * @param user
+ * @param forumId
+ * @return ForumWatch
+ * @throws ModuleException
+ */
+ ForumWatch findForumWatchByUserAndForum(User user,int forumId) throws ModuleException;
/**
*
Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java 2007-02-28 00:13:12 UTC (rev 9828)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java 2007-02-28 00:17:44 UTC (rev 9829)
@@ -1617,6 +1617,31 @@
}
}
+ public ForumWatch findForumWatchByUserAndForum(User user,int forumId) throws ModuleException
+ {
+ try
+ {
+ Session session = getSession();
+ Query query = session.createQuery(" from ForumWatchImpl as fw " +
+ " where fw.poster.userId = :userId " +
+ " and fw.forum.id= :forumId ");
+ query.setString("userId", user.getId().toString());
+ query.setInteger("forumId", forumId );
+ Object obj = query.uniqueResult();
+ if (obj==null) {
+ return null;
+ } else {
+ return (ForumWatch)obj;
+ }
+ }
+ catch (HibernateException e)
+ {
+ String message = "Cannot find forum watch";
+ log.error(message, e);
+ throw new ModuleException(message, e);
+ }
+ }
+
public TopicWatch findTopicWatchByUserAndTopic(User user,int topicId) throws ModuleException
{
try
@@ -1636,7 +1661,7 @@
}
catch (HibernateException e)
{
- String message = "Cannot find forum watch";
+ String message = "Cannot find topic watch";
log.error(message, e);
throw new ModuleException(message, e);
}
Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java 2007-02-28 00:13:12 UTC (rev 9828)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java 2007-02-28 00:17:44 UTC (rev 9829)
@@ -327,10 +327,35 @@
* DOCUMENT_ME
*/
public String resourceIconSpacerURL;
-
+
/**
* DOCUMENT_ME
*/
+ public String resourceIconSubscribeURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceIconUnSubscribeURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceIconLockURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceIconUnlockURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceIconModerateURL;
+
+ /**
+ * DOCUMENT_ME
+ */
public String resourceHeadStylesheetURL;
private XProperties xprops;
@@ -422,6 +447,11 @@
resourceIconDelpostURL = xprops.getResourceURL("icon_delpost");
resourceIconMinipostURL = xprops.getResourceURL("icon_minipost");
resourceIconMinipostNewURL = xprops.getResourceURL("icon_minipost_new");
+ resourceIconSubscribeURL = xprops.getResourceURL("forum_subscribe");
+ resourceIconUnSubscribeURL = xprops.getResourceURL("forum_unsubscribe");
+ resourceIconUnlockURL = xprops.getResourceURL("unlock");
+ resourceIconLockURL = xprops.getResourceURL("lock");
+ resourceIconModerateURL = xprops.getResourceURL("moderate");
resourceHeadStylesheetURL = xprops.getResourceURL("head_stylesheet");
resourceIconSpacerURL = xprops.getResourceURL("spacer");
Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java 2007-02-28 00:13:12 UTC (rev 9828)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java 2007-02-28 00:17:44 UTC (rev 9829)
@@ -1,145 +1,139 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This 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 software 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.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.portlet.forums.ui;
-
import java.io.StringWriter;
-
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
-
-import java.net.URLEncoder;
-
-import java.text.SimpleDateFormat;
-
import java.util.Locale;
import java.util.Map;
-
import java.util.ResourceBundle;
-
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
import javax.faces.component.UIViewRoot;
-
-import org.apache.log4j.Logger;
-
-//jsf
import javax.faces.context.FacesContext;
-
-//portal
import javax.naming.InitialContext;
import javax.naming.NamingException;
-
import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
-import javax.portlet.PortletRequest;
-
import javax.servlet.http.HttpServletRequest;
-
+import org.apache.log4j.Logger;
import org.jboss.portal.core.modules.ModuleConstants;
-import org.jboss.portal.identity.ProfileMap;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.User;
import org.jboss.portal.format.render.bbcodehtml.ToHTMLConfig;
import org.jboss.portal.format.render.bbcodehtml.ToHTMLRenderer;
import org.jboss.portal.format.util.CLLoader;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.UserProfileModule;
import org.jboss.portlet.forums.ForumsConstants;
-import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.helper.TempFileBinding;
+import org.jboss.portlet.forums.impl.MessageImpl;
+import org.jboss.portlet.forums.impl.PollImpl;
+import org.jboss.portlet.forums.impl.PollOptionImpl;
import org.jboss.portlet.forums.impl.PosterImpl;
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Message;
import org.jboss.portlet.forums.model.Poll;
-import org.jboss.portlet.forums.impl.PollImpl;
import org.jboss.portlet.forums.model.PollOption;
-import org.jboss.portlet.forums.impl.PollOptionImpl;
-import org.jboss.portlet.forums.model.Message;
-import org.jboss.portlet.forums.impl.MessageImpl;
-import org.jboss.portlet.forums.model.Forum;
-import org.jboss.portlet.forums.helper.TempFileBinding;
+import org.jboss.portlet.forums.model.Poster;
+import org.jboss.portlet.forums.model.Watch;
-
-
/**
* @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
* @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
- *
+ *
*/
public class PortalUtil
{
private static CLLoader loader = new CLLoader("template");
+
private static Logger log = Logger.getLogger(PortalUtil.class);
+
private static User user = new User()
+ {
+ public Object getId()
{
- public Object getId() {
- return null;
- }
+ return null;
+ }
- public void updatePassword(String string) {
- }
+ public void updatePassword(String string)
+ {
+ }
- public boolean validatePassword(String string) {
- return false;
- }
+ public boolean validatePassword(String string)
+ {
+ return false;
+ }
- public String getUserName() {
- return null;
- }
- };
-
- private final static UserProfileModule upm;
-
- static {
- UserProfileModule temporary = null;
- try {
- temporary = (UserProfileModule)new InitialContext().lookup("java:portal/UserProfileModule");
- } catch (NamingException e) {
- JSFUtil.handleException(e);
- } finally {
- upm = temporary;
- }
- }
+ public String getUserName()
+ {
+ return null;
+ }
+ };
-
- /**
- *
- *
- */
- public static boolean isRunningInPortal()
- {
- boolean isRunningInPortal = false;
- Object o = FacesContext.getCurrentInstance().getExternalContext().getRequest();
- if(o instanceof PortletRequest)
- {
- isRunningInPortal = true;
- }
- return isRunningInPortal;
- }
+ private final static UserProfileModule upm;
+ static
+ {
+ UserProfileModule temporary = null;
+ try
+ {
+ temporary = (UserProfileModule) new InitialContext()
+ .lookup("java:portal/UserProfileModule");
+ } catch (NamingException e)
+ {
+ JSFUtil.handleException(e);
+ } finally
+ {
+ upm = temporary;
+ }
+ }
+
/**
- *
+ *
+ *
+ */
+ public static boolean isRunningInPortal()
+ {
+ boolean isRunningInPortal = false;
+ Object o = FacesContext.getCurrentInstance().getExternalContext()
+ .getRequest();
+ if (o instanceof PortletRequest)
+ {
+ isRunningInPortal = true;
+ }
+ return isRunningInPortal;
+ }
+
+ /**
+ *
* @author sshah
- *
+ *
*/
public static String outputLink(String outputLink, boolean isAction)
{
@@ -147,8 +141,8 @@
{
String url = null;
- Object response =
- FacesContext.getCurrentInstance().getExternalContext().getResponse();
+ Object response = FacesContext.getCurrentInstance()
+ .getExternalContext().getResponse();
if (!outputLink.startsWith("/"))
{
@@ -164,58 +158,65 @@
if (isAction)
{
portletURL = renderResponse.createActionURL();
- }
- else
+ } else
{
portletURL = renderResponse.createRenderURL();
}
String jsfUrl = portletURL.toString();
- jsfUrl +="&" + ForumsJSFPortlet.VIEW + "=" +
- URLEncoder.encode(ForumsJSFPortlet.getIdForName(outputLink), "UTF-8");
+ jsfUrl += "&"
+ + ForumsJSFPortlet.VIEW
+ + "="
+ + URLEncoder.encode(ForumsJSFPortlet
+ .getIdForName(outputLink), "UTF-8");
url = jsfUrl;
- }
- else
+ } else
{
String contextPath = JSFUtil.getContextPath();
url = contextPath + outputLink;
}
return url;
- }
- catch (Exception e)
+ } catch (Exception e)
{
log.error(PortalUtil.class.getName(), e);
return null;
}
}
-
- public static String postPermlink(String postId) {
-
- Object response =
- FacesContext.getCurrentInstance().getExternalContext().getResponse();
+ public static String postPermlink(String postId)
+ {
+
+ Object response = FacesContext.getCurrentInstance()
+ .getExternalContext().getResponse();
+
String url = "";
-
+
if (response instanceof RenderResponse)
{
RenderResponse renderResponse = (RenderResponse) response;
- PortletURL portletURL = renderResponse.createActionURL();
+ PortletURL portletURL = renderResponse.createActionURL();
url = portletURL.toString();
- if (url.contains("/auth")) {
- url = url.replaceFirst("/auth","");
+ if (url.contains("/auth"))
+ {
+ url = url.replaceFirst("/auth", "");
}
- url += "&"+Constants.p_viewId+"=t&"+Constants.p_postId+"="+postId+"#"+postId;
- } else {
+ url += "&" + Constants.p_viewId + "=t&" + Constants.p_postId + "="
+ + postId + "#" + postId;
+ } else
+ {
url = JSFUtil.getContextPath();
- ApplicationFactory factory = (ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ ApplicationFactory factory = (ApplicationFactory) FactoryFinder
+ .getFactory(FactoryFinder.APPLICATION_FACTORY);
Application application = factory.getApplication();
- EmptyController binding = (EmptyController)application.getVariableResolver().resolveVariable(FacesContext.getCurrentInstance(),"shared");
+ EmptyController binding = (EmptyController) application
+ .getVariableResolver().resolveVariable(
+ FacesContext.getCurrentInstance(), "shared");
url += binding.getLinks().get("topic").toString();
- url += "?"+Constants.p_postId+"="+postId+"#"+postId;
+ url += "?" + Constants.p_postId + "=" + postId + "#" + postId;
}
-
+
return url;
}
@@ -223,65 +224,79 @@
*
*
*/
- public static void executeNotifications () {
-
- Object responseObj =
- FacesContext.getCurrentInstance().getExternalContext().getResponse();
+ public static void executeNotifications()
+ {
- Object requestObj =
- FacesContext.getCurrentInstance().getExternalContext().getRequest();
-
+ Object responseObj = FacesContext.getCurrentInstance()
+ .getExternalContext().getResponse();
+
+ Object requestObj = FacesContext.getCurrentInstance()
+ .getExternalContext().getRequest();
+
// Initializing url values
String postUrl = "";
String replyUrl = "";
-
- if (requestObj instanceof RenderRequest) {
-
- PortletRequest request = (PortletRequest)requestObj;
-
- // Checking whether there is watched post id in RenderParameters and scheduling notification e-mails.
- String watchedPostId = request.getParameter(Constants.p_notified_post_id);
- String watchedType = request.getParameter(Constants.p_notified_watch_type);
-
- if (watchedPostId!=null && watchedPostId.trim().length()>0 &&
- watchedType!=null && watchedType.trim().length()>0 ) {
-
+
+ if (requestObj instanceof RenderRequest)
+ {
+
+ PortletRequest request = (PortletRequest) requestObj;
+
+ // Checking whether there is watched post id in RenderParameters and
+ // scheduling notification e-mails.
+ String watchedPostId = request
+ .getParameter(Constants.p_notified_post_id);
+ String watchedType = request
+ .getParameter(Constants.p_notified_watch_type);
+
+ if (watchedPostId != null && watchedPostId.trim().length() > 0
+ && watchedType != null && watchedType.trim().length() > 0)
+ {
+
// Creating permament link to post
- PortletURL portletURL = ((RenderResponse)responseObj).createActionURL();
+ PortletURL portletURL = ((RenderResponse) responseObj)
+ .createActionURL();
postUrl = portletURL.toString();
- if (postUrl.contains("/auth")) {
- postUrl = postUrl.replaceFirst("/auth","");
+ if (postUrl.contains("/auth"))
+ {
+ postUrl = postUrl.replaceFirst("/auth", "");
}
- postUrl += "&"+Constants.p_viewId+"=t&"+Constants.p_postId+"="+watchedPostId+"#"+watchedPostId;
-
- portletURL = ((RenderResponse)responseObj).createRenderURL();
+ postUrl += "&" + Constants.p_viewId + "=t&"
+ + Constants.p_postId + "=" + watchedPostId + "#"
+ + watchedPostId;
+
+ portletURL = ((RenderResponse) responseObj).createRenderURL();
replyUrl = portletURL.toString();
- replyUrl += "&"+Constants.p_viewId+"=z&"+Constants.p_postId+"="+watchedPostId;
-
+ replyUrl += "&" + Constants.p_viewId + "=z&"
+ + Constants.p_postId + "=" + watchedPostId;
+
// Generate hostUrl to servlet
String hostURL = ((request.isSecure()) ? "https" : "http")
- + "://"
- + request.getServerName()
- + ((request.getServerPort() == 80) ? "" : ":"
- + request.getServerPort());
-
- postUrl= hostURL + postUrl;
+ + "://"
+ + request.getServerName()
+ + ((request.getServerPort() == 80) ? "" : ":"
+ + request.getServerPort());
+
+ postUrl = hostURL + postUrl;
replyUrl = hostURL + replyUrl;
-
+
Integer postId = new Integer(watchedPostId);
int type = Integer.parseInt(watchedType);
-
- try {
- BaseController.getForumsModule().processNotifications(postId,type,postUrl,replyUrl);
- } catch (Exception e) {
+
+ try
+ {
+ BaseController.getForumsModule().processNotifications(
+ postId, type, postUrl, replyUrl);
+ } catch (Exception e)
+ {
JSFUtil.handleException(e);
}
}
}
}
-
+
/**
- *
+ *
* @param preferenceKey
* @return
*/
@@ -289,7 +304,8 @@
{
String preference = null;
- Object o = FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ Object o = FacesContext.getCurrentInstance().getExternalContext()
+ .getRequest();
if (!JSFUtil.isAnonymous() && o instanceof PortletRequest)
{
PortletRequest request = (PortletRequest) o;
@@ -299,56 +315,59 @@
return preference;
}
-
+
/**
*
- *
+ *
*/
public static void setPreferences(Map preferences) throws Exception
{
- Object o = FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ Object o = FacesContext.getCurrentInstance().getExternalContext()
+ .getRequest();
if (!JSFUtil.isAnonymous() && o instanceof PortletRequest)
{
PortletRequest request = (PortletRequest) o;
PortletPreferences pp = request.getPreferences();
- for(Iterator itr=preferences.keySet().iterator();itr.hasNext();)
+ for (Iterator itr = preferences.keySet().iterator(); itr.hasNext();)
{
- String preferenceKey = (String)itr.next();
- String value = (String)preferences.get(preferenceKey);
- if(!pp.isReadOnly(preferenceKey))
- {
- pp.setValue(preferenceKey,value);
- }
+ String preferenceKey = (String) itr.next();
+ String value = (String) preferences.get(preferenceKey);
+ if (!pp.isReadOnly(preferenceKey))
+ {
+ pp.setValue(preferenceKey, value);
+ }
}
pp.store();
}
}
/**
- * Get a <code>SimpleDateFormat</code> object from the session. The object is stored
- * in the session because it is expensive to create and we want to reuse it as
- * much as we can. Also it is configured with the date format taken from the preference
- * of the user if it exists.
- *
- * @param req the request that maybe contains the format object
+ * Get a <code>SimpleDateFormat</code> object from the session. The object
+ * is stored in the session because it is expensive to create and we want to
+ * reuse it as much as we can. Also it is configured with the date format
+ * taken from the preference of the user if it exists.
+ *
+ * @param req
+ * the request that maybe contains the format object
* @return the format object
*/
public static SimpleDateFormat getSDF()
{
- Object o =
- FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ Object o = FacesContext.getCurrentInstance().getExternalContext()
+ .getRequest();
if (o instanceof PortletRequest)
{
- PortletRequest req =
- (PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ PortletRequest req = (PortletRequest) FacesContext
+ .getCurrentInstance().getExternalContext().getRequest();
// Get the pattern
- String pattern =
- req.getPreferences().getValue("dateformat", ForumsConstants.DEFAULT_DATE_PATTERN);
+ String pattern = req.getPreferences().getValue("dateformat",
+ ForumsConstants.DEFAULT_DATE_PATTERN);
// Get the simple date format if it exists
- SimpleDateFormat sdf =
- (SimpleDateFormat) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("SDF");
+ SimpleDateFormat sdf = (SimpleDateFormat) FacesContext
+ .getCurrentInstance().getExternalContext().getSessionMap()
+ .get("SDF");
// Do we have it ?
if (sdf == null)
@@ -357,10 +376,9 @@
sdf = new SimpleDateFormat(pattern, req.getLocale());
// Put it in the session
- FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("SDF",
- sdf);
- }
- else
+ FacesContext.getCurrentInstance().getExternalContext()
+ .getSessionMap().put("SDF", sdf);
+ } else
{
// Check if config has not changed
if (!sdf.toPattern().equals(pattern))
@@ -369,8 +387,7 @@
}
}
return sdf;
- }
- else
+ } else
{
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern(ForumsConstants.DEFAULT_DATE_PATTERN);
@@ -379,19 +396,19 @@
}
/**
- *
+ *
* @return
* @throws Exception
*/
- public static User getUser()
- throws Exception
+ public static User getUser() throws Exception
{
User user = null;
- String userName =
- FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
- if(userName!=null && userName.trim().length()>0)
+ String userName = FacesContext.getCurrentInstance()
+ .getExternalContext().getRemoteUser();
+ if (userName != null && userName.trim().length() > 0)
{
- UserModule userModule = (UserModule) new InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME);
+ UserModule userModule = (UserModule) new InitialContext()
+ .lookup(ModuleConstants.USERMODULE_JNDINAME);
user = userModule.findUserByUserName(userName);
}
return user;
@@ -403,34 +420,47 @@
* @throws Exception
*/
public static String userProperty(User user, String propertyName)
- throws Exception
+ throws Exception
{
String property = null;
String valueStr = null;
try
{
- property = user.getClass().getField(propertyName).get(user).toString();
- Object value = upm.getProperty(user,property);
- if (value != null && value.toString().trim().length()!=0)
+ property = user.getClass().getField(propertyName).get(user)
+ .toString();
+ Object value = upm.getProperty(user, property);
+ if (value != null && value.toString().trim().length() != 0)
{
valueStr = value.toString();
}
- }
- catch (Exception e)
+ } catch (Exception e)
{
e.printStackTrace();
throw e;
}
return valueStr;
}
+
+ public static Date getUserLastLoginDate()
+ {
+ try
+ {
+ User user = PortalUtil.getUser();
+ String property = PortalUtil.userProperty(user, "INFO_USER_LAST_LOGIN_DATE");
+ return PortalUtil.getSDF().parse(property);
+ } catch (Exception e)
+ {
+ JSFUtil.handleException(e);
+ }
+ return null;
+ }
/**
- *
+ *
* @return
* @throws Exception
*/
- public static Poster getPoster()
- throws Exception
+ public static Poster getPoster() throws Exception
{
Poster poster = null;
@@ -439,8 +469,8 @@
User user = PortalUtil.getUser();
Long userId = (Long) user.getId();
- poster =
- BaseController.getForumsModule().findPosterByUserId(String.valueOf(userId));
+ poster = BaseController.getForumsModule().findPosterByUserId(
+ String.valueOf(userId));
if (poster == null)
{
@@ -450,88 +480,105 @@
return poster;
}
-
+
/**
- * Method used for parsing bbcode and return properly formated text of message.
+ * Method used for parsing bbcode and return properly formated text of
+ * message.
+ *
* @return
*/
- public static String formatMessage( String text , boolean allowHTML ) {
-
- try {
- Object req = FacesContext.getCurrentInstance().getExternalContext().getRequest();
-
+ public static String formatMessage(String text, boolean allowHTML)
+ {
+
+ try
+ {
+ Object req = FacesContext.getCurrentInstance().getExternalContext()
+ .getRequest();
+
if (allowHTML)
{
- getToHTMLRenderer(req).getConfig().setFilterMode(ToHTMLConfig.FILTER_MODE_ALWAYS_PRINT);
- getToHTMLRenderer(req).getConfig().setOuputMode(ToHTMLConfig.OUTPUT_MODE_REMOVE);
- }
- else
+ getToHTMLRenderer(req).getConfig().setFilterMode(
+ ToHTMLConfig.FILTER_MODE_ALWAYS_PRINT);
+ getToHTMLRenderer(req).getConfig().setOuputMode(
+ ToHTMLConfig.OUTPUT_MODE_REMOVE);
+ } else
{
- getToHTMLRenderer(req).getConfig().setFilterMode(ToHTMLConfig.FILTER_MODE_NEVER_PRINT);
- getToHTMLRenderer(req).getConfig().setOuputMode(ToHTMLConfig.OUTPUT_MODE_REMOVE);
+ getToHTMLRenderer(req).getConfig().setFilterMode(
+ ToHTMLConfig.FILTER_MODE_NEVER_PRINT);
+ getToHTMLRenderer(req).getConfig().setOuputMode(
+ ToHTMLConfig.OUTPUT_MODE_REMOVE);
}
return formatTitle(req, text);
- } catch (Exception e) {
- //Now if something goes wrong it just returns message with bbcode.
+ } catch (Exception e)
+ {
+ // Now if something goes wrong it just returns message with bbcode.
return text;
}
-
+
}
-
+
/**
- *
+ *
* @param text
* @return
*/
public static String formatTitle(Object req, String text)
{
-
- StringWriter stringWriter = new StringWriter();
- getToHTMLRenderer(req).setWriter(stringWriter);
- getToHTMLRenderer(req).render(text.toCharArray(), 0, text.length());
- return stringWriter.toString();
+ StringWriter stringWriter = new StringWriter();
+ getToHTMLRenderer(req).setWriter(stringWriter);
+ getToHTMLRenderer(req).render(text.toCharArray(), 0, text.length());
+ return stringWriter.toString();
+
}
-
+
/**
- *
+ *
* @return
*/
- private static ToHTMLRenderer getToHTMLRenderer(Object req) {
+ private static ToHTMLRenderer getToHTMLRenderer(Object req)
+ {
ToHTMLRenderer renderer = null;
PortletRequest porReq = null;
HttpServletRequest serReq = null;
- if (req instanceof PortletRequest) {
- porReq = (PortletRequest)req;
- renderer = (ToHTMLRenderer)porReq.getPortletSession().getAttribute("RENDERER");
- } else {
- serReq = (HttpServletRequest)req;
+ if (req instanceof PortletRequest)
+ {
+ porReq = (PortletRequest) req;
+ renderer = (ToHTMLRenderer) porReq.getPortletSession()
+ .getAttribute("RENDERER");
+ } else
+ {
+ serReq = (HttpServletRequest) req;
// TODO: GETTING RENDERER FROM APPLICATION SCOPE ATTRIBUTE
}
- if (renderer == null) {
-
+ if (renderer == null)
+ {
+
// Getting ResourceBundle with current Locale
FacesContext ctx = FacesContext.getCurrentInstance();
UIViewRoot uiRoot = ctx.getViewRoot();
Locale locale = uiRoot.getLocale();
ClassLoader ldr = Thread.currentThread().getContextClassLoader();
- ResourceBundle bundle = ResourceBundle.getBundle("ResourceJSF", locale, ldr);
+ ResourceBundle bundle = ResourceBundle.getBundle("ResourceJSF",
+ locale, ldr);
// Create the HTMLRenderer for BBCode
ToHTMLConfig config = new ToHTMLConfig();
config.setLoader(loader);
renderer = new ToHTMLRenderer(config, bundle);
- if (porReq!=null) {
+ if (porReq != null)
+ {
porReq.getPortletSession().setAttribute("RENDERER", renderer);
- } else if (serReq!=null){
+ } else if (serReq != null)
+ {
// TODO: SETTING RENDERER IN APPLICATION SCOPE ATTRIBUTE
}
}
return renderer;
}
-
+
/**
- *
+ *
* @return
*/
public static Poll createPoll()
@@ -545,7 +592,7 @@
}
/**
- *
+ *
* @return
*/
public static PollOption createPollOption()
@@ -555,72 +602,90 @@
}
/**
- *
+ *
* @author sshah
- *
- *
+ *
+ *
*/
public static Message createMessage()
{
Message message = new MessageImpl();
return message;
}
-
+
/**
*
- *
+ *
*/
- public static float getVotePercent(Poll poll,PollOption option)
+ public static float getVotePercent(Poll poll, PollOption option)
{
float votePercent = 0;
-
- float votesSum = poll.getVotesSum();
- if(votesSum>0)
- {
- votePercent = (option.getVotes()/votesSum);
- }
-
+
+ float votesSum = poll.getVotesSum();
+ if (votesSum > 0)
+ {
+ votePercent = (option.getVotes() / votesSum);
+ }
+
return votePercent;
}
-
+
/**
*
- *
+ *
*/
- public static boolean isWatchingForum(Forum forum)
+ public static String isWatchingForum(Forum forum)
{
- boolean isWatchingForum = false;
+ String watchId = null;
- //check if this forum is being watched by the currently logged in user
+ try
+ {
+ User user = PortalUtil.getUser();
+ if (user==null)
+ {
+ return null;
+ }
+
+ Watch watch = BaseController.getForumsModule().findForumWatchByUserAndForum( user , forum.getId().intValue() );
+
+ if (watch!=null)
+ {
+ return watch.getId().toString();
+ }
+
+ } catch (Exception e)
+ {
+ JSFUtil.handleException(e);
+ }
- return isWatchingForum;
+ return watchId;
}
-
+
/**
*
- * This is for handling attachments in the portal environment
- * Created on Jul 13, 2006
- *
+ * This is for handling attachments in the portal environment Created on Jul
+ * 13, 2006
+ *
* @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
*/
private static ThreadLocal uploadedAttachment = new ThreadLocal();
-
+
/**
*
- *
+ *
*/
public static void setUploadedAttachment(TempFileBinding attachment)
{
PortalUtil.uploadedAttachment.set(attachment);
}
-
+
/**
*
- *
+ *
*/
public static TempFileBinding getUploadedAttachment()
{
- return (TempFileBinding)PortalUtil.uploadedAttachment.get();
- }
+ return (TempFileBinding) PortalUtil.uploadedAttachment.get();
+ }
}
Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties 2007-02-28 00:13:12 UTC (rev 9828)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties 2007-02-28 00:17:44 UTC (rev 9829)
@@ -306,6 +306,10 @@
New_posts_hot=New posts [ Popular ]
No_new_posts_locked=No new posts [ Locked ]
New_posts_locked=New posts [ Locked ]
+No_new_posts_sticky=No new posts [ Sticky ]
+New_posts_sticky=New posts [ Sticky ]
+No_new_posts_annoucement=No new posts [ Annoucement ]
+New_posts_annoucement=New posts [ Annoucement ]
Forum_is_locked=Forum is locked
Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2007-02-28 00:13:12 UTC (rev 9828)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2007-02-28 00:17:44 UTC (rev 9829)
@@ -158,7 +158,7 @@
<function>
<function-name>isWatchingForum</function-name>
<function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class>
- <function-signature>boolean isWatchingForum(org.jboss.portlet.forums.model.Forum)</function-signature>
+ <function-signature>java.lang.String isWatchingForum(org.jboss.portlet.forums.model.Forum)</function-signature>
</function>
<!--
Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml 2007-02-28 00:13:12 UTC (rev 9828)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml 2007-02-28 00:17:44 UTC (rev 9829)
@@ -25,11 +25,12 @@
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
- xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
- class="bb"
->
+ class="forumscontainer"
+>
+
<ui:composition template="/views/common/common.xhtml">
<ui:define name="mainContent">
@@ -39,492 +40,768 @@
<!-- make sure the user is allowed to access both the specified forum and the category that this forum belongs to -->
<forums:isAllowed fragment="acl://readCategory" contextData="#{forum.forum.category}">
<forums:isAllowed fragment="acl://readForum" contextData="#{forum.forum}">
+
+ <div class="forumbread">
+ <ul>
+ <li class="first">
+
+ <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+ <h:outputText value="#{shared.mainPageName}"/>
+ </h:outputLink>
+
+ <ul>
+ <li>>
+ <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}">
+ <f:param name="c" value="#{forum.forum.category.id}"/>
+ <h:outputText value="#{forum.forum.category.title}"/>
+ </h:outputLink>
+
+ <ul>
+ <li>>
+ <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <h:outputText value="#{forum.forum.name}"/>
+ </h:outputLink>
+ </li>
+ </ul>
+
+ </li>
+ </ul>
+
+ </li>
+ </ul>
+ </div>
<h:form>
-
- <!-- title, newtopic, forum, and page navigation -->
- <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
- <tr>
- <td align="left" valign="bottom" colspan="2">
- <input type="hidden" name="f" value="#{forum.forum.id}" />
- <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}" styleClass="maintitle">
- <f:param name="f" value="#{forum.forum.id}"/>
- <h:outputText value="#{forum.forum.name}"/>
- </h:outputLink>
- </td>
- </tr>
- <tr>
- <forums:isAllowed fragment="acl://newTopic" contextData="#{forum}">
- <td align="left" valign="middle" width="50" colspan="2">
+
+ <c:if test="#{shared.anonymous==false}">
+ <div class="forumfloatright">
+ <c:choose>
+ <c:when test="#{forums:isWatchingForum(forum.forum) ne null}">
+ <h:commandLink action="#{forumWatch.deActivateWatch}">
+ <f:param name="w" value="#{forums:isWatchingForum(forum.forum)}" />
+ <img src="#{forums:themeURL('resourceIconUnSubscribeURL')}"
+ alt="${resource.Unsubscribe_from_forum}"
+ name="unSubscribe"
+ border="0"
+ id="unSubscribe" />
+ </h:commandLink>
+ </c:when>
+ <c:otherwise>
+ <h:outputLink value="#{forums:outputLink(shared.links['forumWatch'],true)}">
+ <img src="#{forums:themeURL('resourceIconSubscribeURL')}"
+ alt="${resource.Subscribe_to_forum}"
+ name="subscribe"
+ border="0"
+ id="subscribe" />
+ </h:outputLink>
+ </c:otherwise>
+ </c:choose>
+ </div>
+ </c:if>
+
+ <div class="forumtitletext">
+ <input type="hidden" name="f" value="#{forum.forum.id}" />
+ <h4>
+ <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <h:outputText value="#{forum.forum.name}" />
+ </h:outputLink>
+ </h4>
+ </div>
+
+
+<!-- TODO: MISSING DESIGN -->
+ <!-- page navigation -->
+ <c:if test="#{forum.pageNavigator.totalPages gt 100}">
+ <td align="right" valign="middle" nowrap="nowrap">
+ <span class="gensmall"></span><br/>
+ <span class="nav">
+ ${resource.Goto_page}
+ <!-- previous link -->
+ <c:if test="#{forum.pageNavigator.pageNumber gt 1}">
+   
+ <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <f:param name="page" value="#{forum.pageNavigator.currentPage-1}"/>
+ <h:outputText value="${resource.Previous}"/>
+ </h:outputLink>
+   
+ </c:if>
+ <!-- actual pages -->
+ <c:forEach items="#{forum.pageNavigator.pages}" var="page" varStatus="idx">
+ <c:choose>
+ <c:when test="#{forum.pageNavigator.pageNumber==page}">
+ <b>${page}</b>
+ </c:when>
+ <c:otherwise>
+ <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <f:param name="page" value="#{page-1}"/>
+ <h:outputText value="${page}"/>
+ </h:outputLink>
+ </c:otherwise>
+ </c:choose>
+ <c:if test="${idx.index-1 ne forum.pageNavigator.totalPages-1}">
+ <f:verbatim>,</f:verbatim>
+ </c:if>
+ </c:forEach>
+ <!-- Next link -->
+ <c:if test="#{forum.pageNavigator.pageNumber lt forum.pageNavigator.totalPages}">
+   
+ <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <f:param name="page" value="#{forum.pageNavigator.currentPage+1}"/>
+ <h:outputText value="${resource.Next}"/>
+ </h:outputLink>
+   
+ </c:if>
+ </span>
+ </td>
+ </c:if>
+
+ <div class="forumpagination">
+ <ul>
+ <li class="disablepage">
+ <h:outputFormat value="#{resource.PageNumber}">
+ <f:param value="${forum.pageNavigator.pageNumber}"/>
+ <f:param value="${forum.pageNavigator.totalPages}"/>
+ </h:outputFormat>
+ </li>
+ <li class="disablepage">First</li>
+ <li class="disablepage">< Previous</li>
+ <li class="currentpage">1</li>
+ <li><a href="#">2</a></li>
+ <li><a href="#">3</a></li>
+ <li><a href="#">4</a></li>
+ <li><a href="#">5</a></li>
+ <li><a href="#">6</a></li>
+ <li><a href="#">7</a></li>
+ <li><a href="#">8</a></li>
+ <li><a href="#">Next ></a></li>
+ <li><a href="#">Last</a></li>
+ </ul>
+ </div>
+<!-- TODO: MISSING DESING - END -->
+
+ <forums:isAllowed fragment="acl://newTopic" contextData="#{forum.forum}">
+ <div class="actionbuttons">
+ <ul>
+ <li>
+ <h:commandLink id="newTopic" action="#{newTopic.start}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <c:if test="#{forum.forum.status == forums:constantInt('FORUM_LOCKED')}">
+ <f:verbatim>
+ <img border="0"
+ src="#{forums:themeURL('resourcePostLockedURL')}"
+ alt="${resource.Forum_locked}"/>
+ </f:verbatim>
+ </c:if>
+ <c:if test="#{forum.forum.status != forums:constantInt('FORUM_LOCKED')}">
+ <f:verbatim>
+ <img border="0"
+ src="#{forums:themeURL('resourcePostNewURL')}"
+ alt="${resource.Post_new_topic}" />
+ </f:verbatim>
+ </c:if>
+ </h:commandLink>
+ </li>
+ </ul>
+ </div>
+ </forums:isAllowed>
+
+ <!-- display the list of topics associated with this forum -->
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+ <tr class="header">
+ <td class="forumheaderfirst" colspan="2">${resource.Topics}</td>
+ <td class="forumheadercentered">${resource.Replies}</td>
+ <td class="forumheadercentered">${resource.Views}</td>
+ <td class="forumheaderlast">${resource.Last_Post}</td>
+ </tr>
+
+ <c:choose>
+ <c:when test="#{forum.forum.topicCount>0}">
+ <c:if test="#{forum.announcementsPresent}">
+ <!-- Announcement threads -->
- <h:commandLink id="newTopic" action="#{newTopic.start}">
- <f:param name="f" value="#{forum.forum.id}"/>
- <c:if test="#{forum.forum.status == forums:constantInt('FORUM_LOCKED')}">
- <f:verbatim>
- <img border="0"
- src="#{forums:themeURL('resourcePostLockedURL')}"
- alt="${resource.Forum_locked}"
- />
- </f:verbatim>
- </c:if>
- <c:if test="#{forum.forum.status != forums:constantInt('FORUM_LOCKED')}">
- <f:verbatim>
- <img border="0"
- src="#{forums:themeURL('resourcePostNewURL')}"
- alt="${resource.Post_new_topic}"
- />
- </f:verbatim>
- </c:if>
- </h:commandLink>
- </td>
- </forums:isAllowed>
- <td align="left" valign="middle" class="nav" width="100%">
- <span class="nav">
-    
- <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}" styleClass="nav">
- <h:outputText value="#{shared.mainPageName}"/>
- </h:outputLink>
- ->
- <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}" styleClass="nav">
- <f:param name="c" value="#{forum.forum.category.id}"/>
- <h:outputText value="#{forum.forum.category.title}"/>
- </h:outputLink>
- ->
- <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}" styleClass="nav">
- <f:param name="f" value="#{forum.forum.id}"/>
- <h:outputText value="#{forum.forum.name}"/>
- </h:outputLink>
- </span>
- </td>
- <!-- page navigation -->
- <c:if test="#{forum.pageNavigator.totalPages gt 1}">
- <td align="right" valign="middle" nowrap="nowrap">
- <span class="gensmall"></span><br/>
- <span class="nav">
- ${resource.Goto_page}
- <!-- previous link -->
- <c:if test="#{forum.pageNavigator.pageNumber gt 1}">
-   
- <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
- <f:param name="f" value="#{forum.forum.id}"/>
- <f:param name="page" value="#{forum.pageNavigator.currentPage-1}"/>
- <h:outputText value="${resource.Previous}"/>
- </h:outputLink>
-   
- </c:if>
- <!-- actual pages -->
- <c:forEach items="#{forum.pageNavigator.pages}" var="page" varStatus="idx">
- <c:choose>
- <c:when test="#{forum.pageNavigator.pageNumber==page}">
- <b>${page}</b>
- </c:when>
- <c:otherwise>
- <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
- <f:param name="f" value="#{forum.forum.id}"/>
- <f:param name="page" value="#{page-1}"/>
- <h:outputText value="${page}"/>
- </h:outputLink>
- </c:otherwise>
- </c:choose>
- <c:if test="${idx.index-1 ne forum.pageNavigator.totalPages-1}">
- <f:verbatim>,</f:verbatim>
- </c:if>
- </c:forEach>
- <!-- Next link -->
- <c:if test="#{forum.pageNavigator.pageNumber lt forum.pageNavigator.totalPages}">
-   
- <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
- <f:param name="f" value="#{forum.forum.id}"/>
- <f:param name="page" value="#{forum.pageNavigator.currentPage+1}"/>
- <h:outputText value="${resource.Next}"/>
- </h:outputLink>
-   
- </c:if>
- </span>
- </td>
- </c:if>
- </tr>
- </table>
-
-
- <!-- display the list of topics associated with this forum -->
- <table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
- <tr>
- <th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap">
-  ${resource.Topics} 
- </th>
- <th width="50" align="center" class="thTop" nowrap="nowrap"> ${resource.Replies} </th>
- <th width="100" align="center" class="thTop" nowrap="nowrap"> ${resource.Author} </th>
- <th width="50" align="center" class="thTop" nowrap="nowrap"> ${resource.Views} </th>
- <th align="center" class="thCornerR" nowrap="nowrap"> ${resource.Last_Post} </th>
- </tr>
- <c:choose>
- <c:when test="#{forum.forum.topicCount>0}">
- <c:if test="#{forum.announcementsPresent}">
- <!-- Announcement threads -->
- <tr>
- <td class="catLeft" colspan="2" height="28">
- <span class="cattitle">
- <a href="" class="cattitle">
- <span>${resource.Announcements}</span>
- </a>
- </span>
- </td>
- <td class="rowpic" colspan="3" align="right"> </td>
- </tr>
- <c:forEach items="#{forum.announcements}" var="topicrow">
- <tr>
- <td class="row1" align="center" valign="middle" width="20">
- <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}" width="19" height="18"
- alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
- </td>
- <td class="row1" width="100%">
- <span class="topictitle">
- <!-- view newest post image -->
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" style="text-decoration: none;"
- alt="#{resource.View_latest_post}" title="#{resource.View_latest_post}">
- <f:param name="t" value="#{topicrow.id}"/>
- <f:verbatim>
- <img border="0" src="#{forums:themeURL('resourceIconLatestReplyURL')}"/>
- </f:verbatim>
- </h:outputLink>
- <!-- topicType -->
- <b>${resource.Topic_Announcement}</b>
- <!-- description of the topic -->
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" styleClass="topictitle">
- <f:param name="t" value="${topicrow.id}"/>
- <h:outputText value="${topicrow.subject}"/>
- </h:outputLink>
- </span>
- <!-- mini post navigator for this topic -->
- <c:if test="#{forum.topicNavigator[topicrow.id] ne null && forum.topicNavigator[topicrow.id].totalPages gt 1}">
- <span class="gensmall">
- <br/>
- <img src="#{forums:themeURL('resourceIconMinipostURL')}" alt="Goto page" title="Goto page"/>${resource.Goto_page}:
- [
- <c:forEach items="#{forum.topicNavigator[topicrow.id].pages}" var="page" varStatus="idx">
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
- <f:param name="t" value="#{topicrow.id}"/>
- <f:param name="page" value="#{page-1}"/>
- <h:outputText value="${page}"/>
- </h:outputLink>
- <c:if test="${idx.index-1 ne forum.topicNavigator[topicrow.id].totalPages-1}">
- <f:verbatim>,</f:verbatim>
- </c:if>
- </c:forEach>
- ]
- </span>
- </c:if>
- </td>
- <td class="row2" align="center" valign="middle">
- <span class="postdetails">
- ${topicrow.replies}
- </span>
- </td>
- <td class="row3" align="center" valign="middle">
- <span class="name">
- ${topicrow.poster.user.userName}
- </span>
- </td>
- <td class="row2" align="center" valign="middle">
- <span class="postdetails">
- ${topicrow.viewCount}
- </span>
- </td>
- <td class="row3Right" align="center" valign="middle" nowrap="nowrap">
- <span class="postdetails">
- <!-- date of the last post on this topic -->
- #{forums:dateStr(topicrow.lastPostDate)}
- <br/>
- <!-- last post poster on this topic -->
- <c:choose>
- <c:when test="#{forum.anonymous}">
- ${forum.topicLastPosts[topicrow.id].poster.user.userName}
- </c:when>
- <c:otherwise>
- <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
- <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
- <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
- </h:outputLink>
- </c:otherwise>
- </c:choose>
- <!-- link to the last post in the topic -->
- <h:outputLink value="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}"
- style="text-decoration: none;"
- alt="#{resource.View_latest_post}"
- title="#{resource.View_latest_post}" >
- <f:verbatim>
- <img src="#{forums:themeURL('resourceIconLatestReplyURL')}" border="0"/>
- </f:verbatim>
- </h:outputLink>
- </span>
- </td>
- </tr>
- </c:forEach>
- </c:if>
- <c:if test="#{forum.stickyThreadsPresent}">
- <!-- Sticky Threads -->
- <tr>
- <td class="catLeft" colspan="2" height="28">
- <span class="cattitle">
- <a href="" class="cattitle">
- <span>${resource.Sticky_Threads}</span>
- </a>
- </span>
- </td>
- <td class="rowpic" colspan="3" align="right"> </td>
- </tr>
- <c:forEach items="#{forum.stickyThreads}" var="topicrow">
- <tr>
- <td class="row1" align="center" valign="middle" width="20">
- <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}" width="19" height="18"
- alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
- </td>
- <td class="row1" width="100%">
- <span class="topictitle">
- <!-- view newest post image -->
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" style="text-decoration: none;"
- alt="#{resource.View_latest_post}" title="#{resource.View_latest_post}">
- <f:param name="t" value="#{topicrow.id}"/>
- <f:verbatim>
- <img border="0" src="#{forums:themeURL('resourceIconLatestReplyURL')}"/>
- </f:verbatim>
- </h:outputLink>
- <!-- topicType -->
- <b>${resource.Topic_Sticky}</b>
- <!-- description of the topic -->
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" styleClass="topictitle">
- <f:param name="t" value="${topicrow.id}"/>
- <h:outputText value="${topicrow.subject}"/>
- </h:outputLink>
- </span>
- <!-- mini post navigator for this topic -->
- <c:if test="#{forum.topicNavigator[topicrow.id] ne null && forum.topicNavigator[topicrow.id].totalPages gt 1}">
- <span class="gensmall">
- <br/>
- <img src="#{forums:themeURL('resourceIconMinipostURL')}" alt="Goto page" title="Goto page"/>${resource.Goto_page}:
- [
- <c:forEach items="#{forum.topicNavigator[topicrow.id].pages}" var="page" varStatus="idx">
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
- <f:param name="t" value="#{topicrow.id}"/>
- <f:param name="page" value="#{page-1}"/>
- <h:outputText value="${page}"/>
- </h:outputLink>
- <c:if test="${idx.index-1 ne forum.topicNavigator[topicrow.id].totalPages-1}">
- <f:verbatim>,</f:verbatim>
- </c:if>
- </c:forEach>
- ]
- </span>
- </c:if>
- </td>
- <td class="row2" align="center" valign="middle">
- <span class="postdetails">
- ${topicrow.replies}
- </span>
- </td>
- <td class="row3" align="center" valign="middle">
- <span class="name">
- ${topicrow.poster.user.userName}
- </span>
- </td>
- <td class="row2" align="center" valign="middle">
- <span class="postdetails">
- ${topicrow.viewCount}
- </span>
- </td>
- <td class="row3Right" align="center" valign="middle" nowrap="nowrap">
- <span class="postdetails">
- <!-- date of the last post on this topic -->
- #{forums:dateStr(topicrow.lastPostDate)}
- <br/>
- <!-- last post poster on this topic -->
- <c:choose>
- <c:when test="#{forum.anonymous}">
- ${forum.topicLastPosts[topicrow.id].poster.user.userName}
- </c:when>
- <c:otherwise>
- <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
- <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
- <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
- </h:outputLink>
- </c:otherwise>
- </c:choose>
- <!-- link to the last post in the topic -->
- <h:outputLink value="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}"
- style="text-decoration: none;"
- alt="#{resource.View_latest_post}"
- title="#{resource.View_latest_post}" >
- <f:verbatim>
- <img src="#{forums:themeURL('resourceIconLatestReplyURL')}" border="0"/>
- </f:verbatim>
- </h:outputLink>
- </span>
- </td>
- </tr>
- </c:forEach>
- </c:if>
- <c:if test="#{forum.normalThreadsPresent}">
- <!-- Normal threads -->
- <tr>
- <td class="catLeft" colspan="2" height="28">
- <span class="cattitle">
- <a href="" class="cattitle">
- <span>${resource.Normal_Threads}</span>
- </a>
- </span>
- </td>
- <td class="rowpic" colspan="3" align="right"> </td>
- </tr>
- <c:forEach items="#{forum.normalThreads}" var="topicrow">
- <tr>
- <td class="row1" align="center" valign="middle" width="20">
- <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}" width="19" height="18"
- alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
- </td>
- <td class="row1" width="100%">
- <span class="topictitle">
- <!-- view newest post image -->
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" style="text-decoration: none;"
- alt="#{resource.View_latest_post}" title="#{resource.View_latest_post}">
- <f:param name="t" value="#{topicrow.id}"/>
- <f:verbatim>
- <img border="0" src="#{forums:themeURL('resourceIconLatestReplyURL')}"/>
- </f:verbatim>
- </h:outputLink>
- <!-- topicType (Normal) no need to specify -->
- <!-- description of the topic -->
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}" styleClass="topictitle">
- <f:param name="t" value="${topicrow.id}"/>
- <h:outputText value="${topicrow.subject}"/>
- </h:outputLink>
- </span>
- <!-- mini post navigator for this topic -->
- <c:if test="#{forum.topicNavigator[topicrow.id] ne null && forum.topicNavigator[topicrow.id].totalPages gt 1}">
- <span class="gensmall">
- <br/>
- <img src="#{forums:themeURL('resourceIconMinipostURL')}" alt="Goto page" title="Goto page"/>${resource.Goto_page}:
- [
- <c:forEach items="#{forum.topicNavigator[topicrow.id].pages}" var="page" varStatus="idx">
- <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
- <f:param name="t" value="#{topicrow.id}"/>
- <f:param name="page" value="#{page-1}"/>
- <h:outputText value="${page}"/>
- </h:outputLink>
- <c:if test="${idx.index-1 ne forum.topicNavigator[topicrow.id].totalPages-1}">
- <f:verbatim>,</f:verbatim>
- </c:if>
- </c:forEach>
- ]
- </span>
- </c:if>
- </td>
- <td class="row2" align="center" valign="middle">
- <span class="postdetails">
- ${topicrow.replies}
- </span>
- </td>
- <td class="row3" align="center" valign="middle">
- <span class="name">
- ${topicrow.poster.user.userName}
- </span>
- </td>
- <td class="row2" align="center" valign="middle">
- <span class="postdetails">
- ${topicrow.viewCount}
- </span>
- </td>
- <td class="row3Right" align="center" valign="middle" nowrap="nowrap">
- <span class="postdetails">
- <!-- date of the last post on this topic -->
- #{forums:dateStr(topicrow.lastPostDate)}
- <br/>
- <!-- last post poster on this topic -->
- <c:choose>
- <c:when test="#{forum.anonymous}">
- ${forum.topicLastPosts[topicrow.id].poster.user.userName}
- </c:when>
- <c:otherwise>
- <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
- <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
- <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
- </h:outputLink>
- </c:otherwise>
- </c:choose>
- <!-- link to the last post in the topic -->
- <h:outputLink value="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}"
- style="text-decoration: none;"
- alt="#{resource.View_latest_post}"
- title="#{resource.View_latest_post}" >
- <f:verbatim>
- <img src="#{forums:themeURL('resourceIconLatestReplyURL')}" border="0"/>
- </f:verbatim>
- </h:outputLink>
- </span>
- </td>
- </tr>
- </c:forEach>
- </c:if>
- </c:when>
- <c:otherwise>
- <tr>
- <td class="row1" colspan="6" height="30" align="center" valign="middle">
- <span class="gen">
- ${resource.No_topics_post_one}
- </span>
- </td>
+ <tr>
+ <td class="forumspecialized" colspan="5">
+ <h3>
+ ${resource.Announcements}
+ </h3>
+ </td>
+ </tr>
+
+ <c:forEach items="#{forum.announcements}" var="topicrow" varStatus="status" >
+ <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+ <td class="forumlisticon">
+ <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}"
+ width="11" height="14"
+ alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
+ </td>
+ <td>
+ <h3>
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="${topicrow.id}"/>
+ <h:outputText value="${topicrow.subject}"/>
+ </h:outputLink>
+ </h3>
+
+ <!-- mini post navigator for this topic -->
+ <c:if test="#{forum.topicNavigator[topicrow.id] ne null && forum.topicNavigator[topicrow.id].totalPages gt 1}">
+  ( 
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="0"/>
+ <h:outputText value="${1}"/>
+ </h:outputLink>
+  
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="1"/>
+ <h:outputText value="${2}"/>
+ </h:outputLink>
+ <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 2}">
+  
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="2"/>
+ <h:outputText value="${3}"/>
+ </h:outputLink>
+ </c:if>
+ <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 3}">
+  … 
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="#{forum.topicNavigator[topicrow.id].totalPages-1}"/>
+ <h:outputText value="${resource.Last_page}"/>
+ </h:outputLink>
+ </c:if>
+  )
+ </c:if>
+ <br />
+ ${resource.By} 
+ <c:choose>
+
+ <c:when test="#{category.anonymous}">
+ ${topicrow.poster.user.userName}
+ </c:when>
+
+ <c:otherwise>
+ <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+ <f:param name="uid" value="${topicrow.poster.user.id}"/>
+ <h:outputText value="${topicrow.poster.user.userName}"/>
+ </h:outputLink>
+ </c:otherwise>
+
+ </c:choose>
+
+ </td>
+ <td class="forumlistcentered">${topicrow.replies}</td>
+ <td class="forumlistcentered">${topicrow.viewCount}</td>
+ <td class="forumlistlast">
+ <a href="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}">
+ <c:choose>
+
+ <c:when test="#{forums:isLongerThan(forum.topicLastPosts[topicrow.id].message.subject,25)}">
+ #{forums:subString(forum.topicLastPosts[topicrow.id].message.subject,25)}…
+ </c:when>
+
+ <c:otherwise>
+ #{forum.topicLastPosts[topicrow.id].message.subject}
+ </c:otherwise>
+
+ </c:choose>
+ </a>
+ <br />
+ ${resource.By}
+ <c:choose>
+
+ <c:when test="#{category.anonymous}">
+ ${forum.topicLastPosts[topicrow.id].poster.user.userName}
+ </c:when>
+
+ <c:otherwise>
+ <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+ <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
+ <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
+ </h:outputLink>
+ </c:otherwise>
+
+ </c:choose>
+ <br />
+ #{forum.topicLastPosts[topicrow.id].createDate}
+ </td>
+ </tr>
+
+ </c:forEach>
+ </c:if>
+
+ <c:if test="#{forum.stickyThreadsPresent}">
+ <!-- Sticky Threads -->
+
+ <tr>
+ <td class="forumspecialized" colspan="5">
+ <h3>
+ ${resource.Sticky_Threads}
+ </h3>
+ </td>
+ </tr>
+
+ <c:forEach items="#{forum.stickyThreads}" var="topicrow" varStatus="status" >
+ <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+ <td class="forumlisticon">
+ <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}"
+ width="11" height="14"
+ alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
+ </td>
+ <td>
+ <h3>
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="${topicrow.id}"/>
+ <h:outputText value="${topicrow.subject}"/>
+ </h:outputLink>
+ </h3>
+
+ <!-- mini post navigator for this topic -->
+ <c:if test="#{forum.topicNavigator[topicrow.id] ne null && forum.topicNavigator[topicrow.id].totalPages gt 1}">
+  ( 
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="0"/>
+ <h:outputText value="${1}"/>
+ </h:outputLink>
+  
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="1"/>
+ <h:outputText value="${2}"/>
+ </h:outputLink>
+ <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 2}">
+  
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="2"/>
+ <h:outputText value="${3}"/>
+ </h:outputLink>
+ </c:if>
+ <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 3}">
+  … 
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="#{forum.topicNavigator[topicrow.id].totalPages-1}"/>
+ <h:outputText value="${resource.Last_page}"/>
+ </h:outputLink>
+ </c:if>
+  )
+ </c:if>
+ <br />
+ ${resource.By} 
+ <c:choose>
+
+ <c:when test="#{category.anonymous}">
+ ${topicrow.poster.user.userName}
+ </c:when>
+
+ <c:otherwise>
+ <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+ <f:param name="uid" value="${topicrow.poster.user.id}"/>
+ <h:outputText value="${topicrow.poster.user.userName}"/>
+ </h:outputLink>
+ </c:otherwise>
+
+ </c:choose>
+
+ </td>
+ <td class="forumlistcentered">${topicrow.replies}</td>
+ <td class="forumlistcentered">${topicrow.viewCount}</td>
+ <td class="forumlistlast">
+ <a href="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}">
+ <c:choose>
+
+ <c:when test="#{forums:isLongerThan(forum.topicLastPosts[topicrow.id].message.subject,25)}">
+ #{forums:subString(forum.topicLastPosts[topicrow.id].message.subject,25)}…
+ </c:when>
+
+ <c:otherwise>
+ #{forum.topicLastPosts[topicrow.id].message.subject}
+ </c:otherwise>
+
+ </c:choose>
+ </a>
+ <br />
+ ${resource.By}
+ <c:choose>
+
+ <c:when test="#{category.anonymous}">
+ ${forum.topicLastPosts[topicrow.id].poster.user.userName}
+ </c:when>
+
+ <c:otherwise>
+ <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+ <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
+ <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
+ </h:outputLink>
+ </c:otherwise>
+
+ </c:choose>
+ <br />
+ #{forum.topicLastPosts[topicrow.id].createDate}
+ </td>
+ </tr>
+
+ </c:forEach>
+ </c:if>
+
+ <c:if test="#{forum.normalThreadsPresent}">
+ <!-- Normal threads -->
+ <tr>
+ <td class="forumspecialized" colspan="5">
+ <h3>
+ ${resource.Normal_Threads}
+ </h3>
+ </td>
+ </tr>
+
+ <c:forEach items="#{forum.normalThreads}" var="topicrow" varStatus="status" >
+ <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+ <td class="forumlisticon">
+ <img src="#{forums:folderTypeURL(topicrow,forum.anonymous)}"
+ width="11" height="14"
+ alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
+ </td>
+ <td>
+ <h3>
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="${topicrow.id}"/>
+ <h:outputText value="${topicrow.subject}"/>
+ </h:outputLink>
+ </h3>
+
+ <!-- mini post navigator for this topic -->
+ <c:if test="#{forum.topicNavigator[topicrow.id] ne null && forum.topicNavigator[topicrow.id].totalPages gt 1}">
+  ( 
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="0"/>
+ <h:outputText value="${1}"/>
+ </h:outputLink>
+  
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="1"/>
+ <h:outputText value="${2}"/>
+ </h:outputLink>
+ <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 2}">
+  
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="2"/>
+ <h:outputText value="${3}"/>
+ </h:outputLink>
+ </c:if>
+ <c:if test="#{forum.topicNavigator[topicrow.id].totalPages gt 3}">
+  … 
+ <h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
+ <f:param name="t" value="#{topicrow.id}"/>
+ <f:param name="page" value="#{forum.topicNavigator[topicrow.id].totalPages-1}"/>
+ <h:outputText value="${resource.Last_page}"/>
+ </h:outputLink>
+ </c:if>
+  )
+ </c:if>
+ <br />
+ ${resource.By} 
+ <c:choose>
+
+ <c:when test="#{category.anonymous}">
+ ${topicrow.poster.user.userName}
+ </c:when>
+
+ <c:otherwise>
+ <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+ <f:param name="uid" value="${topicrow.poster.user.id}"/>
+ <h:outputText value="${topicrow.poster.user.userName}"/>
+ </h:outputLink>
+ </c:otherwise>
+
+ </c:choose>
+
+ </td>
+ <td class="forumlistcentered">${topicrow.replies}</td>
+ <td class="forumlistcentered">${topicrow.viewCount}</td>
+ <td class="forumlistlast">
+ <a href="#{forums:postPermlink(forum.topicLastPosts[topicrow.id].id)}">
+ <c:choose>
+
+ <c:when test="#{forums:isLongerThan(forum.topicLastPosts[topicrow.id].message.subject,25)}">
+ #{forums:subString(forum.topicLastPosts[topicrow.id].message.subject,25)}…
+ </c:when>
+
+ <c:otherwise>
+ #{forum.topicLastPosts[topicrow.id].message.subject}
+ </c:otherwise>
+
+ </c:choose>
+ </a>
+ <br />
+ ${resource.By}
+ <c:choose>
+
+ <c:when test="#{category.anonymous}">
+ ${forum.topicLastPosts[topicrow.id].poster.user.userName}
+ </c:when>
+
+ <c:otherwise>
+ <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+ <f:param name="uid" value="#{forum.topicLastPosts[topicrow.id].poster.user.id}"/>
+ <h:outputText value="${forum.topicLastPosts[topicrow.id].poster.user.userName}"/>
+ </h:outputLink>
+ </c:otherwise>
+
+ </c:choose>
+ <br />
+ #{forum.topicLastPosts[topicrow.id].createDate}
+ </td>
+ </tr>
+
+ </c:forEach>
+ </c:if>
+
+ </c:when>
+
+ <c:otherwise>
+ <tr>
+ <td class="nonewpostRow" colspan="6">
+ <h3>
+ ${resource.No_topics_post_one}
+ </h3>
+ </td>
</tr>
- </c:otherwise>
- </c:choose>
- </table>
-
-
- <!-- newtopic, forum, and page navigation -->
- <table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
- <tr>
- <forums:isAllowed fragment="acl://newTopic" contextData="#{forum}">
- <td align="left" valign="middle" width="50">
- <h:commandLink id="newTopic2" action="#{newTopic.start}">
- <f:param name="f" value="#{forum.forum.id}"/>
- <c:if test="#{forum.forum.status == forums:constantInt('FORUM_LOCKED')}">
- <f:verbatim>
- <img border="0"
- src="#{forums:themeURL('resourcePostLockedURL')}"
- alt="${resource.Forum_locked}"
- />
- </f:verbatim>
- </c:if>
- <c:if test="#{forum.forum.status != forums:constantInt('FORUM_LOCKED')}">
- <f:verbatim>
- <img border="0"
- src="#{forums:themeURL('resourcePostNewURL')}"
- alt="${resource.Post_new_topic}"
- />
- </f:verbatim>
- </c:if>
- </h:commandLink>
- </td>
- </forums:isAllowed>
- <td align="left" valign="middle" width="100%">
- <span class="nav">
-    
- <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}" styleClass="nav">
- <h:outputText value="#{shared.mainPageName}"/>
- </h:outputLink>
- ->
- <h:outputLink value="#{forums:outputLink(shared.links['category'],true)}" styleClass="nav">
- <f:param name="c" value="#{forum.forum.category.id}"/>
- <h:outputText value="#{forum.forum.category.title}"/>
- </h:outputLink>
- ->
- <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}" styleClass="nav">
- <f:param name="f" value="#{forum.forum.id}"/>
- <h:outputText value="#{forum.forum.name}"/>
- </h:outputLink>
- </span>
- </td>
+ </c:otherwise>
+ </c:choose>
+ </table>
+
+ <c:if test="#{forum.pageNavigator.totalPages gt 1}">
+ <div class="forumpagination">
+ <ul>
+ <li class="disablepage">
+ <h:outputFormat value="#{resource.PageNumber}">
+ <f:param value="${forum.pageNavigator.pageNumber}"/>
+ <f:param value="${forum.pageNavigator.totalPages}"/>
+ </h:outputFormat>
+ </li>
+ <li class="disablepage">First</li>
+ <li class="disablepage">< Previous</li>
+ <li class="currentpage">1</li>
+ <li><a href="#">2</a></li>
+ <li><a href="#">3</a></li>
+ <li><a href="#">4</a></li>
+ <li><a href="#">5</a></li>
+ <li><a href="#">6</a></li>
+ <li><a href="#">7</a></li>
+ <li><a href="#">8</a></li>
+ <li><a href="#">Next ></a></li>
+ <li><a href="#">Last</a></li>
+ </ul>
+ </div>
+ </c:if>
+
+ <!-- newtopic, forum, and page navigation -->
+ <forums:isAllowed fragment="acl://newTopic" contextData="#{forum.forum}">
+ <div class="actionbuttons">
+ <ul>
+ <li>
+ <h:commandLink id="newTopic" action="#{newTopic.start}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <c:if test="#{forum.forum.status == forums:constantInt('FORUM_LOCKED')}">
+ <f:verbatim>
+ <img border="0"
+ src="#{forums:themeURL('resourcePostLockedURL')}"
+ alt="${resource.Forum_locked}"/>
+ </f:verbatim>
+ </c:if>
+ <c:if test="#{forum.forum.status != forums:constantInt('FORUM_LOCKED')}">
+ <f:verbatim>
+ <img border="0"
+ src="#{forums:themeURL('resourcePostNewURL')}"
+ alt="${resource.Post_new_topic}" />
+ </f:verbatim>
+ </c:if>
+ </h:commandLink>
+ </li>
+ </ul>
+ </div>
+ </forums:isAllowed>
+
+ <c:if test="#{shared.anonymous==false}">
+ <forums:isAllowed fragment="acl://moderateForum" contextData="#{forum.forum}">
+ <div class="modtools">
+ <ul>
+ <li>
+ ${resource.Forum_moderation}:
+ </li>
+ <li>
+ <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <f:verbatim>
+ <img src="${forums:themeURL('resourceIconModerateURL')}" alt="${resource.Moderate}" border="0" />
+ </f:verbatim>
+ </h:outputLink>
+ </li>
+ </ul>
+ </div>
+ </forums:isAllowed>
+ </c:if>
+
+ <c:if test="#{shared.anonymous==false}">
+ <forums:isAllowed fragment="acl://lockForums" contextData="#{forum.forum}" >
+ <div class="admintools">
+ <ul>
+ <li>${resource.Forum_administration}:</li>
+ <li>
+ <c:choose>
+
+ <c:when test="#{forum.forum.status eq forums:constantInt('FORUM_LOCKED')}">
+ <h:commandLink action="#{adminController.unlockForum}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <f:param name="c" value="#{forum.forum.category.id}"/>
+ <f:verbatim>
+ <img src="${forums:themeURL('resourceIconUnlockURL')}" alt="${resource.Forum_unlock}" border="0"/>
+ </f:verbatim>
+ </h:commandLink>
+ </c:when>
+
+ <c:otherwise>
+ <h:commandLink action="#{adminController.lockForum}">
+ <f:param name="f" value="#{forum.forum.id}"/>
+ <f:param name="c" value="#{forum.forum.category.id}"/>
+ <f:verbatim>
+ <img src="${forums:themeURL('resourceIconLockURL')}" alt="${resource.Forum_lock}" border="0"/>
+ </f:verbatim>
+ </h:commandLink>
+ </c:otherwise>
+
+ </c:choose>
+ </li>
+ </ul>
+ </div>
+ </forums:isAllowed>
+ </c:if>
+
+
+ <hr class="forumdashedHR" />
+ <div class="forumthreadlegend">
+ <ul>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderNewURL')}"
+ alt="${resource.New_posts}" width="11" height="14" />
+ ${resource.New_posts}
+ </li>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderHotNewURL')}"
+ alt="${resource.New_posts_hot}" width="11" height="14" />
+ ${resource.New_posts_hot}
+ </li>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderLockedNewURL')}"
+ alt="${resource.New_posts_locked}" width="11" height="14" />
+ ${resource.New_posts_locked}
+ </li>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderStickyNewURL')}"
+ alt="${resource.Post_Sticky}" width="11" height="14" />
+ ${resource.New_posts_sticky}
+ </li>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderAnnounceNewURL')}"
+ alt="${resource.Post_Announcement}" width="11" height="14" />
+ ${resource.New_posts_annoucement}
+ </li>
+ </ul>
+ </div>
+ <div class="forumthreadlegend">
+ <ul>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderURL')}"
+ alt="${resource.No_new_posts}" width="11" height="14" />
+ ${resource.No_new_posts}
+ </li>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderHotURL')}"
+ alt="${resource.No_new_posts_hot}" width="11" height="14" />
+ ${resource.No_new_posts_hot}
+ </li>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderLockedURL')}"
+ alt="${resource.No_new_posts_locked}" width="11" height="14" />
+ ${resource.No_new_posts_locked}
+ </li>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderStickyURL')}"
+ alt="${resource.Post_Sticky}" width="11" height="14" />
+ ${resource.No_new_posts_sticky}
+ </li>
+ <li>
+ <img src="#{forums:themeURL('resourceFolderAnnounceURL')}"
+ alt="${resource.Post_Announcement}" width="11" height="14" />
+ ${resource.No_new_posts_annoucement}
+ </li>
+ </ul>
+ </div>
+ <div class="forumthreadlegendtext">
+
+ <!-- post new topics link -->
+ <forums:isAllowedChoose>
+ <forums:isAllowedWhen fragment="acl://newTopic">
+ ${resource.Rules_post_can}
+ </forums:isAllowedWhen>
+ <forums:isAllowedOtherwise>
+ ${resource.Rules_post_cannot}
+ </forums:isAllowedOtherwise>
+ </forums:isAllowedChoose>
+ <br />
+
+ <!-- manage poll link -->
+ <forums:isAllowedChoose>
+ <forums:isAllowedWhen fragment="acl://managePoll">
+ ${resource.Rules_poll_can}
+ </forums:isAllowedWhen>
+ <forums:isAllowedOtherwise>
+ ${resource.Rules_poll_cannot}
+ </forums:isAllowedOtherwise>
+ </forums:isAllowedChoose>
+ <br />
+
+ <!-- votePoll link -->
+ <forums:isAllowedChoose>
+ <forums:isAllowedWhen fragment="acl://votePoll">
+ ${resource.Rules_vote_can}
+ </forums:isAllowedWhen>
+ <forums:isAllowedOtherwise>
+ ${resource.Rules_vote_cannot}
+ </forums:isAllowedOtherwise>
+ </forums:isAllowedChoose>
+ <br />
+
+ <!-- moderate forum link -->
+ <forums:isAllowedChoose>
+ <forums:isAllowedWhen fragment="acl://moderateForum" contextData="#{forum.forum}">
+ ${resource.Rules_moderate_0}${resource.Rules_moderate_2}
+ </forums:isAllowedWhen>
+ <forums:isAllowedOtherwise>
+ ${resource.Rules_moderate_1}${resource.Rules_moderate_2}
+ </forums:isAllowedOtherwise>
+ </forums:isAllowedChoose>
+
+ </div>
+
+
+
+
<!-- page navigation -->
- <c:if test="#{forum.pageNavigator.totalPages gt 1}">
+ <c:if test="#{forum.pageNavigator.totalPages gt 100}">
<td align="right" valign="middle" nowrap="nowrap">
<span class="gensmall"></span><br/>
<span class="nav">
@@ -570,161 +847,36 @@
</span>
</td>
</c:if>
- </tr>
- <!-- the current page number information -->
- <c:if test="#{forum.pageNavigator.totalPages gt 1}">
- <tr>
- <td> </td>
- </tr>
- <tr>
- <td align="left" colspan="3">
- <span class="nav">
- <b>
- <h:outputFormat value="#{resource.PageNumber}">
- <f:param value="${forum.pageNavigator.pageNumber}"/>
- <f:param value="${forum.pageNavigator.totalPages}"/>
- </h:outputFormat>
- </b>
- </span>
- </td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- </c:if>
- </table>
- </h:form>
-
- <!-- displaying icons, permissions, and jumpbox -->
- <table width="100%" cellspacing="0" border="0" align="center" cellpadding="0">
- <tr>
- <td align="left" valign="top">
- <table cellspacing="3" cellpadding="0" border="0">
- <tr>
- <td width="20" align="left">
- <img src="#{forums:themeURL('resourceFolderNewURL')}" alt="${resource.New_posts}" width="19" height="18"/>
- </td>
- <td class="gensmall">${resource.New_posts}</td>
- <td>  </td>
- <td width="20" align="center">
- <img src="#{forums:themeURL('resourceFolderURL')}" alt="${resource.No_new_posts}" width="19" height="18"/>
- </td>
- <td class="gensmall">${resource.No_new_posts}</td>
- <td>  </td>
- <td width="20" align="center">
- <img src="#{forums:themeURL('resourceFolderAnnounceURL')}" alt="${resource.Post_Announcement}" width="19" height="18"/>
- </td>
- <td class="gensmall">${resource.Post_Announcement}</td>
- </tr>
- <tr>
- <td width="20" align="center">
- <img src="#{forums:themeURL('resourceFolderHotNewURL')}" alt="${resource.New_posts_hot}" width="19" height="18"/>
- </td>
- <td class="gensmall">${resource.New_posts_hot}</td>
- <td>  </td>
- <td width="20" align="center">
- <img src="#{forums:themeURL('resourceFolderHotURL')}" alt="${resource.No_new_posts_hot}" width="19" height="18"/>
- </td>
- <td class="gensmall">${resource.No_new_posts_hot}</td>
- <td>  </td>
- <td width="20" align="center">
- <img src="#{forums:themeURL('resourceFolderStickyURL')}" alt="${resource.Post_Sticky}" width="19" height="18"/>
- </td>
- <td class="gensmall">${resource.Post_Sticky}</td>
- </tr>
- <tr>
- <td class="gensmall">
- <img src="#{forums:themeURL('resourceFolderLockedNewURL')}" alt="${resource.New_posts_locked}" width="19" height="18"/>
- </td>
- <td class="gensmall">${resource.New_posts_locked}</td>
- <td>  </td>
- <td class="gensmall">
- <img src="#{forums:themeURL('resourceFolderLockedURL')}" alt="${resource.No_new_posts_locked}" width="19" height="18"/>
- </td>
- <td class="gensmall">${resource.No_new_posts_locked}</td>
- </tr>
- </table>
- </td>
- <td align="right">
- <span class="gensmall">
- <!-- a list of allowed actions on this forum for this user -->
- <span class="gensmall">
- <!-- post new topics link -->
- <forums:isAllowedChoose>
- <forums:isAllowedWhen fragment="acl://newTopic">
- ${resource.Rules_post_can}<br/>
- </forums:isAllowedWhen>
- <forums:isAllowedOtherwise>
- ${resource.Rules_post_cannot}<br/>
- </forums:isAllowedOtherwise>
- </forums:isAllowedChoose>
-
- <!-- manage poll link -->
- <forums:isAllowedChoose>
- <forums:isAllowedWhen fragment="acl://managePoll">
- ${resource.Rules_poll_can}<br/>
- </forums:isAllowedWhen>
- <forums:isAllowedOtherwise>
- ${resource.Rules_poll_cannot}<br/>
- </forums:isAllowedOtherwise>
- </forums:isAllowedChoose>
-
- <!-- votePoll link -->
- <forums:isAllowedChoose>
- <forums:isAllowedWhen fragment="acl://votePoll">
- ${resource.Rules_vote_can}<br/>
- </forums:isAllowedWhen>
- <forums:isAllowedOtherwise>
- ${resource.Rules_vote_cannot}<br/>
- </forums:isAllowedOtherwise>
- </forums:isAllowedChoose>
-
- <!-- moderate forum link -->
- <forums:isAllowedChoose>
- <forums:isAllowedWhen fragment="acl://moderateForum" contextData="#{forum.forum}">
- ${resource.Rules_moderate_0}
- <h:outputLink value="#{forums:outputLink(shared.links['moderator'],true)}">
- <f:param name="f" value="#{forum.forum.id}"/>
- ${resource.Rules_moderate_2}
- </h:outputLink>
- </forums:isAllowedWhen>
- <forums:isAllowedOtherwise>
- ${resource.Rules_moderate_1}${resource.Rules_moderate_2}
- </forums:isAllowedOtherwise>
- </forums:isAllowedChoose>
- </span>
- <ui:include src="/views/jumpbox.xhtml" />
- </span>
- </td>
- </tr>
- </table>
- </forums:isAllowed>
- </forums:isAllowed>
- </c:if>
-
- <c:if test="#{forum.forum==null}">
- <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
- <tr>
- <td>
- <table width="100%" cellspacing="0" cellpadding="1" border="0">
- <tr>
- <td> </td>
- </tr>
- <tr>
- <td align="center">
- <span class="gen">${resource.Forum_not_exist}</span>
- </td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </c:if>
+ </h:form>
+
+ </forums:isAllowed>
+ </forums:isAllowed>
+ </c:if>
+
+ <c:if test="#{forum.forum==null}">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+ <tr>
+ <td>
+ <table width="100%" cellspacing="0" cellpadding="1" border="0">
+ <tr>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="center">
+ ${resource.Forum_not_exist}
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </c:if>
+
</ui:define>
</ui:composition>
More information about the jboss-svn-commits
mailing list