forked from Islandora/islandora_solution_pack_book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbook_object_manager.inc
58 lines (54 loc) · 1.96 KB
/
book_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
55
56
57
<?php
/**
* wrapper function to allow tab callback detail to be called from url
* @param string pid
* @return boolean
*/
function book_management_wrapper($pid) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
return drupal_render(get_book_model_management_content($pid));
}
/**
* Supplies tab contents to callback
* @param string pid
* @return array
*/
function get_book_model_management_content($pid) {
if (!user_access('manage book object')) {
return;
}
module_load_include('inc', 'islandora_book', 'management/collection_membership');
module_load_include('inc', 'islandora_book', 'management/view_metadata');
module_load_include('inc', 'islandora_book', 'management/book_datastreams');
module_load_include('inc', 'islandora_book', 'management/book_delete');
module_load_include('inc', 'islandora_book', 'management/add_pages');
module_load_include('inc', 'islandora_book', 'management/reorder_pages');
module_load_include('inc', 'islandora_book', 'management/cm_association');
$content = drupal_get_form('book_add_pages', $pid);
$content .= drupal_get_form('book_collection_management', $pid);
$content .= drupal_get_form('book_content_model_association', $pid);
$content .= drupal_get_form('page_reorder', $pid);
$content .= drupal_get_form('view_metadata', $pid);
$content .= drupal_get_form('update_datastreams', $pid);
$content .= drupal_get_form('current_datastreams', $pid);
// $content .= drupal_get_form('page_delete', $pid);
$content .= drupal_get_form('book_delete', $pid);
$selected = FALSE;
if ($_SESSION['manage_chosen']) {
$selected = TRUE;
unset($_SESSION['manage_chosen']);
}
$form['manage_book_tab'] = array(
'#type' => 'tabpage',
'#title' => t('Manage'),
'#content' => $content,
'#selected' => $selected,
'#weight' => 100
);
$form['fedora_object_details'] = array(
'#type' => 'tabpage',
'#title' => t('Manage'),
'#content' => NULL,
);
return $form;
}