Use a workflow on a node: Difference between revisions
Appearance
No edit summary |
Changed template |
||
| Line 1: | Line 1: | ||
{{ | {{howto|Advanced|[[Leon de Rijke]] <leon [at] ibuildings.nl>}} | ||
'''To Do: clean this up and make a real howto of it.''' | '''To Do: clean this up and make a real howto of it.''' | ||
Revision as of 07:32, 26 June 2007
|
ATK Howto: Use a workflow on a node
|
To Do: clean this up and make a real howto of it.
To use the workflow module on a node you have to add a configuration file named <module>.workflow.inc.php (with <module> being the module you are working on). In this configuration file you need to enter the following settings:
$options = array();
$options["actions"] = array("edit", "delete", "view", "copy"); // actions that are used by your node. The ones listed are common, but if you use any custom actions add them here
$options["ignore"] = array(); // actions that should not have any workflow and should be ignored
$options["fields"] = array("title", "location", "code", "hide", "accessible"); // fields that can be altered by the workflow module using actions.
$options["multi-version"] = array("location", "code"); // fields that group different versions (only used when using multi-workflow)
$options["version-display-fields"] = array("title", "hide"); // fields that should be displayed in addition to the multi-version fields.
$options["mail-fields"] = array("id", "location", "code", "title"); // fields that can be used in e-mails that are send by the workflow module.
$options["template"] = "modules/workflow/framework/templates/node.tpl"; // workflow node template (you should not need to change this, only when building rare and custom.)
wf_registerNode("mymodule.mynode", $options); // register the node to the workflow module using the options stated above
After doing this you will see a new node available in the backend administration of the workflow module. When you select the node you can start adding the states and transitions you need for the workflow.