forked from Islandora-Collaboration-Group/icg_csv_import
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathicg_csv_import.module
34 lines (30 loc) · 929 Bytes
/
icg_csv_import.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
<?php
function icg_csv_import_menu() {
$items = array();
$items['islandora/object/%islandora_object/manage/csv-import'] = array(
'title' => t('CSV Import'),
'page callback' => 'drupal_get_form',
'page arguments' => array('icg_csv_import_form', 2),
'access arguments' => array(2),
'access callback' => 'icg_csv_access_callback',
'file' => 'includes/map_ingest_form.inc',
'type' => MENU_LOCAL_TASK,
);
return $items;
}
/**
* ICG CSV Menu Item Access Callback
*/
function icg_csv_access_callback($object) {
if (user_access('ingest fedora objects')) {
$relation = '';
$collection_models = islandora_basic_collection_get_collection_content_models();
$collection_predicates = array(
'isMemberOfCollection',
'isMemberOf',
);
$is_a_collection = count(array_intersect($collection_models, $object->models)) > 0;
return $is_a_collection;
}
return FALSE;
}