-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathislandora_custom_thumbnail.module
50 lines (46 loc) · 1.66 KB
/
islandora_custom_thumbnail.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
<?php
/**
* @file
* Defines all the hooks this module implements.
*/
/**
* Implements hook_menu().
*/
function islandora_custom_thumbnail_menu() {
return array(
'admin/islandora/tools/islandora_custom_thumbnail' => array(
'title' => 'Islandora Custom Thumbnail',
'description' => 'Configure settings for the Islandora Custom Thumbnail module.',
'page callback' => 'drupal_get_form',
'page arguments' => array('islandora_custom_thumbnail_admin_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'includes/admin.form.inc',
),
);
}
/**
* Implements hook_islandora_ingest_steps_alter().
*/
function islandora_custom_thumbnail_islandora_ingest_steps_alter(array &$steps, array &$form_state) {
if (isset($steps['xml_form_builder_metadata_step'])) {
$association = isset($steps['xml_form_builder_metadata_step']['args'][0]) ? $steps['xml_form_builder_metadata_step']['args'][0] : NULL;
$steps['islandora_custom_thumbnail_upload'] = array(
'type' => 'form',
'weight' => 20,
'form_id' => 'islandora_custom_thumbnail_file_form',
'args' => array(),
'file' => 'includes/file.form.inc',
'module' => 'islandora_custom_thumbnail',
);
}
}
/**
* Implements hook_islandora_derivative_alter().
*/
function islandora_custom_thumbnail_islandora_derivative_alter(&$derivatives, AbstractObject $object = NULL, $ds_modified_params = array()) {
foreach ($derivatives as $key => $derivative) {
if ($derivative['destination_dsid'] == 'TN' && variable_get('islandora_custom_thumbnail_suppress_thumbnail_regeneration', TRUE)) {
unset($derivatives[$key]);
}
}
}