Permalink
Browse files

Merge pull request #141 from adam-vessey/6.x

6.x
  • Loading branch information...
2 parents 8bc54d1 + 1f30a3d commit c0c0701253cdf8f03a4e60efd1cd26bee7c38cde Jonathan Green committed Jun 26, 2012
Showing with 27 additions and 11 deletions.
  1. +27 −11 plugins/FedoraObjectDetailedContent.inc
@@ -55,31 +55,42 @@ class FedoraObjectDetailedContent {
if (!isset($profile)) {
// default behaviour
watchdog('fedora_repository', "Error while reading the default object details display profile: @e", array("@e" => $e->getMessage()), WATCHDOG_WARNING);
- $dc_html = $objectHelper->getFormattedDC($this->item);
+ $dc_returned = $objectHelper->getFormattedDC($this->item);
}
else {
// invoke the requested display profile
require_once(drupal_get_path('module', $profile['module']) ."/". $profile['file']);
$details_function = $profile['function'];
if (function_exists($details_function)) {
- $dc_html = $details_function($this->item);
+ $dc_returned = $details_function($this->item);
}
else {
// problem - display profile not found
watchdog('fedora_repository', "Error - could not find object details display function @function", array('@function' => $details_function), WATCHDOG_WARNING);
}
}
+ $dc_array = array();
$i = 0;
- if (fedora_repository_access(OBJECTHELPER :: $VIEW_DETAILED_CONTENT_LIST, $this->pid, $user)) {
- $tabset['fedora_object_details']['tabset']['view'] = array(
- '#type' => 'tabpage',
- '#title' => t('View'),
- 'dc' => array(
- '#type' => 'markup',
- '#value' => $dc_html, //XXX: This could easily be done in Drupal, instead of using an XSL
- '#weight' => $i++
- ),
+ if (is_array($dc_returned)) {
+ $dc_array = $dc_returned;
+ $dc_array['#weight'] = $i++;
+ }
+ else {
+ $dc_array = array(
+ '#type' => 'markup',
+ '#value' => $dc_returned, //XXX: This could easily be done in Drupal, instead of using an XSL
+ '#weight' => $i++
+ );
+ }
+
+ $tabset['fedora_object_details']['tabset']['view'] = array(
+ '#type' => 'tabpage',
+ '#title' => t('View'),
+ 'dc' => $dc_array,
+ );
+ if (fedora_repository_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST, $this->pid, $user)) {
+ $tabset['fedora_object_details']['tabset']['view'] += array(
'list' => array(
'#type' => 'fieldset',
'#title' => t('Detailed List of Content'),
@@ -100,6 +111,11 @@ class FedoraObjectDetailedContent {
'#weight' => $i++,
),
),
+ );
+ }
+
+ if (fedora_repository_access(ObjectHelper :: $PURGE_FEDORA_OBJECTSANDSTREAMS, $this->pid, $user)) {
+ $tabset['fedora_object_details']['tabset']['view'] += array(
'purge' => array(
'#type' => 'markup',
'#value' => $purge_form,

0 comments on commit c0c0701

Please sign in to comment.