workflow_admin_ui.api.php 1.3 KB

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