forked from discoverygarden/pcdora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcdora.module
52 lines (48 loc) · 1.2 KB
/
pcdora.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
<?php
/**
* @file
* Hooks and functions for this module.
*/
/**
* Implements hook_menu().
*/
function pcdora_menu() {
$items = array();
$items['raw/islandora/%islandora_object/%'] = array(
'title' => 'Raw image callback',
'page callback' => 'pcdora_raw_image',
'page arguments' => array(2, 3),
'access callback' => TRUE,
'file' => 'includes/callbacks.inc',
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Implements hook_theme().
*/
function pcdora_theme() {
return array(
'pcdora_raw' => array(
'template' => 'theme/pcdora-raw-image',
'variables' => array(
'raw' => NULL,
),
),
);
}
/**
* Implements hook_preprocess().
*/
function pcdora_preprocess_islandora_basic_image(&$variables) {
$islandora_object = $variables['islandora_object'];
if (!is_null($islandora_object->id)) {
$link_url = url("raw/islandora/{$islandora_object->id}/OBJ", array('absolute' => TRUE));
if (isset($variables['islandora_full_url'])) {
$variables['islandora_content'] = l($variables['islandora_medium_img'], $link_url, array('html' => TRUE));
}
else {
$variables['islandora_content'] = $variables['islandora_medium_img'];
}
}
}