You are here

function spaces_preset_delete_form_submit in Spaces 6.2

Same name and namespace in other branches
  1. 5.2 spaces_admin.inc \spaces_preset_delete_form_submit()
  2. 6 spaces_admin.inc \spaces_preset_delete_form_submit()

File

./spaces_admin.inc, line 412

Code

function spaces_preset_delete_form_submit($form, &$form_state) {
  $type = $form_state['values']['type'];
  $preset = $form_state['values']['preset'];
  $success = spaces_preset_delete($type, $preset);
  $message = $success ? t('The preset !preset was deleted successfully.', array(
    '!preset' => $preset,
  )) : t('An error occurred while trying to delete !preset.', array(
    '!preset' => $preset,
  ));
  drupal_set_message($message);
  $form_state['redirect'] = 'admin/build/spaces';
}