You are here

function styleswitcher_update_7204 in Style Switcher 7.2

Split styles storage into separate variables for settings and properties.

File

./styleswitcher.install, line 124
Installation tasks.

Code

function styleswitcher_update_7204() {
  $styles = variable_get('styleswitcher_styles');
  $settings = variable_get('styleswitcher_styles_settings');
  if ($styles && !isset($settings)) {
    $settings = array();
    $properties = array();
    foreach ($styles as $key => $style) {
      $settings[$key] = array(
        'weight' => $style['weight'],
        'status' => $style['status'],
        'is_default' => !empty($style['is_default']),
      );
      $properties[$key] = array(
        'name' => $style['name'],
        'label' => $style['label'],
        'path' => $style['path'],
      );
    }
    variable_set('styleswitcher_styles_settings', $settings);
    variable_set('styleswitcher_styles', $properties);
  }
}