-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimagex_workflow.rules_defaults.inc
119 lines (116 loc) · 5.33 KB
/
imagex_workflow.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/**
* @file
* imagex_workflow.rules_defaults.inc
*/
/**
* Implements hook_default_rules_configuration().
*/
function imagex_workflow_default_rules_configuration() {
$items = array();
$items['rules_imagex_workflow_draft_to_needs_review'] = entity_import('rules_config', '{ "rules_imagex_workflow_draft_to_needs_review" : {
"LABEL" : "imagex_workflow_draft_to_needs_review",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "workbench" ],
"REQUIRES" : [ "workbench_moderation", "rules" ],
"ON" : { "workbench_moderation_after_moderation_transition" : [] },
"IF" : [
{ "content_is_using_workbench_moderation" : { "node" : [ "node" ] } },
{ "contents_previous_state" : { "node" : [ "node" ], "moderation_state" : "draft" } },
{ "contents_current_state" : { "node" : [ "node" ], "moderation_state" : "needs_review" } }
],
"DO" : [
{ "mail_to_users_of_role" : {
"roles" : { "value" : { "6" : "6" } },
"subject" : "[site:name] Moderation: [node:title]",
"message" : "Hello, \\r\\n\\r\\nA new item is ready for moderation, and can be found under the \\u0027Needs Review\\u0027 tab of Workbench Moderation.\\r\\n\\r\\n[node:url]\\r\\n\\r\\n* You are receiving this as a member of the role: Content Moderator.",
"from" : "[site:email]"
}
}
]
}
}');
$items['rules_imagex_workflow_needs_review_to_draft'] = entity_import('rules_config', '{ "rules_imagex_workflow_needs_review_to_draft" : {
"LABEL" : "imagex_workflow_needs_review_to_draft",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "workbench_moderation", "rules" ],
"ON" : { "workbench_moderation_after_moderation_transition" : [] },
"IF" : [
{ "content_is_using_workbench_moderation" : { "node" : [ "node" ] } },
{ "contents_previous_state" : { "node" : [ "node" ], "moderation_state" : "needs_review" } },
{ "contents_current_state" : { "node" : [ "node" ], "moderation_state" : "draft" } }
],
"DO" : [
{ "mail" : {
"to" : "[node:author:mail]",
"subject" : "Subject: [site:name] Not Ready: [node:title] ",
"message" : "Hello ,\\r\\n\\r\\nYour submission: [node:title] has been reverted to Draft, and can be viewed at [node:url]. Please review revision notes for more information, and next steps.",
"language" : [ "" ]
}
}
]
}
}');
$items['rules_imagex_workflow_needs_review_to_published'] = entity_import('rules_config', '{ "rules_imagex_workflow_needs_review_to_published" : {
"LABEL" : "imagex_workflow_needs_review_to_published",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "workbench" ],
"REQUIRES" : [ "workbench_moderation", "rules" ],
"ON" : { "workbench_moderation_after_moderation_transition" : [] },
"IF" : [
{ "content_is_using_workbench_moderation" : { "node" : [ "node" ] } },
{ "contents_current_state" : { "node" : [ "node" ], "moderation_state" : "published" } },
{ "contents_previous_state" : { "node" : [ "node" ], "moderation_state" : "needs_review" } }
],
"DO" : [
{ "mail" : {
"to" : "[node:author:mail]",
"subject" : " [site:name] Published: [node:title] ",
"message" : "Hello ,\\r\\n\\r\\nYour submission: [node:title] has been published, and can be viewed at [node:url]. \\r\\n",
"language" : [ "" ]
}
}
]
}
}');
$items['rules_imagex_workflow_published_to_needs_review'] = entity_import('rules_config', '{ "rules_imagex_workflow_published_to_needs_review" : {
"LABEL" : "imagex_workflow_published_to_needs_review",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "workbench" ],
"REQUIRES" : [ "workbench_moderation", "rules" ],
"ON" : { "workbench_moderation_after_moderation_transition" : [] },
"IF" : [
{ "content_is_using_workbench_moderation" : { "node" : [ "node" ] } },
{ "contents_current_state" : { "node" : [ "node" ], "moderation_state" : "needs_review" } },
{ "contents_previous_state" : { "node" : [ "node" ], "moderation_state" : "published" } }
],
"DO" : [
{ "mail" : {
"to" : "[node:author:mail]\\r\\n",
"subject" : " [site:name] Reverted to \\u2018Needs Review\\u2019: [node:title] ",
"message" : "Hello ,\\r\\n\\r\\nYour submission: [node:title] has been reverted to \\u0027Needs Review\\u0027, and can be viewed at [node:url]. Please review revision notes for more information and next steps.",
"language" : [ "" ]
}
}
]
}
}');
$items['rules_imagex_workflow_unpublished_rejected'] = entity_import('rules_config', '{ "rules_imagex_workflow_unpublished_rejected" : {
"LABEL" : "imagex_workflow_unpublished_rejected",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "workbench_moderation", "rules" ],
"ON" : { "node_update" : [] },
"IF" : [
{ "contents_current_state" : { "node" : [ "node" ], "moderation_state" : "rejected" } }
],
"DO" : [ { "node_unpublish" : { "node" : [ "node" ] } } ]
}
}');
features_alter_code('rules_config', $items);
return $items;
}