-
Notifications
You must be signed in to change notification settings - Fork 5
/
embargo.views.inc
39 lines (35 loc) · 1012 Bytes
/
embargo.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
<?php
/**
* @file
* Views hook implementations.
*/
/**
* Implements hook_views_data_alter().
*/
function embargo_views_data_alter(array &$data) {
$data['node_field_data']['embargo__embargoes'] = [
'title' => \t('Embargoes'),
'help' => \t('Embargoes applicable to the given node.'),
'relationship' => [
'base' => 'embargo',
'base field' => 'embargoed_node',
'field' => 'nid',
'id' => 'standard',
'label' => \t('Embargoes'),
],
];
$data['users_field_data']['embargo__exempt_users'] = [
'title' => \t('Embargo exemptions'),
'help' => \t('Embargoes for which the given user is specifically exempt.'),
'relationship' => [
'id' => 'entity_reverse',
'field_name' => 'embargo__exempt_users',
'entity_type' => 'embargo',
'field table' => 'embargo__exempt_users',
'field field' => 'exempt_users_target_id',
'base' => 'embargo',
'base field' => 'id',
'label' => \t('Embargo exemptions'),
],
];
}