-
Notifications
You must be signed in to change notification settings - Fork 1
/
lookup.views.inc
77 lines (71 loc) · 1.94 KB
/
lookup.views.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* @file
* Views integration for the Lookup details module.
*/
/**
* Implements hook_views_data().
*/
function lookup_views_data() {
$data['users_lookup_detail']['table']['group'] = t('Lookup');
$data['users_lookup_detail']['table']['join'] = array(
'users' => array(
'left_field' => 'uid',
'field' => 'uid',
),
);
$data['users_lookup_detail']['name'] = array(
'title' => t('Lookup name'),
'help' => t('The user\'s name as set in Lookup.'),
'field' => array(
'handler' => 'views_handler_field_user',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
'title' => t('Name'),
'help' => t('The user\'s name as set in Lookup.')
),
);
$data['users_lookup_detail']['staff'] = array(
'title' => t('Staff'),
'help' => t('The user is a member of staff.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Staff'),
'type' => 'yes-no',
'use equal' => TRUE,
),
);
$data['users_lookup_detail']['student'] = array(
'title' => t('Student'),
'help' => t('The user is a student.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Student'),
'type' => 'yes-no',
'use equal' => TRUE,
),
);
return $data;
}