forked from Islandora/islandora_solution_pack_book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
book_page_viewer.inc
44 lines (37 loc) · 1.21 KB
/
book_page_viewer.inc
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
<?php
class PageViewer {
private $pid = NULL;
/**
* Constructor
* @param type $pid
*/
function __construct($pid) {
$this->pid = $pid;
}
function showPage() {
global $base_url;
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'islandora_book', 'book_pack_utils');
$books = get_collection_from_pid($this->pid);
$book = $books[0];
$item = new fedora_item($this->pid);
$pid = $this->pid;
$links = array();
$links[] = l(t('Return to Book View'), "fedora/repository/$book");
$links = array_merge($links, module_invoke_all('islandora_book_get_pageview_links', $pid));
$htmlstr = theme_item_list($links);
$alink_options = array(
'attributes' => array('target' => '_blank', 'class' => 'fedora_image', 'title' => $pid),
'html' => TRUE,
);
$img = theme_image("$base_url/fedora/repository/$pid/JPEG", '', NULL, NULL, FALSE);
$htmlstr .= l($img, 'fedora/repository/'. $this->pid . '/JPEG/',$alink_options);
$tabset['pages_tab'] = array(
'#type' => 'tabpage',
'#title' => $item->objectProfile->objLabel,
'#content' => $htmlstr,
'#selected' => true,
);
return $tabset;
}
}