clameurs.rules_defaults.inc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * @file
  4. * clameurs.rules_defaults.inc
  5. */
  6. /**
  7. * Implements hook_default_rules_configuration().
  8. */
  9. function clameurs_default_rules_configuration() {
  10. $items = array();
  11. $items['clameurs_habiter'] = entity_import('rules_config', '{ "clameurs_habiter" : {
  12. "LABEL" : "Habiter",
  13. "PLUGIN" : "reaction rule",
  14. "OWNER" : "rules",
  15. "REQUIRES" : [ "rules" ],
  16. "ON" : { "node_insert--episode" : { "bundle" : "episode" } },
  17. "DO" : [
  18. { "entity_fetch" : {
  19. "USING" : { "type" : "taxonomy_term", "id" : "1" },
  20. "PROVIDE" : { "entity_fetched" : { "habiter_term" : "Habiter" } }
  21. }
  22. },
  23. { "data_set" : { "data" : [ "node:field-habiter" ], "value" : [ "habiter-term" ] } }
  24. ]
  25. }
  26. }');
  27. $items['rules_ecouter'] = entity_import('rules_config', '{ "rules_ecouter" : {
  28. "LABEL" : "\\u00c9couter",
  29. "PLUGIN" : "reaction rule",
  30. "OWNER" : "rules",
  31. "REQUIRES" : [ "rules" ],
  32. "ON" : { "node_insert--thematique" : { "bundle" : "thematique" } },
  33. "DO" : [
  34. { "entity_fetch" : {
  35. "USING" : { "type" : "taxonomy_term", "id" : "2" },
  36. "PROVIDE" : { "entity_fetched" : { "ecouter_term" : "\\u00c9couter" } }
  37. }
  38. },
  39. { "data_set" : { "data" : [ "node:field-ecouter" ], "value" : [ "ecouter-term" ] } }
  40. ]
  41. }
  42. }');
  43. $items['rules_episode_th_matique'] = entity_import('rules_config', '{ "rules_episode_th_matique" : {
  44. "LABEL" : "episode-th\\u00e9matique",
  45. "PLUGIN" : "reaction rule",
  46. "ACTIVE" : false,
  47. "OWNER" : "rules",
  48. "REQUIRES" : [ "rules" ],
  49. "ON" : {
  50. "node_update--episode" : { "bundle" : "episode" },
  51. "node_insert--episode" : { "bundle" : "episode" }
  52. },
  53. "DO" : [
  54. { "entity_fetch" : {
  55. "USING" : { "type" : "node", "id" : [ "node:field-thematique:nid" ] },
  56. "PROVIDE" : { "entity_fetched" : { "thematique" : "Th\\u00e9matique" } }
  57. }
  58. }
  59. ]
  60. }
  61. }');
  62. return $items;
  63. }