workflow_admin_ui.api.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by the workflow_admin_ui module.
  5. */
  6. /**
  7. * Implements hook_workflow_operations().
  8. *
  9. * Menu callback; adds links on EntityWorkflowUIController::overviewForm.
  10. *
  11. * @param string $op
  12. * 'top_actions': Allow modules to insert their own front page action links.
  13. * 'operations': Allow modules to insert their own workflow operations.
  14. * 'state': Allow modules to insert state operations.
  15. * @param Workflow $workflow
  16. * The current workflow object.
  17. * @param WorkflowState $state
  18. * The current state object.
  19. *
  20. * @return array
  21. */
  22. function hook_workflow_operations($op, Workflow $workflow, WorkflowState $state) {
  23. switch ($op) {
  24. case 'top_actions':
  25. $actions = array();
  26. // The workflow_admin_ui module creates links to add a new state,
  27. // and reach each workflow.
  28. // Your module may add to these actions.
  29. return $actions;
  30. case 'operations':
  31. $actions = array();
  32. // The workflow_admin_ui module creates links to add a new state,
  33. // edit the workflow, and delete the workflow.
  34. // Your module may add to these actions.
  35. return $actions;
  36. case 'workflow':
  37. $actions = array();
  38. // Allow modules to insert their own workflow operations.
  39. return $actions;
  40. case 'state':
  41. $ops = array();
  42. // The workflow_admin_ui module does not use this.
  43. // Your module may add operations.
  44. return $ops;
  45. }
  46. }