|
|
@ -58,31 +58,6 @@ function islandora_menu() { |
|
|
|
'type' => MENU_NORMAL_ITEM, |
|
|
|
'type' => MENU_NORMAL_ITEM, |
|
|
|
'weight' => 0, |
|
|
|
'weight' => 0, |
|
|
|
); |
|
|
|
); |
|
|
|
/* may not need this |
|
|
|
|
|
|
|
$items['admin/islandora/solution_packs'] = array( |
|
|
|
|
|
|
|
'title' => 'Solution Packs', |
|
|
|
|
|
|
|
'description' => 'Install content models and collections required by installed solution packs.', |
|
|
|
|
|
|
|
'page callback' => 'islandora_solution_packs_page', |
|
|
|
|
|
|
|
'access arguments' => array(FEDORA_ADD_DS), |
|
|
|
|
|
|
|
'file' => 'admin/islandora.solutionpacks.inc', |
|
|
|
|
|
|
|
'type' => MENU_NORMAL_ITEM, |
|
|
|
|
|
|
|
); */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$items['islandoracm.xsd'] = array( |
|
|
|
|
|
|
|
'title' => 'Islandora Content Model XML Schema Definition', |
|
|
|
|
|
|
|
'page callback' => 'islandora_display_schema', |
|
|
|
|
|
|
|
'page arguments' => array('islandoracm.xsd'), |
|
|
|
|
|
|
|
'type' => MENU_CALLBACK, |
|
|
|
|
|
|
|
'access arguments' => array(FEDORA_VIEW), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$items['collection_policy.xsd'] = array( |
|
|
|
|
|
|
|
'title' => 'Islandora Content Model XML Schema Definition', |
|
|
|
|
|
|
|
'page callback' => 'islandora_display_schema', |
|
|
|
|
|
|
|
'page arguments' => array('collection_policy.xsd'), |
|
|
|
|
|
|
|
'type' => MENU_CALLBACK, |
|
|
|
|
|
|
|
'access arguments' => array(FEDORA_VIEW), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$items['islandora/ingest/%'] = array( |
|
|
|
$items['islandora/ingest/%'] = array( |
|
|
|
'title' => 'Ingest object', |
|
|
|
'title' => 'Ingest object', |
|
|
@ -154,9 +129,9 @@ function islandora_menu() { |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$items['islandora/object/%/delete'] = array( |
|
|
|
$items['islandora/object/%/delete'] = array( |
|
|
|
'title' => 'Purge object', |
|
|
|
'title' => 'Delete object', |
|
|
|
'page callback' => 'islandora_purge_object', |
|
|
|
'page callback' => 'drupal_get_form', |
|
|
|
'page arguments' => array(2), |
|
|
|
'page arguments' => array('islandora_purge_object', 2), |
|
|
|
'type' => MENU_CALLBACK, |
|
|
|
'type' => MENU_CALLBACK, |
|
|
|
'access arguments' => array(FEDORA_PURGE), |
|
|
|
'access arguments' => array(FEDORA_PURGE), |
|
|
|
); |
|
|
|
); |
|
|
@ -294,7 +269,10 @@ function islandora_node_access($op, $pid = NULL, $as_user = NULL) { |
|
|
|
* ID of the object |
|
|
|
* ID of the object |
|
|
|
* @return type |
|
|
|
* @return type |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_purge_object($object_id) { |
|
|
|
function islandora_purge_object_submit($form, &$form_state) { |
|
|
|
|
|
|
|
$object_id = $form_state['values']['pid']; |
|
|
|
|
|
|
|
$collection = $form_state['values']['col']; |
|
|
|
|
|
|
|
|
|
|
|
module_load_include('inc', 'islandora', 'RestConnection'); |
|
|
|
module_load_include('inc', 'islandora', 'RestConnection'); |
|
|
|
global $user; |
|
|
|
global $user; |
|
|
|
if (!isset($object_id)) { |
|
|
|
if (!isset($object_id)) { |
|
|
@ -331,7 +309,38 @@ function islandora_purge_object($object_id) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
module_invoke_all('islandora_post_purge_object', $object_id, $content_models); //notify modules post deletion |
|
|
|
module_invoke_all('islandora_post_purge_object', $object_id, $content_models); //notify modules post deletion |
|
|
|
drupal_goto('islandora'); |
|
|
|
drupal_goto($collection); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function islandora_purge_object($form, &$form_state, $pid) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module_load_include('inc', 'islandora', 'RestConnection'); |
|
|
|
|
|
|
|
module_load_include('inc', 'islandora', 'includes/datastream'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$connection = new RestConnection(); |
|
|
|
|
|
|
|
$object = $connection->repository->getObject($pid); |
|
|
|
|
|
|
|
$parent = islandora_datastream_get_parents($object); |
|
|
|
|
|
|
|
$key = array_keys($parent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(count($key) > 0) { |
|
|
|
|
|
|
|
$redirect = "islandora/object/$key[0]"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
$redirect = "islandora"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Always provide entity id in the same form key as in the entity edit form. |
|
|
|
|
|
|
|
$form['pid'] = array('#type' => 'value', '#value' => $pid); |
|
|
|
|
|
|
|
$form['col'] = array('#type' => 'value', '#value' => $redirect); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return confirm_form($form, |
|
|
|
|
|
|
|
t('Are you sure you want to delete %title?', array('%title' => $object->label)), |
|
|
|
|
|
|
|
"islandora/object/$pid", |
|
|
|
|
|
|
|
t('This action cannot be undone.'), |
|
|
|
|
|
|
|
t('Delete'), |
|
|
|
|
|
|
|
t('Cancel') |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -600,7 +609,7 @@ function islandora_preprocess_islandora_default(&$variables) { |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/datastream'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/datastream'); |
|
|
|
|
|
|
|
|
|
|
|
$variables['parent_collections'] = islandora_get_datastream_parents($islandora_object); |
|
|
|
$variables['parent_collections'] = islandora_datastream_get_parents($islandora_object); |
|
|
|
|
|
|
|
|
|
|
|
$datastreams = array(); |
|
|
|
$datastreams = array(); |
|
|
|
foreach ($islandora_object as $ds) { |
|
|
|
foreach ($islandora_object as $ds) { |
|
|
|