You are here

function panopoly_theme_update_7001 in Panopoly Theme 7

Panopoly Beta 6 Update: Updating Location of Panopoly Icons

File

./panopoly_theme.install, line 25
An installation file for Panopoly Theme

Code

function panopoly_theme_update_7001(&$sandbox) {

  // Update Bartik, Garland, or Responsive Bartik's Current Logo to New Panopoly Location
  foreach (array(
    'bartik',
    'garland',
    'responsive_bartik',
  ) as $theme_key) {
    $theme_settings = variable_get('theme_' . $theme_key . '_settings');
    if ($theme_settings['logo_path'] == 'profiles/panopoly/images/panopoly_icon_theme.png') {
      $theme_settings['logo_path'] = drupal_get_path('module', 'panopoly_theme') . '/images/panopoly_icon_theme.png';
      variable_set('theme_' . $theme_key . '_settings', $theme_settings);
    }
  }

  // Update Seven's Logo to Go Back to Normal
  $theme_settings = variable_get('theme_seven_settings');
  if ($theme_settings['logo_path'] == 'profiles/panopoly/images/panopoly_icon_install.png') {
    $theme_settings['logo_path'] = '';
    $theme_settings['default_logo'] = 1;
    variable_set('theme_seven_settings', $theme_settings);
  }

  // Flush the Theme Data
  system_rebuild_theme_data();
}