system_admin_theme_settings

5 system.module system_admin_theme_settings()
6 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'

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);
}
Login or register to post comments