1 system.admin.inc system_themes_admin_form_submit($form, &$form_state)

Process system_themes_admin_form form submissions.

File

core/modules/system/system.admin.inc, line 257
Admin page callbacks for the system module.

Code

function system_themes_admin_form_submit($form, &$form_state) {
  backdrop_set_message(t('The configuration options have been saved.'));

  $themes = list_themes();
  $config = config('system.core');
  $current_default_theme = $config->get('theme_default');
  $current_admin_theme = $config->get('admin_theme');
  $new_admin_theme = $form_state['values']['admin_theme'];

  if (!$new_admin_theme) {
    $current_default_theme_name = $themes[$current_default_theme]->info['name'];
    backdrop_set_message(t('The administration theme will be the same as the rest of the site (currently %default_theme).', array('%default_theme' => $current_default_theme_name)));
  }
  elseif ($current_admin_theme != $new_admin_theme) {
    $new_admin_theme_name = $themes[$new_admin_theme]->info['name'];
    backdrop_set_message(t('The administration theme has been changed to %admin_theme.', array('%admin_theme' => $new_admin_theme_name)));
  }

  $config->set('admin_theme', $new_admin_theme);
  $config->save();
}