You are here

function workflow_state_delete_form_submit in Workflow 5.2

Same name and namespace in other branches
  1. 5 workflow.module \workflow_state_delete_form_submit()

File

./workflow.module, line 1515

Code

function workflow_state_delete_form_submit($form_id, $form_values) {
  $states = workflow_get_states($form_values['wid']);
  $state_name = $states[$form_values['sid']];
  $new_sid = isset($form_values['new_sid']) ? $form_values['new_sid'] : NULL;
  if ($form_values['confirm'] == 1) {
    workflow_state_delete($form_values['sid'], $new_sid);
    watchdog('workflow', t('Deleted workflow state %name', array(
      '%name' => $state_name,
    )));
    drupal_set_message(t('The workflow state %name was deleted.', array(
      '%name' => $state_name,
    )));
  }
  return 'admin/build/workflow';
}