-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathislandora_harvester.module
65 lines (57 loc) · 1.88 KB
/
islandora_harvester.module
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
58
59
60
61
62
63
64
65
<?php
function islandora_harvester_menu() {
$path = drupal_get_path('module', 'islandora_harvester');
$items['islandora/harvest'] = array(
'title' => 'Harvest Items for Repository',
'description' => 'Retrieve items from OAI or CSV for ingestion',
'page callback' => 'ingest_page',
'access arguments' => array('harvest OAI'),
'type' => MENU_NORMAL_ITEM,
);
$items['oai/ahah'] = array(
'page callback' => 'update_oai_div',
'access arguments' => array('view fedora collection'),
'type' => MENU_CALLBACK,
);
$items['oai/source/update'] = array(
'file' => "/harvest_form.inc",
'page callback' => 'update_source_div',
'access arguments' => array('view fedora collection'),
'type' => MENU_CALLBACK,
);
$items['oai/destination/update'] = array(
'file' => "/harvest_form.inc",
'page callback' => 'update_destination_div',
'access arguments' => array('view fedora collection'),
'type' => MENU_CALLBACK,
);
$items['islandora/collection/harvest'] = array(
'title' => t('Harvest into Collection'),
'page callback' => 'get_collection_harvest_form',
'type' => MENU_CALLBACK,
'access arguments' => array('harvest into collection'),
);
return $items;
}
function islandora_harvester_perm() {
return array(
'harvest OAI',
'harvest into collection'
);
}
function ingest_page() {
module_load_include('inc', 'islandora_harvester', "harvest_form");
$output = t('Ingest Metadata');
$output .= drupal_get_form('oai_ingest_form');
return $output;
}
function islandora_harvester_islandora_collection_mangement($pid) {
global $user;
if (user_access('harvest OAI')) {
return l('Harvest Items for repository', "islandora/collection/harvest/$pid");
}
}
function get_collection_harvest_form($pid) {
module_load_include('inc', 'islandora_harvester', "harvest_form");
return drupal_get_form('oai_ingest_form', $pid);
}