As requested on the themes list, I have corrected some of the errors in the themeswitcher.module.

Attached is a patch vs. cvs. I will also attach the entire new file, just for simplicity.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

FileSize
5.42 KB

The new code has some substantial changes from prior (since my handling of arrays is more simplistic).

it may be easier, then, to just replace the whole file. Attached is the new module version.

agentrickard’s picture

FileSize
8.68 KB

I went ahead and coded a themeswitcher_page function and menu element.

This gives an overview page that allows for theme selection.

This patch replaces the above.

agentrickard’s picture

FileSize
9.15 KB

New module attached.

agentrickard’s picture

FileSize
116.68 KB

Screenshot of themeswitcher_page callback.

agentrickard’s picture

Status: Active » Needs review
Bèr Kessels’s picture

Add a comment to become subscribed.
The code looks very nice, but I'd need to review it a bit closer (and test it! ) :)

agentrickard’s picture

FileSize
9.16 KB

There's at least one error. In themeswitcher_get_current() line 297, I need to invoke global $user as well.

 -   global $custom_theme;
+   global $custom_theme, $user;

This function grabs the user's current theme setting. Failing to invoke global $user may overlook a custom setting.

Attached minor correction to the module file.

The other 'big' code question is whether this module is now themed correctly. The only theme function I use format the individual table cells on the overview page. Drupal standards might mean that the whole themeswitcher_page() function go to a theme function.

agentrickard’s picture

FileSize
9.2 KB

Fixed a dumb math error in the themeswitcher_page() logic.

agentrickard’s picture

FileSize
9.2 KB

Fixed a missing & on line 281.

Bèr Kessels’s picture

First, lets make a real patch.

Michelle’s picture

Component: web site » Other

Is this issue misfiled? There's no theme switching on d.o that I'm aware of.

Michelle

mikey_p’s picture

Could this be from when the themegarden was hosted on d.o infrastructure?

agentrickard’s picture

Yes, it is a legacy of themegarden. The issue can likely be closed.

Michelle’s picture

Status: Needs review » Closed (fixed)

Thanks, Ken. Closing.

Michelle