|
|
|
@ -496,6 +496,23 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL)
|
|
|
|
|
return $output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function fedora_repository_purge_object_form_validate($form, &$form_state) { |
|
|
|
|
module_load_include('inc', 'fedora_repository', 'api/fedora_collection'); |
|
|
|
|
$pid = $form_state['values']['pid']; |
|
|
|
|
|
|
|
|
|
$objectHelper = new ObjectHelper(); |
|
|
|
|
$contentModels = $objectHelper->get_content_models_list($pid); |
|
|
|
|
foreach ($contentModels as $contentModel) { |
|
|
|
|
if ($contentModel->pid == 'islandora:collectionCModel') { |
|
|
|
|
$member_pids = get_related_items_as_array($pid, 'isMemberOfCollection'); |
|
|
|
|
if (is_array($member_pids)){ |
|
|
|
|
form_set_error('new_collection_pid', t("Please purge all members of this collection before deleting the collection itself.")); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* fedora repository purge object form submit |
|
|
|
|
* @param type $form |
|
|
|
|