Browse Source

updated edit preprocess function and template

pull/109/merge
Paul Pound 13 years ago
parent
commit
fb81d1527e
  1. 10
      islandora-object-edit.tpl.php
  2. 11
      islandora.module

10
islandora-object-edit.tpl.php

@ -49,11 +49,13 @@
drupal_set_title($islandora_object->label);
$islandora_datastreams = $variables['islandora_datastreams'];
print($islandora_object->label . ' ' . $islandora_object->id);
print('this is the edit template');
print ('<h3>datastreams</h3>');
foreach ($islandora_datastreams as $key => $ds) {
print $key. '<br />';
//do something
foreach ($islandora_datastreams as $dsid => $ds) {
print (l($ds['label'],$ds['view_url']));
print (' ' . l('download', $ds['download_url']));
print (' ' . l('delete', $ds['delete_url']));
print ('<br />');
}
print (l(t('Edit Metadata'),$variables['islandora_editmetadata_url']));
?>

11
islandora.module

@ -337,7 +337,7 @@ function islandora_purge_datastream($object_id, $datastream_id) {
/**
* The view entry point. modules should implement hook_islandora_view_object for the Fedora Content models that
* there modules want to provide a view for.
* their modules want to provide a view for.
* @global object $user
* @param string $object_id
*
@ -487,11 +487,12 @@ function islandora_preprocess_islandora_default_edit(&$variables) {
$islandora_object = $variables['islandora_object'];
global $base_url;
$datastreams = array();
$variables['islandora_editmetadata_url'] = $base_url . '/islandora/edit_form/' . $islandora_object->id;
foreach ($islandora_object as $ds) {
$datastreams['download_url'] = $base_url . '/islandora/object/' . $islandora_object->id . 'datastream/' . $ds->id .'/download';
$datastreams['view_url'] = $base_url . '/islandora/object/' . $islandora_object->id . 'datastream/' . $ds->id .'/view';
$datastreams['delete_url'] = $base_url . '/islandora/object/' . $islandora_object->id . 'datastream/' . $ds->id .'/delete';
$datastreams['download_url'] = $base_url . '/islandora/object/' . $islandora_object->id . '/datastream/' . $ds->id .'/download';
$datastreams['view_url'] = $base_url . '/islandora/object/' . $islandora_object->id . '/datastream/' . $ds->id .'/view';
$datastreams['delete_url'] = $base_url . '/islandora/object/' . $islandora_object->id . '/datastream/' . $ds->id .'/delete';
$datastreams['label'] = $ds->label;
$variables['islandora_datastreams'][$ds->id] = $datastreams;
}
}
Loading…
Cancel
Save