views_php.views.inc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * @file
  4. * Provide views handlers and plugins that allow usage of PHP.
  5. */
  6. /**
  7. * Implements hook_views_data().
  8. */
  9. function views_php_views_data() {
  10. $data['views']['php'] = array(
  11. 'title' => t('PHP'),
  12. 'help' => t('Use PHP code.'),
  13. 'area' => array(
  14. 'help' => t('Use PHP code to construct the output of an area.'),
  15. 'handler' => 'views_php_handler_area',
  16. ),
  17. 'field' => array(
  18. 'help' => t('Use PHP code to construct the output of a field.'),
  19. 'handler' => 'views_php_handler_field',
  20. ),
  21. 'filter' => array(
  22. 'help' => t('Use PHP code to filter the result of the view.'),
  23. 'handler' => 'views_php_handler_filter',
  24. ),
  25. 'sort' => array(
  26. 'help' => t('Use PHP code to sort the result of the view.'),
  27. 'handler' => 'views_php_handler_sort',
  28. ),
  29. );
  30. return $data;
  31. }
  32. /**
  33. * Implements hook_views_plugins().
  34. */
  35. function views_php_views_plugins() {
  36. $plugins = array(
  37. 'access' => array(
  38. 'php' => array(
  39. 'title' => t('PHP'),
  40. 'help' => t('Use PHP code to grant access.'),
  41. 'help topic' => '',
  42. 'handler' => 'views_php_plugin_access',
  43. 'uses options' => TRUE,
  44. ),
  45. ),
  46. 'cache' => array(
  47. 'php' => array(
  48. 'title' => t('PHP'),
  49. 'help' => t('Use PHP code to determine whether a should be cached.'),
  50. 'help topic' => '',
  51. 'handler' => 'views_php_plugin_cache',
  52. 'uses options' => TRUE,
  53. ),
  54. ),
  55. );
  56. return $plugins;
  57. }