Browse Source

Merge pull request #65 from ajstanley/6.x

6.x
pull/67/head
Ben Woodhead 13 years ago
parent
commit
8b8c6247d9
  1. 17
      fedora_repository.module
  2. 3
      plugins/FedoraObjectDetailedContent.inc
  3. 1
      xsl/sparql_to_html.xsl

17
fedora_repository.module

@ -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

3
plugins/FedoraObjectDetailedContent.inc

@ -1,7 +1,5 @@
<?php
/**
* @file
* FedoraObjectDetailedContent class
@ -34,6 +32,7 @@ class FedoraObjectDetailedContent {
*/
public function showFieldSets() {
global $user;
drupal_set_title($this->item->objectProfile->objLabel);
$objectHelper = new ObjectHelper();
$tabset = array();
$show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form');

1
xsl/sparql_to_html.xsl

@ -245,3 +245,4 @@
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

Loading…
Cancel
Save