I needed an option to disable certain themes in the select list.

Since #735638: Option to select which of the enabled themes will be available for switching only applies to D6 i made this little patch.

Comments

wernercd’s picture

Just what I was looking for... I'll try this tonight.

Anonymous’s picture

Works perfect.

Only in the page layout I would preferre a table view of all the themes (theme per row), to have all settings in one pageview, withouth the closed fieldsets per theme. But like I said: it works great.

raydenxxx’s picture

Works great!

Be aware about this correction

-    $options[$name] = variable_get('switchtheme_' . $name, $label);
+	if(!variable_get('disable_' . $name)){
+      $options[$name] = variable_get('switchtheme_' . $label, $label);
+	}

You replace the $name var by $label which will do name changing dosn't work.
So you should write this

-    $options[$name] = variable_get('switchtheme_' . $name, $label);
+	if(!variable_get('disable_' . $name)){
+      $options[$name] = variable_get('switchtheme_' . $name, $label);
+	}
Robin Millette’s picture

That's a big patch!

Instead of another set of variables, in this patch, blanked labels disable themes.

Robin Millette’s picture

StatusFileSize
new836 bytes
mr_wookie’s picture

@#5: Works greate for me. Thanks!

rolfmeijer’s picture

Works like a charm.
Maybe the help text needs an update?
Something like:

Set a label for each enabled theme. This is what will be displayed to the user in the selection box. An empty label will hide it from the selection box.

It’s just a suggestion, maybe it’s clear as it is, I’m just saying a new (dev-)version would be great. :-)

mrfelton’s picture

StatusFileSize
new1.22 KB

Patch updated to apply cleanly against latest dev code

m-patate’s picture

Hello,

Thanks for this usefull enhancement !
Do you know when it will be available in a new release module version ?
Thanks

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

#8 works for me!
Marked #1948174: I need a way to remove a theme from the pool. as a duplicate.