|
|
@ -29,9 +29,7 @@ function islandora_preprocess_islandora_default_edit(array &$variables) { |
|
|
|
$rows[] = array( |
|
|
|
$rows[] = array( |
|
|
|
array( |
|
|
|
array( |
|
|
|
'class' => 'datastream-id', |
|
|
|
'class' => 'datastream-id', |
|
|
|
'data' => (islandora_datastream_access(FEDORA_VIEW_OBJECTS, $ds) ? |
|
|
|
'data' => islandora_datastream_get_view_link($ds), |
|
|
|
l($ds->id, islandora_datastream_get_url($ds, 'view')) : |
|
|
|
|
|
|
|
''), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
array( |
|
|
|
array( |
|
|
|
'class' => 'datastream-label', |
|
|
|
'class' => 'datastream-label', |
|
|
@ -51,9 +49,7 @@ function islandora_preprocess_islandora_default_edit(array &$variables) { |
|
|
|
), |
|
|
|
), |
|
|
|
array( |
|
|
|
array( |
|
|
|
'class' => 'datastream-download', |
|
|
|
'class' => 'datastream-download', |
|
|
|
'data' => (islandora_datastream_access(FEDORA_VIEW_OBJECTS, $ds) ? |
|
|
|
'data' => islandora_datastream_get_download_link($ds), |
|
|
|
l(t('download'), islandora_datastream_get_url($ds, 'download')) : |
|
|
|
|
|
|
|
''), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
array( |
|
|
|
array( |
|
|
|
'class' => 'datstream-edit', |
|
|
|
'class' => 'datstream-edit', |
|
|
@ -99,7 +95,9 @@ function islandora_preprocess_islandora_default(&$variables) { |
|
|
|
$download_path = islandora_datastream_get_url($ds, 'download'); |
|
|
|
$download_path = islandora_datastream_get_url($ds, 'download'); |
|
|
|
$datastreams[$id]['id'] = $id; |
|
|
|
$datastreams[$id]['id'] = $id; |
|
|
|
$datastreams[$id]['label'] = $label; |
|
|
|
$datastreams[$id]['label'] = $label; |
|
|
|
$datastreams[$id]['label_link'] = l($label, $download_path); |
|
|
|
$datastreams[$id]['label_link'] = islandora_datastream_access(FEDORA_VIEW_OBJECTS, $ds) ? |
|
|
|
|
|
|
|
l($label, $download_path) : |
|
|
|
|
|
|
|
$label; |
|
|
|
$datastreams[$id]['download_url'] = $download_path; |
|
|
|
$datastreams[$id]['download_url'] = $download_path; |
|
|
|
$datastreams[$id]['mimetype'] = $ds->mimetype; |
|
|
|
$datastreams[$id]['mimetype'] = $ds->mimetype; |
|
|
|
$datastreams[$id]['size'] = islandora_datastream_get_human_readable_size($ds); |
|
|
|
$datastreams[$id]['size'] = islandora_datastream_get_human_readable_size($ds); |
|
|
@ -112,14 +110,14 @@ function islandora_preprocess_islandora_default(&$variables) { |
|
|
|
} |
|
|
|
} |
|
|
|
$variables['datastreams'] = $datastreams; |
|
|
|
$variables['datastreams'] = $datastreams; |
|
|
|
// Objects in fcrepo4 don't always contain a DC datastream. |
|
|
|
// Objects in fcrepo4 don't always contain a DC datastream. |
|
|
|
if (isset($islandora_object['DC'])) { |
|
|
|
if (isset($islandora_object['DC']) && islandora_datastream_access(FEDORA_VIEW_OBJECTS, $islandora_object['DC'])) { |
|
|
|
$dc_object = DublinCore::importFromXMLString($islandora_object['DC']->content); |
|
|
|
$dc_object = DublinCore::importFromXMLString($islandora_object['DC']->content); |
|
|
|
$dc_array = $dc_object->asArray(); |
|
|
|
$dc_array = $dc_object->asArray(); |
|
|
|
} |
|
|
|
} |
|
|
|
$variables['dc_array'] = isset($dc_array) ? $dc_array : array(); |
|
|
|
$variables['dc_array'] = isset($dc_array) ? $dc_array : array(); |
|
|
|
$variables['islandora_dublin_core'] = isset($dc_object) ? $dc_object : NULL; |
|
|
|
$variables['islandora_dublin_core'] = isset($dc_object) ? $dc_object : NULL; |
|
|
|
$variables['islandora_object_label'] = $islandora_object->label; |
|
|
|
$variables['islandora_object_label'] = $islandora_object->label; |
|
|
|
if (isset($islandora_object['TN'])) { |
|
|
|
if (isset($islandora_object['TN']) && islandora_datastream_access(FEDORA_VIEW_OBJECTS, $islandora_object['TN'])) { |
|
|
|
$variables['islandora_thumbnail_url'] = url("islandora/object/{$islandora_object->id}/datastream/TN/view"); |
|
|
|
$variables['islandora_thumbnail_url'] = url("islandora/object/{$islandora_object->id}/datastream/TN/view"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -201,12 +199,16 @@ function islandora_preprocess_islandora_objects(array &$variables) { |
|
|
|
$o = islandora_object_load($o); |
|
|
|
$o = islandora_object_load($o); |
|
|
|
$url = "islandora/object/{$o->id}"; |
|
|
|
$url = "islandora/object/{$o->id}"; |
|
|
|
$link_options = array('html' => TRUE, 'attributes' => array('title' => $o->label)); |
|
|
|
$link_options = array('html' => TRUE, 'attributes' => array('title' => $o->label)); |
|
|
|
$img = theme_image(array('path' => url("$url/datastream/TN/view"), 'attributes' => array())); |
|
|
|
$img = islandora_datastream_access(FEDORA_VIEW_OBJECTS, $o['TN']) ? |
|
|
|
|
|
|
|
theme('image', array('path' => url("$url/datastream/TN/view"), 'attributes' => array())) : |
|
|
|
|
|
|
|
''; |
|
|
|
$description = NULL; |
|
|
|
$description = NULL; |
|
|
|
$dc = DublinCore::importFromXMLString($o['DC']->content); |
|
|
|
if (islandora_datastream_access($o['DC'])) { |
|
|
|
if ($dc) { |
|
|
|
$dc = DublinCore::importFromXMLString($o['DC']->content); |
|
|
|
$dc = $dc->asArray(); |
|
|
|
if ($dc) { |
|
|
|
$description = $dc['dc:description']['value']; |
|
|
|
$dc = $dc->asArray(); |
|
|
|
|
|
|
|
$description = $dc['dc:description']['value']; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return array( |
|
|
|
return array( |
|
|
|
'label' => $o->label, |
|
|
|
'label' => $o->label, |
|
|
|