forked from vejlebib/ding_staff
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ding_staff.rules_defaults.inc
45 lines (44 loc) · 1.38 KB
/
ding_staff.rules_defaults.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* @file
* ding_staff.rules_defaults.inc
*/
/**
* Implements hook_default_rules_configuration().
*/
function ding_staff_default_rules_configuration() {
$items = array();
$items['rules_role_staff_assign'] = entity_import('rules_config', '{ "rules_role_staff_assign" : {
"LABEL" : "assign staff role",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "ding_staff" ],
"REQUIRES" : [ "rules", "ding_staff", "profile2" ],
"ON" : { "profile2_insert" : [] },
"IF" : [
{ "data_is" : { "data" : [ "profile2:type:type" ], "value" : "ding_staff_profile" } }
],
"DO" : [
{ "ding_staff_add_role_staff" : { "profile_user" : [ "profile2:user" ] } }
]
}
}');
$items['rules_when_profile2_is_updated'] = entity_import('rules_config', '{ "rules_when_profile2_is_updated" : {
"LABEL" : "When profile2 is updated",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "realname", "cache_actions", "profile2" ],
"ON" : { "profile2_insert" : [], "profile2_update" : [] },
"DO" : [
{ "user_realname_update" : { "account" : [ "profile2:user" ] } },
{ "cache_actions_action_clear_cache_cid" : {
"bin" : "cache_entity_user",
"cid" : [ "profile2:user:uid" ],
"wildcard" : 0
}
}
]
}
}');
return $items;
}