forked from Islandora/islandora_solution_pack_pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
islandora_pdf_sp.install
29 lines (25 loc) · 1.01 KB
/
islandora_pdf_sp.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
25
26
27
28
29
<?php
function islandora_pdf_sp_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 {
$solution_pack_info = islandora_pdf_sp_required_fedora_objects();
$batch = array(
'title' => t('Installing PDF Solutionpack objects'),
'file' => drupal_get_path('module', 'fedora_repository') . '/fedora_repository.module',
'operations' => array(),
);
foreach ($solution_pack_info['islandora_pdf_sp']['objects'] as $object) {
// Add this object to the batch job queue.
$item = new Fedora_Item($object['pid']);
if (!$item->exists()) {
$batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object));
}
}
batch_set($batch);
batch_process();
}
}