workflow_rules.rules.inc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * @file
  4. * Rules integration for the Workflow module.
  5. *
  6. * Contains _info() hooks.
  7. * Callbacks are implemented in file workflow.rules.inc.
  8. */
  9. /*
  10. * Include the Condition and Actions for Nodes and Entity.
  11. * They are in separate files, but must be kept in sync.
  12. * They contain separate logic for the 'conventional' Workflow Node API
  13. * and the 'new' Workfow Field API.
  14. */
  15. require_once dirname(__FILE__) . '/workflow_rules.node.inc';
  16. require_once dirname(__FILE__) . '/workflow_rules.field.inc';
  17. /**
  18. * Implements hook_rules_event_info().
  19. *
  20. * @todo: add support for any entity type in hook_rules_event_info.
  21. */
  22. function workflow_rules_rules_event_info() {
  23. $events = array();
  24. if (module_exists('workflownode')) {
  25. $events += _workflownode_rules_event_info();
  26. }
  27. return $events;
  28. }
  29. /**
  30. * Implements hook_rules_condition_info().
  31. */
  32. function workflow_rules_rules_condition_info() {
  33. $conditions = array();
  34. if (module_exists('workflownode')) {
  35. $conditions += _workflownode_rules_condition_info();
  36. }
  37. return $conditions;
  38. }
  39. /**
  40. * Implements hook_rules_action_info().
  41. */
  42. function workflow_rules_rules_action_info() {
  43. $actions = array();
  44. if (module_exists('workflownode')) {
  45. $actions += _workflownode_rules_action_info();
  46. }
  47. if (module_exists('workflowfield')) {
  48. $actions += _workflowfield_rules_action_info();
  49. }
  50. return $actions;
  51. }