You are here

function workflow_update in Workflow 6.2

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

Save a workflow's name in the database.

Parameters

$wid: The ID of the workflow.

$name: The name of the workflow.

$tab_roles: Array of role IDs allowed to see the workflow tab.

$options: Array of key-value pairs that constitute various settings for this workflow. An example is whether to show the comment form on the workflow tab page or not.

1 call to workflow_update()
workflow_admin_ui_edit_form_submit in workflow_admin_ui/workflow_admin_ui.module
Submit handler for the workflow editing form.

File

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

Code

function workflow_update($wid, $name, $tab_roles, $options) {
  db_query("UPDATE {workflows} SET name = '%s', tab_roles = '%s', options = '%s' WHERE wid = %d", $name, implode(',', $tab_roles), serialize($options), $wid);

  // Workflow name change affects tabs (local tasks), so force menu rebuild.
  menu_rebuild();
}