Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#10 | 82340_themeswitcher_module.patch.txt | 8.65 KB | Bèr Kessels |
#9 | themeswitcher_3.module | 9.2 KB | agentrickard |
#8 | themeswitcher_2.module | 9.2 KB | agentrickard |
#7 | themeswitcher_1.module | 9.16 KB | agentrickard |
#4 | ts.png | 116.68 KB | agentrickard |
Comments
Comment #1
agentrickardThe 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.
Comment #2
agentrickardI 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.
Comment #3
agentrickardNew module attached.
Comment #4
agentrickardScreenshot of themeswitcher_page callback.
Comment #5
agentrickardComment #6
Bèr Kessels CreditAttribution: Bèr Kessels commentedAdd a comment to become subscribed.
The code looks very nice, but I'd need to review it a bit closer (and test it! ) :)
Comment #7
agentrickardThere's at least one error. In themeswitcher_get_current() line 297, I need to invoke global $user as well.
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.
Comment #8
agentrickardFixed a dumb math error in the themeswitcher_page() logic.
Comment #9
agentrickardFixed a missing & on line 281.
Comment #10
Bèr Kessels CreditAttribution: Bèr Kessels commentedFirst, lets make a real patch.
Comment #11
MichelleIs this issue misfiled? There's no theme switching on d.o that I'm aware of.
Michelle
Comment #12
mikey_p CreditAttribution: mikey_p commentedCould this be from when the themegarden was hosted on d.o infrastructure?
Comment #13
agentrickardYes, it is a legacy of themegarden. The issue can likely be closed.
Comment #14
MichelleThanks, Ken. Closing.
Michelle