forked from Islandora/islandora_internet_archive_bookreader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
islandora_internet_archive_bookreader.module
121 lines (116 loc) · 4.22 KB
/
islandora_internet_archive_bookreader.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
* @file
* Defines all the hooks this module implements.
*/
/**
* Implements hook_menu().
*/
function islandora_internet_archive_bookreader_menu() {
return array(
'admin/islandora/islandora_viewers/internet_archive_bookreader' => array(
'title' => 'Internet Archive BookReader',
'description' => 'Configure the Internet Archive BookReader.',
'page callback' => 'drupal_get_form',
'page arguments' => array('islandora_internet_archive_bookreader_admin_settings_form'),
'access arguments' => array('administer site configuration'),
'file' => 'includes/admin.form.inc',
'type' => MENU_NORMAL_ITEM,
),
'internet_archive_bookreader_dimensions/%islandora_object' => array(
'page callback' => 'islandora_internet_archive_bookreader_dimensions_callback',
'page arguments' => array(1),
'access callback' => 'islandora_object_access_callback',
'access arguments' => array(ISLANDORA_VIEW_OBJECTS, 1),
'file' => 'includes/callback.inc',
'type' => MENU_CALLBACK,
),
'internet_archive_bookreader_text/%islandora_object' => array(
'page callback' => 'islandora_internet_archive_bookreader_text_callback',
'page arguments' => array(1),
'access callback' => 'islandora_object_access_callback',
'access arguments' => array(ISLANDORA_VIEW_OBJECTS, 1),
'file' => 'includes/callback.inc',
'type' => MENU_CALLBACK,
),
'internet_archive_bookreader_osd/%' => array(
'page callback' => 'islandora_internet_archive_bookreader_osd_callback',
'page arguments' => array(1, 2),
'access callback' => 'user_access',
'access arguments' => array(ISLANDORA_VIEW_OBJECTS),
'file' => 'includes/callback.inc',
'type' => MENU_CALLBACK,
),
'internet_archive_bookreader_search/%' => array(
'page callback' => 'islandora_internet_archive_bookreader_search_callback',
'page arguments' => array(1, 2),
'access callback' => 'user_access',
'access arguments' => array(ISLANDORA_VIEW_OBJECTS),
'file' => 'includes/callback.inc',
'type' => MENU_CALLBACK,
),
'internet_archive_bookreader_get_image_uri/%islandora_object' => array(
'page callback' => 'islandora_internet_archive_bookreader_get_image_uri_callback',
'page arguments' => array(1),
'access callback' => 'islandora_object_access_callback',
'access arguments' => array(ISLANDORA_VIEW_OBJECTS, 1),
'file' => 'includes/callback.inc',
'type' => MENU_CALLBACK,
),
);
}
/**
* Implements hook_theme().
*/
function islandora_internet_archive_bookreader_theme() {
return array(
'islandora_internet_archive_bookreader' => array(
'file' => 'theme/theme.inc',
'template' => 'theme/islandora-internet-archive-bookreader',
'variables' => array(
'object' => NULL,
'datastream_id' => 'JP2',
'page_progression' => NULL,
'pages' => array(),
),
),
'islandora_internet_archive_bookreader_book_info' => array(
'file' => 'theme/theme.inc',
'variables' => array('object' => NULL),
),
'islandora_internet_archive_bookreader_book_toc' => array(
'file' => 'theme/theme.inc',
'variables' => array('object' => NULL),
),
);
}
/**
* Implements hook_islandora_viewer_info().
*/
function islandora_internet_archive_bookreader_islandora_viewer_info() {
return array(
'islandora_internet_archive_bookreader' => array(
'label' => t('Internet Archive BookReader'),
'description' => t('Internet Archive BookReader.'),
'configuration' => 'admin/islandora/islandora_viewers/internet_archive_bookreader',
'callback' => 'islandora_internet_archive_bookreader_viewer_callback',
'model' => array(
'islandora:bookCModel',
'islandora:newspaperIssueCModel',
'islandora:manuscriptCModel',
),
),
);
}
/**
* Callback function for the viewer.
*
* @param array $params
* The params for the theme function 'islandora_internet_archive_bookreader'.
*
* @return string
* HTML repersentation of the Internet Archive BookReader.
*/
function islandora_internet_archive_bookreader_viewer_callback(array $params) {
return theme('islandora_internet_archive_bookreader', $params);
}