-
Notifications
You must be signed in to change notification settings - Fork 37
/
islandora_solr_metadata.api.php
41 lines (39 loc) · 1.44 KB
/
islandora_solr_metadata.api.php
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
<?php
/**
* @file
* Hook descriptions.
*/
/**
* Display element alter.
*
* @param array $elements
* The associative array of parameters as used by the
* 'islandora_solr_metadata_display' element, including:
* - islandora_object: The object for which the display is being rendered.
* - print: A boolean flag indicating if the display is to be rendered in a
* printer-friendly manner.
* - associations: An array of metadata configuration IDs, similar to the
* return of islandora_solr_metadata_get_associations_by_cmodels().
*/
function hook_islandora_solr_metadata_display_elements_alter(&$elements) {
// Artificial example: Get rid of associations if the object is not active.
if ($elements['islandora_object']->state != 'A') {
$elements['associations'] = array();
}
}
/**
* Description element alter.
*
* @param array $elements
* The associative array of parameters as used by the
* 'islandora_solr_metadata_display' element, including:
* - islandora_object: The object for which the display is being rendered.
* - associations: An array of metadata configuration IDs, similar to the
* return of islandora_solr_metadata_get_associations_by_cmodels().
*/
function hook_islandora_solr_metadata_description_elements_alter(&$elements) {
// Artificial example: Get rid of associations if the object is not active.
if ($elements['islandora_object']->state != 'A') {
$elements['associations'] = array();
}
}