|
|
@ -15,59 +15,71 @@ function islandora_preprocess_islandora_default_edit(array &$variables) { |
|
|
|
$variables['islandora_editmetadata_url'] = $base_url . '/islandora/edit_form/' . $islandora_object->id; |
|
|
|
$variables['islandora_editmetadata_url'] = $base_url . '/islandora/edit_form/' . $islandora_object->id; |
|
|
|
module_load_include('inc', 'islandora', 'includes/datastream'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/datastream'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
$header = array( |
|
|
|
$header = array(); |
|
|
|
array('data' => t('ID')), |
|
|
|
$header[] = array('data' => t('ID')); |
|
|
|
array('data' => t('Label')), |
|
|
|
$header[] = array('data' => t('Label')); |
|
|
|
array('data' => t('Type')), |
|
|
|
$header[] = array('data' => t('Type')); |
|
|
|
array('data' => t('Mime type')), |
|
|
|
$header[] = array('data' => t('Mime type')); |
|
|
|
array('data' => t('Size')), |
|
|
|
$header[] = array('data' => t('Size')); |
|
|
|
array('data' => t('Operations'), 'colspan' => '3'), |
|
|
|
if (user_access(ISLANDORA_VIEW_DATASTREAM_HISTORY)) { |
|
|
|
); |
|
|
|
$header[] = array('data' => t('Versions')); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$header[] = array('data' => t('Operations'), 'colspan' => '3'); |
|
|
|
|
|
|
|
|
|
|
|
$table_attributes = array('class' => array('manage-datastreams')); |
|
|
|
$table_attributes = array('class' => array('manage-datastreams')); |
|
|
|
$rows = array(); |
|
|
|
$rows = array(); |
|
|
|
foreach ($islandora_object as $ds) { |
|
|
|
foreach ($islandora_object as $ds) { |
|
|
|
$rows[] = array( |
|
|
|
$row = array(); |
|
|
|
array( |
|
|
|
$row[] = array( |
|
|
|
'class' => 'datastream-id', |
|
|
|
'class' => 'datastream-id', |
|
|
|
'data' => theme('islandora_datastream_view_link', array( |
|
|
|
'data' => theme('islandora_datastream_view_link', array( |
|
|
|
'datastream' => $ds, |
|
|
|
'datastream' => $ds, |
|
|
|
)), |
|
|
|
)), |
|
|
|
), |
|
|
|
); |
|
|
|
array( |
|
|
|
$row[] = array( |
|
|
|
'class' => 'datastream-label', |
|
|
|
'class' => 'datastream-label', |
|
|
|
'data' => $ds->label, |
|
|
|
'data' => $ds->label, |
|
|
|
), |
|
|
|
); |
|
|
|
array( |
|
|
|
$row[] = array( |
|
|
|
'class' => 'datastream-control', |
|
|
|
'class' => 'datastream-control', |
|
|
|
'data' => islandora_control_group_to_human_readable($ds->controlGroup), |
|
|
|
'data' => islandora_control_group_to_human_readable($ds->controlGroup), |
|
|
|
), |
|
|
|
); |
|
|
|
array( |
|
|
|
$row[] = array( |
|
|
|
'class' => 'datastream-mime', |
|
|
|
'class' => 'datastream-mime', |
|
|
|
'data' => $ds->mimeType, |
|
|
|
'data' => $ds->mimeType, |
|
|
|
), |
|
|
|
); |
|
|
|
array( |
|
|
|
$row[] = array( |
|
|
|
'class' => 'datastream-size', |
|
|
|
'class' => 'datastream-size', |
|
|
|
'data' => islandora_datastream_get_human_readable_size($ds), |
|
|
|
'data' => islandora_datastream_get_human_readable_size($ds), |
|
|
|
), |
|
|
|
); |
|
|
|
array( |
|
|
|
if (user_access(ISLANDORA_VIEW_DATASTREAM_HISTORY)) { |
|
|
|
'class' => 'datastream-download', |
|
|
|
$row[] = array( |
|
|
|
'data' => theme('islandora_datastream_download_link', array( |
|
|
|
'class' => 'datastream-versions', |
|
|
|
'datastream' => $ds, |
|
|
|
'data' => theme('islandora_datastream_version_link', array( |
|
|
|
)), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
array( |
|
|
|
|
|
|
|
'class' => 'datstream-edit', |
|
|
|
|
|
|
|
'data' => theme('islandora_datastream_edit_link', array( |
|
|
|
|
|
|
|
'datastream' => $ds, |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
array( |
|
|
|
|
|
|
|
'class' => 'datastream-delete', |
|
|
|
|
|
|
|
'data' => theme('islandora_datastream_delete_link', array( |
|
|
|
|
|
|
|
'datastream' => $ds, |
|
|
|
'datastream' => $ds, |
|
|
|
)), |
|
|
|
)), |
|
|
|
), |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$row[] = array( |
|
|
|
|
|
|
|
'class' => 'datastream-download', |
|
|
|
|
|
|
|
'data' => theme('islandora_datastream_download_link', array( |
|
|
|
|
|
|
|
'datastream' => $ds, |
|
|
|
|
|
|
|
)), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
$row[] = array( |
|
|
|
|
|
|
|
'class' => 'datstream-edit', |
|
|
|
|
|
|
|
'data' => theme('islandora_datastream_edit_link', array( |
|
|
|
|
|
|
|
'datastream' => $ds, |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$row[] = array( |
|
|
|
|
|
|
|
'class' => 'datastream-delete', |
|
|
|
|
|
|
|
'data' => theme('islandora_datastream_delete_link', array( |
|
|
|
|
|
|
|
'datastream' => $ds, |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
$rows[] = $row; |
|
|
|
} |
|
|
|
} |
|
|
|
$caption = $islandora_object->label . ' - ' . $islandora_object->id; |
|
|
|
$caption = $islandora_object->label . ' - ' . $islandora_object->id; |
|
|
|
$table = array( |
|
|
|
$table = array( |
|
|
@ -261,10 +273,28 @@ function theme_islandora_datastream_view_link(array $vars) { |
|
|
|
$datastream = $vars['datastream']; |
|
|
|
$datastream = $vars['datastream']; |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
|
|
|
|
|
|
|
|
$label = check_plain($datastream->id); |
|
|
|
if($vars['label'] === NULL) { |
|
|
|
return islandora_datastream_access(FEDORA_VIEW_OBJECTS, $datastream) ? |
|
|
|
$label = check_plain($datastream->id); |
|
|
|
l($label, islandora_datastream_get_url($datastream, 'view')) : |
|
|
|
} |
|
|
|
$label; |
|
|
|
else { |
|
|
|
|
|
|
|
$label = check_plain($vars['label']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($vars['version'] === NULL) { |
|
|
|
|
|
|
|
$perm = FEDORA_VIEW_OBJECTS; |
|
|
|
|
|
|
|
$query = array(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
$perm = ISLANDORA_VIEW_DATASTREAM_HISTORY; |
|
|
|
|
|
|
|
$query = array('version' => $vars['version']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (islandora_datastream_access($perm, $datastream)) { |
|
|
|
|
|
|
|
return l($label, islandora_datastream_get_url($datastream, 'view'), array('query' => $query)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
return $label; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -304,3 +334,17 @@ function theme_islandora_datastream_edit_link(array $vars) { |
|
|
|
l(t('edit'), "islandora/object/{$datastream->parent->id}/datastream/{$datastream->id}/edit") : |
|
|
|
l(t('edit'), "islandora/object/{$datastream->parent->id}/datastream/{$datastream->id}/edit") : |
|
|
|
''; |
|
|
|
''; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function theme_islandora_datastream_version_link(array $vars) { |
|
|
|
|
|
|
|
$datastream = $vars['datastream']; |
|
|
|
|
|
|
|
module_load_include('inc', 'islandora', 'includes/utilities'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$see_history = islandora_datastream_access(ISLANDORA_VIEW_DATASTREAM_HISTORY, $datastream); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($see_history) { |
|
|
|
|
|
|
|
return l(count($datastream), "islandora/object/{$datastream->parent->id}/datastream/{$datastream->id}/versions"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
return ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |