function workflow_create in Workflow 5.2
Same name and namespace in other branches
- 5 workflow.module \workflow_create()
- 6.2 workflow.module \workflow_create()
- 6 workflow.module \workflow_create()
- 7.2 workflow.entity.inc \workflow_create()
Create a workflow and its (creation) state.
Parameters
$name: The name of the workflow.
1 call to workflow_create()
File
- ./
workflow.module, line 1651
Code
function workflow_create($name) {
$wid = db_next_id('{workflows}_wid');
db_query("INSERT INTO {workflows} (wid, name) VALUES (%d, '%s')", $wid, $name);
workflow_state_save(array(
'wid' => $wid,
'state' => t('(creation)'),
'sysid' => WORKFLOW_CREATION,
'weight' => WORKFLOW_CREATION_DEFAULT_WEIGHT,
));
// Workflow creation affects tabs (local tasks), so force menu rebuild.
cache_clear_all('*', 'cache_menu', TRUE);
menu_rebuild();
return $wid;
}