1
|
<?php
|
2
|
/**
|
3
|
* @file
|
4
|
* Views hooks for variables.
|
5
|
*/
|
6
|
/**
|
7
|
* Implements hook_views_data().
|
8
|
*/
|
9
|
function variable_views_views_data() {
|
10
|
// Basic table information.
|
11
|
|
12
|
// Define the base group of this table.
|
13
|
$data['variable']['table']['group'] = t('Variable');
|
14
|
|
15
|
// Advertise this table as a possible base table.
|
16
|
$data['variable']['table']['base'] = array(
|
17
|
'field' => 'name',
|
18
|
'title' => t('Variable'),
|
19
|
'help' => t('Variables from the system variable table.'),
|
20
|
);
|
21
|
// Variable name
|
22
|
$data['variable']['name'] = array(
|
23
|
'title' => t('Name'),
|
24
|
'help' => t('The low level name of the variable.'),
|
25
|
'field' => array(
|
26
|
'handler' => 'views_handler_field',
|
27
|
'click sortable' => TRUE,
|
28
|
),
|
29
|
'argument' => array(
|
30
|
'handler' => 'views_handler_argument_string',
|
31
|
),
|
32
|
'filter' => array(
|
33
|
'handler' => 'views_handler_filter_string',
|
34
|
),
|
35
|
'sort' => array(
|
36
|
'handler' => 'views_handler_sort',
|
37
|
),
|
38
|
);
|
39
|
// Varaible value
|
40
|
$data['variable']['value'] = array(
|
41
|
'title' => t('Value'),
|
42
|
'help' => t('The value of the variable.'),
|
43
|
'field' => array(
|
44
|
'handler' => 'views_handler_field_variable_value',
|
45
|
),
|
46
|
'argument' => array(
|
47
|
'handler' => 'views_handler_argument_string',
|
48
|
),
|
49
|
'filter' => array(
|
50
|
'handler' => 'views_handler_filter',
|
51
|
),
|
52
|
'sort' => array(
|
53
|
'handler' => 'views_handler_sort',
|
54
|
),
|
55
|
);
|
56
|
// Variable title
|
57
|
$data['variable']['title'] = array(
|
58
|
'group' => t('Variable'),
|
59
|
'real field' => 'name',
|
60
|
'field' => array(
|
61
|
'title' => t('Title'),
|
62
|
'help' => t('Human readable variable name.'),
|
63
|
'handler' => 'views_handler_field_variable_title',
|
64
|
),
|
65
|
);
|
66
|
return $data;
|
67
|
}
|