[jboss-svn-commits] JBL Code SVN: r10097 - in labs/jbossforums/branches/forums101P22/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:57:45 EST 2007
Author: unibrew
Date: 2007-03-09 10:57:45 -0500 (Fri, 09 Mar 2007)
New Revision: 10097
Modified:
labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml
labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
Log:
[JBFORUMS-190] Problem with empty e-mail buttons solved.
Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2007-03-09 15:54:36 UTC (rev 10096)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2007-03-09 15:57:45 UTC (rev 10097)
@@ -128,6 +128,15 @@
return string.length()>length;
}
+ 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
Modified: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2007-03-09 15:54:36 UTC (rev 10096)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2007-03-09 15:57:45 UTC (rev 10097)
@@ -125,6 +125,15 @@
<function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
<function-signature>boolean isLongerThan( java.lang.String , int )</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/branches/forums101P22/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml 2007-03-09 15:54:36 UTC (rev 10096)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/profile/viewprofile_body.xhtml 2007-03-09 15:57:45 UTC (rev 10097)
@@ -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/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2007-03-09 15:54:36 UTC (rev 10096)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2007-03-09 15:57:45 UTC (rev 10097)
@@ -431,8 +431,10 @@
<p>
#{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>
</p>
<!-- show the attachments of this post here -->
@@ -503,7 +505,7 @@
</li>
-->
- <c:if test="${postrow.poster.user.fakeEmail ne null}">
+ <c:if test="${forums:nullIfEmptyString(postrow.poster.user.fakeEmail) ne null}">
<li>
<a href="mailto:${postrow.poster.user.fakeEmail}">
<img border="0"
More information about the jboss-svn-commits
mailing list