-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathding_campaign_plus.api.php
90 lines (81 loc) · 2.17 KB
/
ding_campaign_plus.api.php
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
<?php
/**
* @file
* Hooks provided by Ding Campaign plus.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Tells campaign plus that the modules provides campaign triggers.
*
* @return array
* The array contains node edit form elements, the title for the tab and
* the type that identifies this group of campaign triggers.
*/
function hook_ding_campaign_plus_info() {
return array(
'title' => t('Test'),
'type' => 'test',
'form' => 'ding_campaign_plus_test_admin_form',
'auto' => 'ding_campaign_plus_test_auto_admin_form',
'weight' => 0,
);
}
/**
* Used to find the campaigns that is trigger by current context.
*
* @param array $contexts
* Panel pane contexts for the current page.
* @param string $style
* The style set in the pane - ribbon or box.
*
* @return array
* The camping node id's keyed by type (here the weight type).
*/
function hook_ding_campaign_plus_matches(array $contexts, $style) {
$matches = array();
foreach ($contexts as $key => $context) {
switch ($key) {
case 'path':
$matches['path'] = _ding_campaign_plus_basic_match('path', $context->path);
break;
}
}
return $matches;
}
/**
* Defines default weight for the trigger that the module provides.
*/
function hook_ding_campaign_plus_default_weights() {
return array(
'search' => array(
'prefix' => t('Search'),
'title' => t('CQL statement'),
'weight' => 10,
),
);
}
/**
* Defines the rules for a given trigger for auto generated campaigns.
*
* @param array $config
* The auto generate administration configuration.
* @param object $campaign_node
* The campaign node that the rules should be generated for.
* @param \Entity $node
* The node that has triggered the auto generated campaign. Note that the node
* have not yet been saved to the database.
* @param array $subjects
* The subjects entered by the user.
*
* @return array
* Matching the modules rules format for the module.
*/
function hook_ding_campaign_plus_auto_trigger(array $config, $campaign_node, \Entity $node, array $subjects) {
return array('TYPE' => array('rules' => array()));
}
/**
* @} End of "addtogroup hooks".
*/