1 |
85ad3d82
|
Assos Assos
|
<?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 |
|
|
if (module_exists('contextual')) {
|
85 |
|
|
$data['views']['contextual_links'] = array(
|
86 |
|
|
'title' => t('Contextual Links'),
|
87 |
|
|
'help' => t('Display fields in a contextual links menu.'),
|
88 |
|
|
'field' => array(
|
89 |
|
|
'handler' => 'views_handler_field_contextual_links',
|
90 |
|
|
),
|
91 |
|
|
);
|
92 |
|
|
}
|
93 |
|
|
|
94 |
|
|
$data['views']['combine'] = array(
|
95 |
|
|
'title' => t('Combine fields filter'),
|
96 |
|
|
'help' => t('Combine two fields together and search by them.'),
|
97 |
|
|
'filter' => array(
|
98 |
|
|
'handler' => 'views_handler_filter_combine',
|
99 |
|
|
),
|
100 |
|
|
);
|
101 |
|
|
|
102 |
|
|
if (module_invoke('ctools', 'api_version', '1.7.1')) {
|
103 |
|
|
$data['views']['expression'] = array(
|
104 |
|
|
'title' => t('Math expression'),
|
105 |
|
|
'help' => t('Evaluates a mathematical expression and displays it.'),
|
106 |
|
|
'field' => array(
|
107 |
|
|
'handler' => 'views_handler_field_math',
|
108 |
|
|
'float' => TRUE,
|
109 |
|
|
),
|
110 |
|
|
);
|
111 |
|
|
}
|
112 |
|
|
|
113 |
|
|
return $data;
|
114 |
|
|
} |