node.eval.inc 722 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * @file
  4. * Contains rules integration for the node module needed during evaluation.
  5. *
  6. * @addtogroup rules
  7. * @{
  8. */
  9. /**
  10. * Condition: Check for selected content types
  11. */
  12. function rules_condition_node_is_of_type($node, $types) {
  13. return in_array($node->type, $types);
  14. }
  15. /**
  16. * Condition: Check if the node is published
  17. */
  18. function rules_condition_node_is_published($node) {
  19. return $node->status == 1;
  20. }
  21. /**
  22. * Condition: Check if the node is sticky
  23. */
  24. function rules_condition_node_is_sticky($node) {
  25. return $node->sticky == 1;
  26. }
  27. /**
  28. * Condition: Check if the node is promoted to the frontpage
  29. */
  30. function rules_condition_node_is_promoted($node) {
  31. return $node->promote == 1;
  32. }
  33. /**
  34. * @}
  35. */