views.views.inc

  1. 3.x modules/views.views.inc
  2. 2.x modules/views.views.inc

Provide views data and handlers that aren't tied to any other module.

File

modules/views.views.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Provide views data and handlers that aren't tied to any other module.
  5. *
  6. * @ingroup views_module_handlers
  7. */
  8. /**
  9. * Implements hook_views_data().
  10. */
  11. function views_views_data() {
  12. $data['views']['table']['group'] = t('Global');
  13. $data['views']['table']['join'] = array(
  14. // #global is a special flag which let's a table appear all the time.
  15. '#global' => array(),
  16. );
  17. $data['views']['random'] = array(
  18. 'title' => t('Random'),
  19. 'help' => t('Randomize the display order.'),
  20. 'sort' => array(
  21. 'handler' => 'views_handler_sort_random',
  22. ),
  23. );
  24. $data['views']['null'] = array(
  25. 'title' => t('Null'),
  26. 'help' => t('Allow a contextual filter value to be ignored. The query will not be altered by this contextual filter value. Can be used when contextual filter values come from the URL, and a part of the URL needs to be ignored.'),
  27. 'argument' => array(
  28. 'handler' => 'views_handler_argument_null',
  29. ),
  30. );
  31. $data['views']['nothing'] = array(
  32. 'title' => t('Custom text'),
  33. 'help' => t('Provide custom text or link.'),
  34. 'field' => array(
  35. 'handler' => 'views_handler_field_custom',
  36. ),
  37. );
  38. $data['views']['counter'] = array(
  39. 'title' => t('View result counter'),
  40. 'help' => t('Displays the actual position of the view result'),
  41. 'field' => array(
  42. 'handler' => 'views_handler_field_counter',
  43. ),
  44. );
  45. $data['views']['area'] = array(
  46. 'title' => t('Text area'),
  47. 'help' => t('Provide markup text for the area.'),
  48. 'area' => array(
  49. 'handler' => 'views_handler_area_text',
  50. ),
  51. );
  52. $data['views']['area_text_custom'] = array(
  53. 'title' => t('Unfiltered text'),
  54. 'help' => t('Add unrestricted, custom text or markup. This is similar to the custom text field.'),
  55. 'area' => array(
  56. 'handler' => 'views_handler_area_text_custom',
  57. ),
  58. );
  59. $data['views']['view'] = array(
  60. 'title' => t('View area'),
  61. 'help' => t('Insert a view inside an area.'),
  62. 'area' => array(
  63. 'handler' => 'views_handler_area_view',
  64. ),
  65. );
  66. $data['views']['result'] = array(
  67. 'title' => t('Result summary'),
  68. 'help' => t('Shows result summary, for example the items per page.'),
  69. 'area' => array(
  70. 'handler' => 'views_handler_area_result',
  71. ),
  72. );
  73. if (module_exists('contextual')) {
  74. $data['views']['contextual_links'] = array(
  75. 'title' => t('Contextual Links'),
  76. 'help' => t('Display fields in a contextual links menu.'),
  77. 'field' => array(
  78. 'handler' => 'views_handler_field_contextual_links',
  79. ),
  80. );
  81. }
  82. $data['views']['combine'] = array(
  83. 'title' => t('Combine fields filter'),
  84. 'help' => t('Combine two fields together and search by them.'),
  85. 'filter' => array(
  86. 'handler' => 'views_handler_filter_combine',
  87. ),
  88. );
  89. if (module_invoke('ctools', 'api_version', '1.7.1')) {
  90. $data['views']['expression'] = array(
  91. 'title' => t('Math expression'),
  92. 'help' => t('Evaluates a mathematical expression and displays it.'),
  93. 'field' => array(
  94. 'handler' => 'views_handler_field_math',
  95. 'float' => TRUE,
  96. ),
  97. );
  98. }
  99. $data['views']['fields_compare'] = array(
  100. 'title' => t('Fields comparison'),
  101. 'help' => t('Compare database fields against eachother.'),
  102. 'filter' => array(
  103. 'help' => t('Use fields comparison to filter the result of the view.'),
  104. 'handler' => 'views_handler_filter_fields_compare',
  105. )
  106. );
  107. return $data;
  108. }

Related topics