-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconvertfile.rules_defaults.inc
39 lines (33 loc) · 1.02 KB
/
convertfile.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
<?php
/**
* @file
* Provide default rules that are preconfigured.
*/
/**
* Implements hook_default_rules_configuration().
*/
function convertfile_default_rules_configuration() {
$configs = array();
// Convert files to PDF success message.
$rule = '{ "convertfile_convert_to_pdf_success_message" : {
"LABEL" : "CF convert to PDF success message",
"PLUGIN" : "reaction rule",
"TAGS" : [ "convertfile", "pdf", "success" ],
"REQUIRES" : [ "convertfile", "rules" ],
"ON" : [ "convertfile_success" ],
"IF" : [
{ "NOT convertfile_condition_file_extension" : { "file" : [ "file" ], "extension" : "pdf" } },
{ "convertfile_condition_format" : {
"instance" : [ "instance" ],
"format" : { "value" : { "pdf" : "pdf" } }
}
}
],
"DO" : [
{ "drupal_message" : { "message" : "Your file has been automatically converted to the PDF format." } }
]
}
}';
$configs['convertfile_convert_to_pdf_success_message'] = rules_import($rule);
return $configs;
}