You are here

function workflow_types_save in Workflow 6.2

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_types_save()
  2. 5 workflow.module \workflow_types_save()
  3. 6 workflow.module \workflow_types_save()

Save mapping of workflow to node type. E.g., "the story node type is using the Foo workflow."

Parameters

$form_state['values']:

1 call to workflow_types_save()
workflow_admin_ui_types_form_submit in workflow_admin_ui/workflow_admin_ui.module
Submit handler for workflow type mapping form.

File

./workflow.module, line 1017
Support workflows made up of arbitrary states.

Code

function workflow_types_save($form_values) {
  db_query("DELETE FROM {workflow_type_map}");
  $node_types = node_get_types();
  foreach ($node_types as $type => $name) {
    db_query("INSERT INTO {workflow_type_map} (type, wid) VALUES ('%s', %d)", $type, $form_values[$type]['workflow']);
    variable_set('workflow_' . $type, array_keys(array_filter($form_values[$type]['placement'])));
  }
}