views.views.inc 3.26 KB
Newer Older
merlinofchaos's avatar
merlinofchaos committed
1 2 3 4 5 6 7 8 9 10 11 12
<?php

/**
 * @file
 * Provide views data and handlers that aren't tied to any other module.
 *
 * @ingroup views_module_handlers
 */

/**
 * Implements hook_views_data().
 */
13 14 15 16
    function views_views_data() {
    $data['views']['table']['group'] = t('Global');
    $data['views']['table']['join'] = array(
      // #global is a special flag which let's a table appear all the time.
merlinofchaos's avatar
merlinofchaos committed
17
    '#global' => array(),
18
    );
merlinofchaos's avatar
merlinofchaos committed
19

20
    $data['views']['random'] = array(
merlinofchaos's avatar
merlinofchaos committed
21 22 23
    'title' => t('Random'),
    'help' => t('Randomize the display order.'),
    'sort' => array(
24 25 26
      'handler' => 'Drupal\views\Plugins\views\sort\Random',
      ),
    );
merlinofchaos's avatar
merlinofchaos committed
27 28 29 30 31

  $data['views']['null'] = array(
    'title' => t('Null'),
    '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.'),
    'argument' => array(
32
      'handler' => 'Drupal\views\Plugins\views\argument\Null',
merlinofchaos's avatar
merlinofchaos committed
33 34 35 36 37 38 39
    ),
  );

  $data['views']['nothing'] = array(
    'title' => t('Custom text'),
    'help' => t('Provide custom text or link.'),
    'field' => array(
40
      'handler' => 'Drupal\views\Plugins\views\field\Custom',
merlinofchaos's avatar
merlinofchaos committed
41 42 43 44 45 46 47
    ),
  );

  $data['views']['counter'] = array(
    'title' => t('View result counter'),
    'help' => t('Displays the actual position of the view result'),
    'field' => array(
48
      'handler' => 'Drupal\views\Plugins\views\field\Counter',
merlinofchaos's avatar
merlinofchaos committed
49 50 51 52 53 54 55
    ),
  );

  $data['views']['area'] = array(
    'title' => t('Text area'),
    'help' => t('Provide markup text for the area.'),
    'area' => array(
56
      'handler' => 'Drupal\views\Plugins\views\area\Text',
merlinofchaos's avatar
merlinofchaos committed
57 58 59
    ),
  );

60 61 62 63 64 65 66 67
  $data['views']['area_text_custom'] = array(
    'title' => t('Unfiltered text'),
    'help' => t('Add unrestricted, custom text or markup. This is similar to the custom text field.'),
    'area' => array(
      'handler' => 'views_handler_area_text_custom',
    ),
  );

merlinofchaos's avatar
merlinofchaos committed
68 69 70 71
  $data['views']['view'] = array(
    'title' => t('View area'),
    'help' => t('Insert a view inside an area.'),
    'area' => array(
72
      'handler' => 'Drupal\views\Plugins\views\area\View',
merlinofchaos's avatar
merlinofchaos committed
73 74 75 76 77 78 79
    ),
  );

  $data['views']['result'] = array(
    'title' => t('Result summary'),
    'help' => t('Shows result summary, for example the items per page.'),
    'area' => array(
80
      'handler' => 'Drupal\views\Plugins\views\area\Result',
merlinofchaos's avatar
merlinofchaos committed
81 82 83 84 85 86 87 88
    ),
  );

  if (module_exists('contextual')) {
    $data['views']['contextual_links'] = array(
      'title' => t('Contextual Links'),
      'help' => t('Display fields in a contextual links menu.'),
      'field' => array(
89
        'handler' => 'Drupal\views\Plugins\views\field\ContextualLinks',
merlinofchaos's avatar
merlinofchaos committed
90 91 92 93 94 95 96 97
      ),
    );
  }

  $data['views']['combine'] = array(
   'title' => t('Combine fields filter'),
    'help' => t('Combine two fields together and search by them.'),
    'filter' => array(
98
      'handler' => 'Drupal\views\Plugins\views\filter\Combine',
merlinofchaos's avatar
merlinofchaos committed
99 100 101 102 103 104 105 106
    ),
  );

  if (module_invoke('ctools', 'api_version', '1.7.1')) {
    $data['views']['expression'] = array(
      'title' => t('Math expression'),
      'help' => t('Evaluates a mathematical expression and displays it.'),
      'field' => array(
107
        'handler' => 'Drupal\views\Plugins\views\field\Math',
merlinofchaos's avatar
merlinofchaos committed
108 109 110 111 112 113 114
        'float' => TRUE,
      ),
    );
  }

  return $data;
}