1.12.x color.legacy.inc bartik_form_system_theme_settings_alter(&$form, &$form_state)
1.10.x color.legacy.inc bartik_form_system_theme_settings_alter(&$form, &$form_state)
1.11.x color.legacy.inc bartik_form_system_theme_settings_alter(&$form, &$form_state)
1.7.x color.legacy.inc bartik_form_system_theme_settings_alter(&$form, &$form_state)

Alters the theme settings form for Bartik legacy colors.

This is specifically for sites upgrading from an older installation that had the "Blue Lagoon" default color scheme. Because themes are not permitted to alter forms or add submit handlers, this code resides in Color module.

Deprecated

since 1.3.0

See also

color_form_system_theme_settings_alter().

File

modules/color/color.legacy.inc, line 19
Contains support for legacy Bartik Blue Lagoon colors.

Code

function bartik_form_system_theme_settings_alter(&$form, &$form_state) {
  if (theme_get_setting('color_legacy', 'bartik')) {
    $form['color']['scheme']['#default_value'] = 'blue_lagoon';
    $palette = $form['color']['info']['#value']['schemes']['blue_lagoon']['colors'];
    foreach ($palette as $key => $color) {
      $form['color']['palette'][$key]['#default_value'] = $color;
    }
  }

  // Add a new submit handler.
  array_unshift($form['#submit'], 'bartik_form_system_theme_settings_alter_submit');
}