materio-base-legacy/sites/all/modules/features/showroom/showroom.rules_defaults.inc
Bachir Soussi Chiadmi 7abf64be00 Showroom feature
2016-11-06 19:40:18 +01:00

32 lines
887 B
PHP

<?php
/**
* @file
* showroom.rules_defaults.inc
*/
/**
* Implements hook_default_rules_configuration().
*/
function showroom_default_rules_configuration() {
$items = array();
$items['rules_auto_tag_news_with_showroom'] = entity_import('rules_config', '{ "rules_auto_tag_news_with_showroom" : {
"LABEL" : "auto tag news with showroom",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules" ],
"ON" : [ "node_presave" ],
"IF" : [
{ "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "breve" : "breve" } } } },
{ "user_has_role" : { "account" : [ "node:author" ], "roles" : { "value" : { "15" : "15" } } } }
],
"DO" : [
{ "data_set" : {
"data" : [ "node:field-showroom" ],
"value" : [ "node:author:field-showroom" ]
}
}
]
}
}');
return $items;
}