You are here

function _commerce_kickstart_set_theme in Commerce Kickstart 7.2

Force-set a theme at any point during the execution of the request.

Drupal doesn't give us the option to set the theme during the installation process and forces enable the maintenance theme too early in the request for us to modify it in a clean way.

1 call to _commerce_kickstart_set_theme()
commerce_kickstart_install_tasks_alter in ./commerce_kickstart.install
Implements hook_install_tasks_alter().

File

./commerce_kickstart.install, line 80
Installation code for Commerce Kickstart.

Code

function _commerce_kickstart_set_theme($target_theme) {
  if ($GLOBALS['theme'] != $target_theme) {
    unset($GLOBALS['theme']);
    drupal_static_reset();
    $GLOBALS['conf']['maintenance_theme'] = $target_theme;
    _drupal_maintenance_theme();
  }
}