<?php
/**
 * @file
 * clameurs.rules_defaults.inc
 */

/**
 * Implements hook_default_rules_configuration().
 */
function clameurs_default_rules_configuration() {
  $items = array();
  $items['clameurs_habiter'] = entity_import('rules_config', '{ "clameurs_habiter" : {
      "LABEL" : "Habiter",
      "PLUGIN" : "reaction rule",
      "OWNER" : "rules",
      "REQUIRES" : [ "rules" ],
      "ON" : { "node_insert--episode" : { "bundle" : "episode" } },
      "DO" : [
        { "entity_fetch" : {
            "USING" : { "type" : "taxonomy_term", "id" : "1" },
            "PROVIDE" : { "entity_fetched" : { "habiter_term" : "Habiter" } }
          }
        },
        { "data_set" : { "data" : [ "node:field-habiter" ], "value" : [ "habiter-term" ] } }
      ]
    }
  }');
  $items['rules_ecouter'] = entity_import('rules_config', '{ "rules_ecouter" : {
      "LABEL" : "\\u00c9couter",
      "PLUGIN" : "reaction rule",
      "OWNER" : "rules",
      "REQUIRES" : [ "rules" ],
      "ON" : { "node_insert--thematique" : { "bundle" : "thematique" } },
      "DO" : [
        { "entity_fetch" : {
            "USING" : { "type" : "taxonomy_term", "id" : "2" },
            "PROVIDE" : { "entity_fetched" : { "ecouter_term" : "\\u00c9couter" } }
          }
        },
        { "data_set" : { "data" : [ "node:field-ecouter" ], "value" : [ "ecouter-term" ] } }
      ]
    }
  }');
  $items['rules_episode_th_matique'] = entity_import('rules_config', '{ "rules_episode_th_matique" : {
      "LABEL" : "episode-th\\u00e9matique",
      "PLUGIN" : "reaction rule",
      "ACTIVE" : false,
      "OWNER" : "rules",
      "REQUIRES" : [ "rules" ],
      "ON" : {
        "node_update--episode" : { "bundle" : "episode" },
        "node_insert--episode" : { "bundle" : "episode" }
      },
      "DO" : [
        { "entity_fetch" : {
            "USING" : { "type" : "node", "id" : [ "node:field-thematique:nid" ] },
            "PROVIDE" : { "entity_fetched" : { "thematique" : "Th\\u00e9matique" } }
          }
        }
      ]
    }
  }');
  return $items;
}
