Use a workflow on a node: Difference between revisions
Appearance
Changed template |
No edit summary |
||
| Line 5: | Line 5: | ||
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: | 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: | ||
< | <syntaxhighlight lang="php"> | ||
$options = array(); | $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["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 | ||
| Line 16: | Line 16: | ||
wf_registerNode("mymodule.mynode", $options); // register the node to the workflow module using the options stated above | wf_registerNode("mymodule.mynode", $options); // register the node to the workflow module using the options stated above | ||
</ | </syntaxhighlight> | ||
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. | 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. | ||
Revision as of 01:07, 4 December 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.