You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2005/09/16 00:11:20 UTC
svn commit: r289325 -
/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java
Author: agilliland
Date: Thu Sep 15 15:11:17 2005
New Revision: 289325
URL: http://svn.apache.org/viewcvs?rev=289325&view=rev
Log:
theme editor bug fix. "custom" is not on the themes option list unless the user already has a default page template.
Modified:
incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java
Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java?rev=289325&r1=289324&r2=289325&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java Thu Sep 15 15:11:17 2005
@@ -96,8 +96,17 @@
String currentTheme = website.getEditorTheme();
List themes = themeMgr.getEnabledThemesList();
+ // this checks if the website has a default page template
+ // if not then we don't allow for a custom theme
+ boolean allowCustomTheme = true;
+ if(website.getDefaultPageId() == null
+ || website.getDefaultPageId().equals("dummy")
+ || website.getDefaultPageId().trim().equals(""))
+ allowCustomTheme = false;
+
// if we allow custom themes then add it to the end of the list
- if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed"))
+ if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")
+ && allowCustomTheme)
themes.add(Theme.CUSTOM);
// on the first pass just show a preview of the current theme
@@ -154,8 +163,17 @@
String currentTheme = website.getEditorTheme();
List themes = themeMgr.getEnabledThemesList();
+ // this checks if the website has a default page template
+ // if not then we don't allow for a custom theme
+ boolean allowCustomTheme = true;
+ if(website.getDefaultPageId() == null
+ || website.getDefaultPageId().equals("dummy")
+ || website.getDefaultPageId().trim().equals(""))
+ allowCustomTheme = false;
+
// if we allow custom themes then add it to the end of the list
- if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed"))
+ if(RollerRuntimeConfig.getBooleanProperty("themes.customtheme.allowed")
+ && allowCustomTheme)
themes.add(Theme.CUSTOM);
// set the current theme in the request
@@ -423,6 +441,7 @@
// if this is the first time someone is customizing a theme then
// we need to set a default page
if(website.getDefaultPageId() == null ||
+ website.getDefaultPageId().trim().equals("") ||
website.getDefaultPageId().equals("dummy")) {
// we have to go back to the db to figure out the id
WeblogTemplate template = userMgr.getPageByName(website, "Weblog");