You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/05/04 15:11:51 UTC

svn commit: r535227 - /lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/usecase/impl/UsecaseProxy.java

Author: andreas
Date: Fri May  4 06:11:50 2007
New Revision: 535227

URL: http://svn.apache.org/viewvc?view=rev&rev=535227
Log:
Added UsecaseProxy.getBooleanCheckboxParameter(), simplifies checkbox building in JX templates

Modified:
    lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/usecase/impl/UsecaseProxy.java

Modified: lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/usecase/impl/UsecaseProxy.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/usecase/impl/UsecaseProxy.java?view=diff&rev=535227&r1=535226&r2=535227
==============================================================================
--- lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/usecase/impl/UsecaseProxy.java (original)
+++ lenya/trunk/src/modules-core/usecase/java/src/org/apache/lenya/cms/usecase/impl/UsecaseProxy.java Fri May  4 06:11:50 2007
@@ -183,4 +183,19 @@
         return (Session) getParameter("private.session");
     }
 
+    /**
+     * Returns one of the strings "true" or "false" depending on whether the
+     * corresponding checkbox was checked.
+     * @param name The parameter name.
+     * @return A string.
+     */
+    public String getBooleanCheckboxParameter(String name) {
+        String value = "false";
+        String paramValue = getParameterAsString(name);
+        if (paramValue != null && (paramValue.equals("on") || paramValue.equals("true"))) {
+            value = "true";
+        }
+        return value;
+    }
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org