Same name and namespace in other branches
  1. 6.x modules/system/system.admin.inc \system_admin_theme_settings()

This function allows selection of the theme to show in administration sections.

1 string reference to 'system_admin_theme_settings'
system_menu in modules/system/system.module
Implementation of hook_menu().

File

modules/system/system.module, line 425
Configuration system that lets administrators modify the workings of the site.

Code

function system_admin_theme_settings() {
  $themes = system_theme_data();
  ksort($themes);
  $options[0] = t('System default');
  foreach ($themes as $theme) {
    $options[$theme->name] = $theme->name;
  }
  $form['admin_theme'] = array(
    '#type' => 'select',
    '#options' => $options,
    '#title' => t('Administration theme'),
    '#description' => t('Choose which theme the administration pages should display in. If you choose "System default" the administration pages will use the same theme as the rest of the site.'),
    '#default_value' => variable_get('admin_theme', '0'),
  );

  // In order to give it our own submit, we have to give it the default submit
  // too because the presence of a #submit will prevent the default #submit
  // from being used. Also we want ours first.
  $form['#submit']['system_admin_theme_submit'] = array();
  $form['#submit']['system_settings_form_submit'] = array();
  return system_settings_form($form);
}