You are here

function imagecache_ui_preset_form_submit in ImageCache 6.2

Same name and namespace in other branches
  1. 5.2 imagecache_ui.module \imagecache_ui_preset_form_submit()

File

./imagecache_ui.pages.inc, line 287

Code

function imagecache_ui_preset_form_submit($form, &$form_state) {

  // Save the preset first to retrieve the presetid when overriding
  $preset = imagecache_preset_save($form_state['values']);

  // Populate the presetid as needed for overrides
  if (isset($form_state['values']['actions'])) {
    foreach ($form_state['values']['actions'] as $action) {
      if (empty($action['presetid'])) {
        $action['presetid'] = $preset['presetid'];
      }
      imagecache_action_save($action);
    }
  }

  // Push back to the preset form
  $form_state['redirect'] = 'admin/build/imagecache/' . $preset['presetid'];
}