roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r649854 - /roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
Date Sat, 19 Apr 2008 21:32:19 GMT
Author: snoopdave
Date: Sat Apr 19 14:32:17 2008
New Revision: 649854

URL: http://svn.apache.org/viewvc?rev=649854&view=rev
Log:
Fix for https://issues.apache.org/roller/browse/ROL-1705

Design tab not shown, a regression

Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java?rev=649854&r1=649853&r2=649854&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
Sat Apr 19 14:32:17 2008
@@ -29,6 +29,7 @@
 import org.apache.roller.weblogger.business.UserManager;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.config.WebloggerConfig;
+import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.pojos.GlobalPermission;
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.Weblog;
@@ -112,9 +113,9 @@
             // does this tab have an enabledProperty?
             boolean includeTab = true;
             if(configTab.getEnabledProperty() != null) {
-                includeTab = WebloggerConfig.getBooleanProperty(configTab.getEnabledProperty());
+                includeTab = getBooleanProperty(configTab.getEnabledProperty());
             } else if(configTab.getDisabledProperty() != null) {
-                includeTab = ! WebloggerConfig.getBooleanProperty(configTab.getDisabledProperty());
+                includeTab = ! getBooleanProperty(configTab.getDisabledProperty());
             }
             
             if (includeTab) {
@@ -162,9 +163,9 @@
                     
                     boolean includeItem = true;
                     if (configTabItem.getEnabledProperty() != null) {
-                        includeItem = WebloggerConfig.getBooleanProperty(configTabItem.getEnabledProperty());
+                        includeItem = getBooleanProperty(configTabItem.getEnabledProperty());
                     } else if (configTabItem.getDisabledProperty() != null) {
-                        includeItem = ! WebloggerConfig.getBooleanProperty(configTabItem.getDisabledProperty());
+                        includeItem = ! getBooleanProperty(configTabItem.getDisabledProperty());
                     }
                     
                     if (includeItem) {
@@ -221,6 +222,13 @@
         return tabMenu;
     }    
     
+    /** Check enabled property, prefers runtime properties */
+    private static boolean getBooleanProperty(String propertyName) {
+        if (WebloggerRuntimeConfig.getProperty(propertyName) != null) {
+            return WebloggerRuntimeConfig.getBooleanProperty(propertyName);
+        }
+        return WebloggerConfig.getBooleanProperty(propertyName);
+    }
     
     private static boolean isSelected(String currentAction, ParsedTabItem tabItem) {
         



Mime
View raw message