1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Define some plugin systems to test CTools plugin includes.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Implementation of hook_ctools_plugin_directory().
|
10
|
*/
|
11
|
function ctools_plugin_test_ctools_plugin_directory($module, $plugin) {
|
12
|
if ($module == 'ctools_plugin_test') {
|
13
|
return 'plugins/' . $plugin;
|
14
|
}
|
15
|
}
|
16
|
|
17
|
/**
|
18
|
* Implements hook_ctools_plugin_type().
|
19
|
*/
|
20
|
function ctools_plugin_test_ctools_plugin_type() {
|
21
|
return array(
|
22
|
'extra_defaults' => array(
|
23
|
'defaults' => array(
|
24
|
'bool' => true,
|
25
|
'string' => 'string',
|
26
|
'array' => array('some value'),
|
27
|
),
|
28
|
),
|
29
|
'cached' => array(
|
30
|
'cache' => TRUE,
|
31
|
'classes' => array(
|
32
|
'handler',
|
33
|
),
|
34
|
),
|
35
|
'not_cached' => array(
|
36
|
'cache' => FALSE,
|
37
|
'classes' => array(
|
38
|
'handler',
|
39
|
),
|
40
|
),
|
41
|
'big_hook_cached' => array(
|
42
|
'cache' => TRUE,
|
43
|
'use hooks' => TRUE,
|
44
|
'classes' => array(
|
45
|
'handler',
|
46
|
),
|
47
|
),
|
48
|
'big_hook_not_cached' => array(
|
49
|
'cache' => FALSE,
|
50
|
'use hooks' => TRUE,
|
51
|
'classes' => array(
|
52
|
'handler',
|
53
|
),
|
54
|
),
|
55
|
);
|
56
|
}
|
57
|
|
58
|
/**
|
59
|
* Plugin callback.
|
60
|
*
|
61
|
* @see ctools_plugin_test_ctools_plugin_type()
|
62
|
*/
|
63
|
function ctools_plugin_test_ctools_plugin_test_big_hook_cached() {
|
64
|
return array(
|
65
|
'test1' => array(
|
66
|
'function' => 'ctools_plugin_test_hook_cached_test',
|
67
|
'handler' => 'class1',
|
68
|
),
|
69
|
);
|
70
|
}
|
71
|
|
72
|
/**
|
73
|
* Plugin callback.
|
74
|
*
|
75
|
* @see ctools_plugin_test_ctools_plugin_type()
|
76
|
*/
|
77
|
function ctools_plugin_test_ctools_plugin_test_big_hook_not_cached() {
|
78
|
return array(
|
79
|
'test1' => array(
|
80
|
'function' => 'ctools_plugin_test_hook_not_cached_test',
|
81
|
'class' => 'class1',
|
82
|
),
|
83
|
);
|
84
|
}
|
85
|
|
86
|
/**
|
87
|
* Callback for the big_hook_cached plugin.
|
88
|
*
|
89
|
* @see ctools_plugin_test_ctools_plugin_test_big_hook_cached
|
90
|
*/
|
91
|
function ctools_plugin_test_hook_cached_test() {}
|
92
|
|
93
|
/**
|
94
|
* Callback for the big_hook_not_cached plugin.
|
95
|
*
|
96
|
* @see ctools_plugin_test_ctools_plugin_test_big_hook_not_cached()
|
97
|
*/
|
98
|
function ctools_plugin_test_hook_not_cached_test() {}
|