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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcvangend’s picture

Nice 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:

foreach (list_themes() as $theme) {
  $path = str_replace('/', '.', $theme->name);
  $items[] = array('path' => 'admin/themes/settings/'. $path, 'title' => basename($theme->name),
  'callback' => 'system_theme_settings', 'access' => $access,
  'type' => MENU_LOCAL_TASK);
}

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.

joachim’s picture

Status: Active » Needs review
FileSize
1.52 KB

Here's a patch that gets rid of that very old code :)

marcvangend’s picture

Thanks, 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.

joachim’s picture

Agreed on the % -- I just saw this elsewhere:

      drupal_set_message(t('The %theme theme was not found.', array('%theme' => $theme)), 'error');
marcvangend’s picture

Status: Needs review » Reviewed & tested by the community

Ok, marking this RTBC.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.