You are here

function workflow_admin_ui_state_add_form_submit in Workflow 6.2

Same name and namespace in other branches
  1. 6 workflow_admin_ui/workflow_admin_ui.module \workflow_admin_ui_state_add_form_submit()

Submit handler for state addition form.

See also

workflow_state_add_form()

File

workflow_admin_ui/workflow_admin_ui.module, line 548
Provides administrative UI for workflow. Why it's own module? Lower code footprint and better performance. Additional creadit to gcassie ( http://drupal.org/user/80260 ) for the initial push to split UI out of core workflow. We're moving…

Code

function workflow_admin_ui_state_add_form_submit($form, &$form_state) {
  $form_state['sid'] = workflow_state_save($form_state['values']);
  if (array_key_exists('sid', $form_state['values'])) {
    drupal_set_message(t('The workflow state was updated.'));
  }
  else {
    watchdog('workflow', 'Created workflow state %name', array(
      '%name' => $form_state['values']['state'],
    ));
    drupal_set_message(t('The workflow state %name was created.', array(
      '%name' => $form_state['values']['state'],
    )));
  }
  $form_state['redirect'] = 'admin/build/workflow';
}