function hook_workflow_operations in Workflow 7.2
Same name and namespace in other branches
- 8 workflow.api.php \hook_workflow_operations()
Implements hook_workflow_operations().
Menu callback; adds links on EntityWorkflowUIController::overviewForm.
Parameters
string $op: 'top_actions': Allow modules to insert their own front page action links. 'operations': Allow modules to insert their own workflow operations. 'state': Allow modules to insert state operations.
Workflow $workflow: The current workflow object.
WorkflowState $state: The current state object.
Return value
array
3 functions implement hook_workflow_operations()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- workflow_access_workflow_operations in workflow_access/
workflow_access.module - Implements hook_workflow_operations().
- workflow_actions_workflow_operations in workflow_actions/
workflow_actions.module - Implements hook_workflow_operations().
- workflow_notify_workflow_operations in workflow_notify/
workflow_notify.module - Implements hook_workflow_operations().
3 invocations of hook_workflow_operations()
- EntityWorkflowUIController::overviewForm in workflow_admin_ui/
includes/ Entity/ EntityWorkflowUIController.php - Builds the entity overview form.
- workflow_admin_ui_states_form in workflow_admin_ui/
workflow_admin_ui.page.states.inc - Menu callback.
- workflow_notify_settings_form in workflow_notify/
workflow_notify.pages.inc - Settings form.
File
- workflow_admin_ui/
workflow_admin_ui.api.php, line 23 - Hooks provided by the workflow_admin_ui module.
Code
function hook_workflow_operations($op, Workflow $workflow, WorkflowState $state) {
switch ($op) {
case 'top_actions':
$actions = array();
// The workflow_admin_ui module creates links to add a new state,
// and reach each workflow.
// Your module may add to these actions.
return $actions;
case 'operations':
$actions = array();
// The workflow_admin_ui module creates links to add a new state,
// edit the workflow, and delete the workflow.
// Your module may add to these actions.
return $actions;
case 'workflow':
$actions = array();
// Allow modules to insert their own workflow operations.
return $actions;
case 'state':
$ops = array();
// The workflow_admin_ui module does not use this.
// Your module may add operations.
return $ops;
}
}