pastebin

Paste Search Dynamic
Recent pastes
hook views data
  1. <?php
  2.  
  3. /**
  4.  * @file
  5.  * Provide views data and handlers that aren't tied to any other module.
  6.  *
  7.  * @ingroup views_module_handlers
  8.  */
  9.  
  10. /**
  11.  * Implements hook_views_data().
  12.  */
  13. function views_views_data() {
  14.   $data['views']['table']['group'] = t('Global');
  15.   $data['views']['table']['join'] = array(
  16.     // '#global' is a special flag which let's a table appear all the time.
  17.     '#global' => array(),
  18.   );
  19.  
  20.   $data['views']['random'] = array(
  21.     'title' => t('Random'),
  22.     'help' => t('Randomize the display order.'),
  23.     'sort' => array(
  24.       'handler' => 'views_handler_sort_random',
  25.     ),
  26.   );
  27.  
  28.   $data['views']['null'] = array(
  29.     'title' => t('Null'),
  30.     '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.'),
  31.     'argument' => array(
  32.       'handler' => 'views_handler_argument_null',
  33.     ),
  34.   );
  35.  
  36.   $data['views']['nothing'] = array(
  37.     'title' => t('Custom text'),
  38.     'help' => t('Provide custom text or link.'),
  39.     'field' => array(
  40.       'handler' => 'views_handler_field_custom',
  41.     ),
  42.   );
  43.  
  44.   $data['views']['counter'] = array(
  45.     'title' => t('View result counter'),
  46.     'help' => t('Displays the actual position of the view result'),
  47.     'field' => array(
  48.       'handler' => 'views_handler_field_counter',
  49.     ),
  50.   );
  51.  
  52.   $data['views']['area'] = array(
  53.     'title' => t('Text area'),
  54.     'help' => t('Provide markup text for the area.'),
  55.     'area' => array(
  56.       'handler' => 'views_handler_area_text',
  57.     ),
  58.   );
  59.  
  60.   $data['views']['area_text_custom'] = array(
  61.     'title' => t('Unfiltered text'),
  62.     'help' => t('Add unrestricted, custom text or markup. This is similar to the custom text field.'),
  63.     'area' => array(
  64.       'handler' => 'views_handler_area_text_custom',
  65.     ),
  66.   );
  67.  
  68.   $data['views']['view'] = array(
  69.     'title' => t('View area'),
  70.     'help' => t('Insert a view inside an area.'),
  71.     'area' => array(
  72.       'handler' => 'views_handler_area_view',
  73.     ),
  74.   );
  75.  
  76.   $data['views']['result'] = array(
  77.     'title' => t('Result summary'),
  78.     'help' => t('Shows result summary, for example the items per page.'),
  79.     'area' => array(
  80.       'handler' => 'views_handler_area_result',
  81.     ),
  82.   );
  83.  
  84.   $data['views']['messages'] = array(
  85.     'title' => t('Messages'),
  86.     'help' => t('Displays messages in the area.'),
  87.     'area' => array(
  88.       'handler' => 'views_handler_area_messages',
  89.     ),
  90.   );
  91.  
  92.   if (module_exists('contextual')) {
  93.     $data['views']['contextual_links'] = array(
  94.       'title' => t('Contextual Links'),
  95.       'help' => t('Display fields in a contextual links menu.'),
  96.       'field' => array(
  97.         'handler' => 'views_handler_field_contextual_links',
  98.       ),
  99.     );
  100.   }
  101.  
  102.   $data['views']['ctools_dropdown'] = array(
  103.     'title' => t('Dropdown links'),
  104.     'help' => t('Displays fields in a dropdown list, like on the views listing page.'),
  105.     'field' => array(
  106.       'handler' => 'views_handler_field_ctools_dropdown',
  107.     ),
  108.   );
  109.  
  110.   $data['views']['combine'] = array(
  111.     'title' => t('Combine fields filter'),
  112.     'help' => t('Combine multiple fields together and search by them.'),
  113.     'filter' => array(
  114.       'handler' => 'views_handler_filter_combine',
  115.     ),
  116.   );
  117.  
  118.   if (module_invoke('ctools', 'api_version', '1.7.1')) {
  119.     $data['views']['expression'] = array(
  120.       'title' => t('Math expression'),
  121.       'help' => t('Evaluates a mathematical expression and displays it.'),
  122.       'field' => array(
  123.         'handler' => 'views_handler_field_math',
  124.         'float' => true,
  125.       ),
  126.     );
  127.   }
  128.  
  129.   $data['views']['fields_compare'] = array(
  130.     'title' => t('Fields comparison'),
  131.     'help' => t('Compare database fields against eachother.'),
  132.     'filter' => array(
  133.       'help' => t('Use fields comparison to filter the result of the view.'),
  134.       'handler' => 'views_handler_filter_fields_compare',
  135.     ),
  136.   );
  137.  
  138.   return $data;
  139. }
  140. ?>
Parsed in 0.117 seconds