Browse Source

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

Little more checking if there is any tab content...
pull/144/head
Jonathan Green 13 years ago
parent
commit
7c018f3ab6
  1. 3
      ObjectHelper.inc
  2. 11
      plugins/FedoraObjectDetailedContent.inc

3
ObjectHelper.inc

@ -137,9 +137,6 @@ class ObjectHelper {
$fedoraPass = $user->pass; $fedoraPass = $user->pass;
} }
$dataStreamInfo = $item->get_datastream_info($dsID);
$contentSize = $dataStreamInfo->datastream->size;
if (function_exists("curl_init")) { if (function_exists("curl_init")) {
$url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/objects/' . $pid . '/datastreams/' . $dsID . '/content'; $url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/objects/' . $pid . '/datastreams/' . $dsID . '/content';
$query_options = array(); $query_options = array();

11
plugins/FedoraObjectDetailedContent.inc

@ -76,7 +76,7 @@ class FedoraObjectDetailedContent {
$dc_array = $dc_returned; $dc_array = $dc_returned;
$dc_array['#weight'] = $i++; $dc_array['#weight'] = $i++;
} }
else { elseif (!empty($dc_returned)) {
$dc_array = array( $dc_array = array(
'#type' => 'markup', '#type' => 'markup',
'#value' => $dc_returned, //XXX: This could easily be done in Drupal, instead of using an XSL '#value' => $dc_returned, //XXX: This could easily be done in Drupal, instead of using an XSL
@ -87,8 +87,12 @@ class FedoraObjectDetailedContent {
$tabset['fedora_object_details']['tabset']['view'] = array( $tabset['fedora_object_details']['tabset']['view'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',
'#title' => t('View'), '#title' => t('View'),
'dc' => $dc_array,
); );
if (!empty($dc_array)) {
$tabset['fedora_object_details']['tabset']['view']['dc'] = $dc_array;
}
if (fedora_repository_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST, $this->pid, $user)) { if (fedora_repository_access(ObjectHelper :: $VIEW_DETAILED_CONTENT_LIST, $this->pid, $user)) {
$tabset['fedora_object_details']['tabset']['view'] += array( $tabset['fedora_object_details']['tabset']['view'] += array(
'list' => array( 'list' => array(
@ -135,7 +139,8 @@ class FedoraObjectDetailedContent {
} }
$ts = $tabset['fedora_object_details']['tabset']; $ts = $tabset['fedora_object_details']['tabset'];
if (array_key_exists('view', $ts) || array_key_exists('edit', $ts)) { if ((array_key_exists('view', $ts) && (count(element_children($ts['view'])) > 0)) ||
(array_key_exists('edit', $ts) && (count(element_children($ts['edit'])) > 0 || array_key_exists('#content', $ts['edit'])))) {
return $tabset; return $tabset;
} }
else { else {

Loading…
Cancel
Save