[jboss-svn-commits] JBL Code SVN: r10093 - in labs/jbossforums/trunk/forums/src: resources/portal-forums-war/WEB-INF and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Mar 9 10:47:33 EST 2007
Author: unibrew
Date: 2007-03-09 10:47:33 -0500 (Fri, 09 Mar 2007)
New Revision: 10093
Modified:
labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml
labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
Log:
[JBFORUMS-190] Problem with empty e-mail buttons solved.
Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
===================================================================
--- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2007-03-09 15:40:18 UTC (rev 10092)
+++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2007-03-09 15:47:33 UTC (rev 10093)
@@ -103,6 +103,15 @@
return dateStr;
}
+ public static String nullIfEmptyString( String string )
+ {
+ if (string==null || string.trim().length()==0)
+ {
+ return null;
+ }
+ return string.trim();
+ }
+
public static Post getLastPost(ForumsModule fm, Forum forum) {
try {
return fm.findLastPost(forum);
Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2007-03-09 15:40:18 UTC (rev 10092)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2007-03-09 15:47:33 UTC (rev 10093)
@@ -107,6 +107,15 @@
<function-class>org.jboss.portlet.forums.ui.PortalUtil</function-class>
<function-signature>java.lang.String formatMessage(java.lang.String,boolean)</function-signature>
</function>
+
+ <!--
+ Simple method which trims given in parameter string.
+ -->
+ <function>
+ <function-name>nullIfEmptyString</function-name>
+ <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+ <function-signature>java.lang.String nullIfEmptyString( java.lang.String )</function-signature>
+ </function>
<!--
function to get theme URL location
Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml 2007-03-09 15:40:18 UTC (rev 10092)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml 2007-03-09 15:47:33 UTC (rev 10093)
@@ -150,7 +150,7 @@
<td class="row1" valign="middle" width="100%">
<b>
<span class="gen">
- <c:if test="#{profile.poster.user.fakeEmail!=null}" >
+ <c:if test="#{forums:nullIfEmptyString(profile.poster.user.fakeEmail)!=null}" >
<a href="mailto:${profile.poster.user.fakeEmail}" style="text-decoration: none;">
<img border="0"
src="#{forums:themeURL('resourceIconEmailURL')}"
Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2007-03-09 15:40:18 UTC (rev 10092)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2007-03-09 15:47:33 UTC (rev 10093)
@@ -346,8 +346,10 @@
<td colspan="2">
<span class="postbody">
#{forums:formatMessage(postrow.message.text,false)}
- <br /><br />
- ${postrow.poster.user.signature}
+ <c:if test="${forums:nullIfEmptyString(postrow.poster.user.signature) ne null}">
+ <br /><br />
+ ${postrow.poster.user.signature}
+ </c:if>
</span>
<!-- show the attachments of this post here -->
@@ -417,7 +419,7 @@
</f:verbatim>
</h:outputLink> -->
- <c:if test="${postrow.poster.user.fakeEmail ne null}">
+ <c:if test="${forums:nullIfEmptyString(postrow.poster.user.fakeEmail) ne null}">
<a href="mailto:${postrow.poster.user.fakeEmail}" style="text-decoration: none;">
<img border="0"
src="#{forums:themeURL('resourceIconEmailURL')}"
More information about the jboss-svn-commits
mailing list