forked from Islandora/islandora_solution_pack_book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page_object_manager.inc
54 lines (48 loc) · 1.86 KB
/
page_object_manager.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
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Wrapper to return management content as tab
* @param PID $pid
* @return rendered form
*/
function page_management_wrapper($pid) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
return drupal_render(get_page_model_management_content($pid));
}
/**
*
* @param PID $pid
* @return form
*/
function get_page_model_management_content($pid) {
$page_management_links = array();
$page_management_links[] = l(t('Metadata'), "islandora/page/manage/metadata/$pid");
$page_management_links[] = l(t('Update Derived Datastreams'), "islandora/page/manage/refresh/$pid");
$page_management_links[] = l(t('Manage Current Datastreams'), "islandora/page/manage/datastreams/$pid");
$page_management_links[] = l(t('Edit OCR'), "islandora/page/manage/editOCR/$pid");
if (user_access('delete pages')) {
$page_management_links[] = l(t('Delete This Page'), "islandora/page/manage/delete/$pid");
}
$list = theme_item_list($page_management_links);
$form['manage_page_tab'] = array(
'#type' => 'tabpage',
'#title' => t('Manage'),
'#content' => $list,
'#selected' => FALSE,
);
return $form;
}
function islandora_book_page_management($function, $pid) {
module_load_include('inc', 'islandora_book', 'management/pageMetadata');
module_load_include('inc', 'islandora_book', 'management/updatePageDatastreams');
module_load_include('inc', 'islandora_book', 'management/managePageDatastreams');
module_load_include('inc', 'islandora_book', 'management/editOCR');
$mappings = array(
'metadata' => 'islandora_book_get_metadata_link',
'refresh' => 'islandora_book_update_derived',
'datastreams' => 'islandora_book_page_datastreams',
'delete' => 'islandora_book_page_delete',
'editOCR' => 'islandora_edit_OCR'
);
$results = drupal_get_form($mappings[$function], $pid);
return drupal_get_form($mappings[$function], $pid);
}