You are here

function ctools_stylizer_edit_style_form_choose_submit in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/stylizer.inc \ctools_stylizer_edit_style_form_choose_submit()

File

includes/stylizer.inc, line 931
Create customized CSS and images from palettes created by user input.

Code

function ctools_stylizer_edit_style_form_choose_submit($form, &$form_state) {
  $form_state['settings']['style_base'] = $form_state['values']['style_base'];

  // The 'next' form will show up as 'next' but that's not accurate now that
  // we have a style. Figure out what next really is and update.
  $plugin = ctools_get_style_base($form_state['settings']['style_base']);
  if (empty($plugin['forms'])) {
    $form_state['clicked_button']['#next'] = 'settings';
  }
  else {
    $forms = array_keys($form_info['forms']);
    $form_state['clicked_button']['#next'] = array_shift($forms);
  }

  // Fill in the defaults for the settings.
  if (!empty($plugin['defaults'])) {

    // @todo allow a callback
    $form_state['settings'] += $plugin['defaults'];
  }
  return $form;
}