From fb81d1527e639c357ac5d1e7a2ea5f2723595869 Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Wed, 23 May 2012 16:02:09 -0300 Subject: [PATCH] updated edit preprocess function and template --- islandora-object-edit.tpl.php | 10 ++++++---- islandora.module | 13 +++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/islandora-object-edit.tpl.php b/islandora-object-edit.tpl.php index e760a429..180dc6d7 100644 --- a/islandora-object-edit.tpl.php +++ b/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 ('

datastreams

'); -foreach ($islandora_datastreams as $key => $ds) { - print $key. '
'; - //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 ('
'); } +print (l(t('Edit Metadata'),$variables['islandora_editmetadata_url'])); ?> diff --git a/islandora.module b/islandora.module index 3dad0009..bc06849b 100644 --- a/islandora.module +++ b/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'; - $variables['islandora_datastreams'][$ds->id] = $datastreams; - + $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; } } \ No newline at end of file