You are here

function workflow_types_save in Workflow 5.2

Same name and namespace in other branches
  1. 5 workflow.module \workflow_types_save()
  2. 6.2 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_values:

1 call to workflow_types_save()
workflow_types_form_submit in ./workflow.module

File

./workflow.module, line 1911

Code

function workflow_types_save($form_values) {
  db_query("DELETE FROM {workflow_type_map}");
  foreach (node_get_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'])));
  }
}