Browse Source

Make our datastream_access call work and revert change to themeing of version links.

pull/443/head
Jordan Dukart 11 years ago
parent
commit
12620a4bf6
  1. 2
      islandora.module
  2. 14
      theme/theme.inc

2
islandora.module

@ -1839,7 +1839,7 @@ function islandora_islandora_datastream_access($op, AbstractDatastream $datastre
$hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object)); $hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object));
foreach ($hooks as $hook) { foreach ($hooks as $hook) {
if ($hook['destination_dsid'] == $datastream->id && ((isset($hook['source_dsid']) && isset($object[$hook['source_dsid']]) && islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $object[$hook['source_dsid']], $user)) || (array_key_exists('source_dsid', $hook) && $hook['source_dsid'] == NULL))) { if ($hook['destination_dsid'] == $datastream->id && ((isset($hook['source_dsid']) && isset($object[$hook['source_dsid']]) && islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $object[$hook['source_dsid']], $user)) || (array_key_exists('source_dsid', $hook) && $hook['source_dsid'] == NULL))) {
return TRUE; return user_access(ISLANDORA_REGENERATE_DERIVATIVES);
} }
} }
return FALSE; return FALSE;

14
theme/theme.inc

@ -53,12 +53,14 @@ function islandora_preprocess_islandora_default_edit(array &$variables) {
'class' => 'datastream-size', 'class' => 'datastream-size',
'data' => islandora_datastream_get_human_readable_size($ds), 'data' => islandora_datastream_get_human_readable_size($ds),
); );
$row[] = array( if (islandora_datastream_access(ISLANDORA_VIEW_DATASTREAM_HISTORY, $ds)) {
'class' => 'datastream-versions', $row[] = array(
'data' => theme('islandora_datastream_version_link', array( 'class' => 'datastream-versions',
'datastream' => $ds, 'data' => theme('islandora_datastream_version_link', array(
)), 'datastream' => $ds,
); )),
);
}
$row[] = array( $row[] = array(
'class' => 'datastream-download', 'class' => 'datastream-download',
'data' => theme('islandora_datastream_download_link', array( 'data' => theme('islandora_datastream_download_link', array(

Loading…
Cancel
Save