-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathoa_core.views.inc
55 lines (48 loc) · 1.56 KB
/
oa_core.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
<?php
/**
* @file
* Code for the OpenAtrium Core views alterations.
*/
/**
* Implements hook_views_data().
*/
function oa_core_views_data() {
$data = array();
$data['field_data_oa_parent']['is_parent'] = array(
'title' => t('Is Parent'),
'help' => t('Content is a parent'),
'filter' => array(
'handler' => 'views_handler_filter_is_parent',
),
);
return $data;
}
/**
* Implements hook_views_data_alter
*/
function oa_core_views_data_alter(&$data) {
if (isset($data['og_membership']['og_group_ref_target_id']['filter']['handler'])) {
$data['og_membership']['og_group_ref_target_id']['filter']['handler'] = 'oa_core_og_group_ref_views_handler_filter_in_operator';
}
if (isset($data['og_membership']['oa_parent_space_target_id']['filter']['handler'])) {
$data['og_membership']['oa_parent_space_target_id']['filter']['handler'] = 'oa_core_og_group_ref_views_handler_filter_in_operator';
}
if (isset($data['field_data_oa_section_ref']['oa_section_ref_target_id']['filter']['handler'])) {
$data['field_data_oa_section_ref']['oa_section_ref_target_id']['filter']['handler'] = 'oa_core_oa_section_ref_views_handler_filter_in_operator';
}
}
/**
* Implements hook_views_plugins().
*/
function oa_core_views_plugins() {
return array(
'exposed_form' => array(
'oa_form' => array(
'title' => t('Open Atrium'),
'help' => t('Open Atrium exposed filter form adds some options that integrate with Bootstrap.'),
'handler' => 'oa_views_plugin_exposed_form',
'uses options' => TRUE,
),
),
);
}