views_php.views.inc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. 'handler' => 'views_php_plugin_access',
  42. 'uses options' => TRUE,
  43. ),
  44. ),
  45. 'cache' => array(
  46. 'php' => array(
  47. 'title' => t('PHP'),
  48. 'help' => t('Use PHP code to determine whether a should be cached.'),
  49. 'handler' => 'views_php_plugin_cache',
  50. 'uses options' => TRUE,
  51. ),
  52. ),
  53. );
  54. return $plugins;
  55. }