forked from digitalutsc/group_solr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
group_solr.module
54 lines (46 loc) · 1.28 KB
/
group_solr.module
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
<?php
/**
* @file
* Contains group_solr.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function group_solr_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the group_solr module.
case 'help.page.group_solr':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('This module add Solr indexed field(s) which is determined access control with
<a href="https://www.drupal.org/project/group" target="_blank">Group</a>
for an indexed item to be public or private for annonymous users') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function group_solr_theme() {
return [
'group_solr' => [
'render element' => 'children',
],
];
}
/**
* Implements hook_views_data().
*/
function group_solr_views_data_alter(array &$data) {
$data['views']['access_control_with_group_filter'] = [
'title' => t('Access Control Filter - Configurable with Group'),
'group' => t('Access control'),
'filter' => [
'title' => t('Access Control Filter - Configurable with Group'),
'field' => 'group_access_control',
'id' => 'access_control_with_group_filter',
],
];
}