ctools_plugin_test.module 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Define some plugin systems to test ctools plugin includes.
  4. */
  5. /**
  6. * Implementation of hook_ctools_plugin_dierctory()
  7. */
  8. function ctools_plugin_test_ctools_plugin_directory($module, $plugin) {
  9. if ($module == 'ctools_plugin_test') {
  10. return 'plugins/' . $plugin;
  11. }
  12. }
  13. function ctools_plugin_test_ctools_plugin_type() {
  14. return array(
  15. 'extra_defaults' => array(
  16. 'defaults' => array(
  17. 'bool' => true,
  18. 'string' => 'string',
  19. 'array' => array('some value'),
  20. ),
  21. ),
  22. 'cached' => array(
  23. 'cache' => TRUE,
  24. 'classes' => array(
  25. 'handler',
  26. ),
  27. ),
  28. 'not_cached' => array(
  29. 'cache' => FALSE,
  30. 'classes' => array(
  31. 'handler',
  32. ),
  33. ),
  34. 'big_hook_cached' => array(
  35. 'cache' => TRUE,
  36. 'use hooks' => TRUE,
  37. 'classes' => array(
  38. 'handler',
  39. ),
  40. ),
  41. 'big_hook_not_cached' => array(
  42. 'cache' => FALSE,
  43. 'use hooks' => TRUE,
  44. 'classes' => array(
  45. 'handler',
  46. ),
  47. ),
  48. );
  49. }
  50. function ctools_plugin_test_ctools_plugin_test_big_hook_cached() {
  51. return array(
  52. 'test1' => array(
  53. 'function' => 'ctools_plugin_test_hook_cached_test',
  54. 'handler' => 'class1',
  55. ),
  56. );
  57. }
  58. function ctools_plugin_test_ctools_plugin_test_big_hook_not_cached() {
  59. return array(
  60. 'test1' => array(
  61. 'function' => 'ctools_plugin_test_hook_not_cached_test',
  62. 'class' => 'class1',
  63. ),
  64. );
  65. }
  66. function ctools_plugin_test_hook_cached_test() {}
  67. function ctools_plugin_test_hook_not_cached_test() {}