forked from Islandora/islandora_pdfjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathislandora_pdfjs.module
58 lines (53 loc) · 1.29 KB
/
islandora_pdfjs.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
55
56
57
58
<?php
/**
* @file
* Defines all the hooks this module implements.
*/
/**
* Implements hook_theme().
*/
function islandora_pdfjs_theme() {
return array(
'islandora_pdfjs' => array(
'file' => 'theme/theme.inc',
'template' => 'theme/islandora-pdfjs',
'variables' => array(
'fedora_object' => NULL,
),
),
'viewer' => array(
'file' => 'theme/theme.inc',
'template' => 'theme/viewer',
'variables' => array(
'fedora_object' => NULL,
),
),
);
}
/**
* Implements hook_islandora_viewer_info().
*/
function islandora_pdfjs_islandora_viewer_info() {
return array(
'islandora_pdfjs' => array(
'label' => t('pdf.js Reader'),
'description' => t('Mozilla pdf.js Reader.'),
'configuration' => '',
'callback' => 'islandora_pdfjs_viewer_callback',
'model' => array('islandora:sp_pdf'),
'mimetype' => array('application/pdf'),
),
);
}
/**
* Callback function for the viewer.
*
* @param array $params
* The params for the theme function 'islandora_pdfjs'.
*
* @return string
* HTML repersentation of the pdf.js Reader.
*/
function islandora_pdfjs_viewer_callback(array $params, $fedora_object = NULL) {
return theme('islandora_pdfjs', array('fedora_object' => $fedora_object));
}