forked from Islandora/islandora_solution_pack_book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
islandora_book.install
25 lines (22 loc) · 894 Bytes
/
islandora_book.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/**
* Implementation of hook_enable()
* Installs all the requirements for this solution pack in local fedora instance
*/
function islandora_book_enable() {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
if (!fedora_available()) {
drupal_set_message(t('Fedora instance is not currently available. Installation must be verified and completed on the Islandora Configuration page.'));
}
else {
// Get info on the required fedora objects for this solution pack
$solution_pack_info = islandora_book_fedora_repository_required_fedora_objects();
foreach ($solution_pack_info['islandora_book']['objects'] as $object) {
$item = new Fedora_Item($object['pid']);
if (!$item->exists()) {
fedora_repository_batch_reingest_object($object);
}
}
}
}