Projet

Général

Profil

Paste
Télécharger (3,62 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / views / modules / views.views.inc @ 6eb8d15f

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']['combine'] = array(
103
   'title' => t('Combine fields filter'),
104
    'help' => t('Combine two fields together and search by them.'),
105
    'filter' => array(
106
      'handler' => 'views_handler_filter_combine',
107
    ),
108
  );
109

    
110
  if (module_invoke('ctools', 'api_version', '1.7.1')) {
111
    $data['views']['expression'] = array(
112
      'title' => t('Math expression'),
113
      'help' => t('Evaluates a mathematical expression and displays it.'),
114
      'field' => array(
115
        'handler' => 'views_handler_field_math',
116
        'float' => TRUE,
117
      ),
118
    );
119
  }
120

    
121
  $data['views']['fields_compare'] = array(
122
    'title' => t('Fields comparison'),
123
    'help' => t('Compare database fields against eachother.'),
124
    'filter' => array(
125
      'help' => t('Use fields comparison to filter the result of the view.'),
126
      'handler' => 'views_handler_filter_fields_compare',
127
    )
128
  );
129

    
130
  return $data;
131
}