You are here

function commerce_kickstart_update_7200 in Commerce Kickstart 7.2

Update the admin theme from "Commerce Kickstart Admin Theme" to "Shiny".

File

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

Code

function commerce_kickstart_update_7200() {

  // Enable the new theme.
  theme_enable(array(
    'shiny',
  ));
  variable_set('admin_theme', 'shiny');
  drupal_static_reset();
  _block_rehash('shiny');

  // Disable all blocks in the content region except "Main page content".
  db_update('block')
    ->fields(array(
    'region' => '-1',
  ))
    ->condition('theme', 'shiny')
    ->condition('region', 'content')
    ->condition(db_and()
    ->condition('module', 'system', '<>')
    ->condition('delta', 'main', '<>'))
    ->execute();

  // Move help to the correct region.
  db_update('block')
    ->fields(array(
    'region' => 'help',
  ))
    ->condition('module', 'system')
    ->condition('delta', 'help')
    ->condition('theme', 'shiny')
    ->execute();

  // Disable the old theme.
  theme_disable(array(
    'commerce_kickstart_admin',
  ));
}