-
Notifications
You must be signed in to change notification settings - Fork 3
/
islandora_whole_object.module
45 lines (41 loc) · 1.09 KB
/
islandora_whole_object.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
<?php
/**
* @file
* Renders various representations (JSON-LD, etc.) of an Islandora object.
*/
use Drupal\views\ViewExecutable;
/**
* Implements hook_theme().
*/
function islandora_whole_object_theme($existing, $type, $theme, $path) {
return [
'islandora_whole_object_block_pre' => [
'variables' => ['content' => NULL],
],
'islandora_whole_object_block_media' => [
'variables' => ['content' => NULL],
],
'islandora_whole_object_block_properties' => [
'variables' => ['content' => NULL],
],
'islandora_whole_object_block_hierarchy' => [
'variables' => [
'node' => NULL,
'children' => NULL,
'total_children' => NULL,
'parents' => NULL,
],
],
];
}
/**
* Implements hook_views_pre_render().
*/
function islandora_whole_object_views_pre_render(ViewExecutable $view) {
if (\Drupal::routeMatch()->getRouteName() == 'entity.node.canonical') {
if ($view->id() == 'media_of' && $view->current_display == 'page_1') {
unset($view->field['media_bulk_form']);
unset($view->field['operations']);
}
}
}