You are here

function workflow_admin_ui_add_form_submit in Workflow 6

Same name and namespace in other branches
  1. 6.2 workflow_admin_ui/workflow_admin_ui.module \workflow_admin_ui_add_form_submit()
  2. 7 workflow_admin_ui/workflow_admin_ui.pages.inc \workflow_admin_ui_add_form_submit()

Submit handler for the workflow add form.

See also

workflow_add_form()

File

workflow_admin_ui/workflow_admin_ui.module, line 171
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_add_form_submit($form, &$form_state) {
  $workflow_name = $form_state['values']['wf_name'];
  $wid = workflow_create($workflow_name);
  watchdog('workflow', 'Created workflow %name', array(
    '%name' => $workflow_name,
  ));
  drupal_set_message(t('The workflow %name was created. You should now add states to your workflow.', array(
    '%name' => $workflow_name,
  )), 'status');
  $form_state['wid'] = $wid;
  $form_state['redirect'] = 'admin/build/workflow/state/' . $wid;
}