Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The help text at the top of admin/appearance/settings/garland says:
These options control the display settings for the garland theme. When your site is displayed using this theme, these settings will be used.
The string 'garland' is taken from the URL:
case 'admin/appearance/settings/' . $arg[3]:
$reference = explode('.', $arg[3], 2);
$theme = array_pop($reference);
return '<p>' . t('These options control the display settings for the <code>%template
theme. When your site is displayed using this theme, these settings will be used.', array('%template' => $theme)) . '
';
Now we have theme info files, we could really do to show the nicely formatted theme name.
Also, what on earth is the exploding part doing?
Comment | File | Size | Author |
---|---|---|---|
#3 | 782788-3.drupal.system.theme-settings-page-help-theme-name.patch | 1.52 KB | marcvangend |
#2 | 782788.drupal.system.theme-settings-page-help-theme-name.patch | 1.52 KB | joachim |
Comments
Comment #1
marcvangendNice one, that "exploding part" is like ancient history. For some reason I like CVS archeology...
It was introduced on August 20, 2004 by Steven Wittens in his patch on http://drupal.org/node/9576#comment-302244. (That's when the Pushbutton, Chameleon and Bluemarine themes were brand new :-)) The reason for the exploding can be found elsewhere in that patch. In system_menu() it reads:
Obviously, the $theme->name variable could contain a slash in those days.
On topic: I agree, it would be nice to use the theme name from the .info file.
Comment #2
joachim CreditAttribution: joachim commentedHere's a patch that gets rid of that very old code :)
Comment #3
marcvangendThanks, the patch looks good.
One thing: I propose to use the %-placeholder in the t() function call. Even though it's not likely that someone would put
name = Garland<script>alert('hello world')</script>
in the .info file, all strings should be properly escaped. I also prefer the italic font for the theme name. New patch attached.Besides that, I'd say that this is RTBC.
Comment #4
joachim CreditAttribution: joachim commentedAgreed on the % -- I just saw this elsewhere:
Comment #5
marcvangendOk, marking this RTBC.
Comment #6
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Fixed.