Projet

Général

Profil

Paste
Télécharger (1,99 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / ctools / tests / ctools_plugin_test.module @ 6e3ce7c2

1 85ad3d82 Assos Assos
<?php
2 7e72b748 Assos Assos
3 85ad3d82 Assos Assos
/**
4 7e72b748 Assos Assos
 * @file
5
 * Define some plugin systems to test CTools plugin includes.
6 85ad3d82 Assos Assos
 */
7
8
/**
9 7e72b748 Assos Assos
 * Implementation of hook_ctools_plugin_directory().
10 85ad3d82 Assos Assos
 */
11
function ctools_plugin_test_ctools_plugin_directory($module, $plugin) {
12
  if ($module == 'ctools_plugin_test') {
13
    return 'plugins/' . $plugin;
14
  }
15
}
16
17 7e72b748 Assos Assos
/**
18
 * Implements hook_ctools_plugin_type().
19
 */
20 85ad3d82 Assos Assos
function ctools_plugin_test_ctools_plugin_type() {
21
  return array(
22
    'extra_defaults' => array(
23
      'defaults' => array(
24 c304a780 Assos Assos
        'bool' => TRUE,
25 85ad3d82 Assos Assos
        '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 7e72b748 Assos Assos
/**
59
 * Plugin callback.
60
 *
61
 * @see ctools_plugin_test_ctools_plugin_type()
62
 */
63 85ad3d82 Assos Assos
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 7e72b748 Assos Assos
/**
73
 * Plugin callback.
74
 *
75
 * @see ctools_plugin_test_ctools_plugin_type()
76
 */
77 85ad3d82 Assos Assos
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 7e72b748 Assos Assos
/**
87
 * Callback for the big_hook_cached plugin.
88
 *
89
 * @see ctools_plugin_test_ctools_plugin_test_big_hook_cached
90
 */
91 c304a780 Assos Assos
function ctools_plugin_test_hook_cached_test() {
92
}
93 7e72b748 Assos Assos
94
/**
95
 * Callback for the big_hook_not_cached plugin.
96
 *
97
 * @see ctools_plugin_test_ctools_plugin_test_big_hook_not_cached()
98
 */
99 c304a780 Assos Assos
function ctools_plugin_test_hook_not_cached_test() {
100
}