footnotes_views.views.inc 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * @file
  4. * To do views declarations.
  5. */
  6. /**
  7. * Implementation of hook_views_handlers().
  8. */
  9. function footnotes_views_views_handlers() {
  10. return array(
  11. 'handlers' => array(
  12. 'footnotes_views_handler_field' => array(
  13. 'parent' => 'views_handler_field_markup',
  14. ),
  15. 'footnotes_views_handler_field_body_content' => array(
  16. 'parent' => 'footnotes_views_handler_field',
  17. ),
  18. 'footnotes_views_handler_field_body_footnotes' => array(
  19. 'parent' => 'footnotes_views_handler_field',
  20. ),
  21. ),
  22. );
  23. }
  24. /**
  25. * Implementation of hook_views_data().
  26. */
  27. function footnotes_views_views_data() {
  28. $data = array();
  29. // node view extensions
  30. $data['node_revisions']['body_content'] = array(
  31. 'group' => t('Node'),
  32. 'title' => t('Body content'),
  33. 'help' => t('The content of the body without the footnotes.'),
  34. 'field' => array(
  35. 'field' => 'body',
  36. 'handler' => 'footnotes_views_handler_field_body_content',
  37. 'format' => 'format',
  38. ),
  39. 'filter' => array(
  40. 'handler' => 'views_handler_filter_string',
  41. ),
  42. );
  43. $data['node_revisions']['body_footnotes'] = array(
  44. 'group' => t('Node'),
  45. 'title' => t('Body footnotes'),
  46. 'help' => t('The footnotes alone, without body.'),
  47. 'field' => array(
  48. 'field' => 'body',
  49. 'handler' => 'footnotes_views_handler_field_body_footnotes',
  50. 'format' => 'format',
  51. ),
  52. 'filter' => array(
  53. 'handler' => 'views_handler_filter_string',
  54. ),
  55. );
  56. $data['node_revisions']['teaser_content'] = array(
  57. 'group' => t('Node'),
  58. 'title' => t('Teaser content'),
  59. 'help' => t('The content of the teaser without the footnotes.'),
  60. 'field' => array(
  61. 'field' => 'teaser',
  62. 'handler' => 'footnotes_views_handler_field_body_content',
  63. 'format' => 'format',
  64. ),
  65. 'filter' => array(
  66. 'handler' => 'views_handler_filter_string',
  67. ),
  68. );
  69. $data['node_revisions']['teaser_footnotes'] = array(
  70. 'group' => t('Node'),
  71. 'title' => t('Teaser footnotes'),
  72. 'help' => t('The footnotes alone, without the teaser.'),
  73. 'field' => array(
  74. 'field' => 'teaser',
  75. 'handler' => 'footnotes_views_handler_field_body_footnotes',
  76. 'format' => 'format',
  77. ),
  78. 'filter' => array(
  79. 'handler' => 'views_handler_filter_string',
  80. ),
  81. );
  82. return $data;
  83. }
  84. // vim: ts=2 sw=2 et syntax=php