From b42d9c5920e3cea7ed315b1e1a3be67ea06b3a7d Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 25 Feb 2014 18:14:01 +0000 Subject: [PATCH] Change the default view to utilize the new metadata framework. --- includes/datastream.version.inc | 2 +- includes/manage_deleted_objects.inc | 8 +++---- theme/islandora-object.tpl.php | 36 ++++++++++++----------------- theme/theme.inc | 7 ++++++ 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/includes/datastream.version.inc b/includes/datastream.version.inc index 8c02aaad..ecef019d 100644 --- a/includes/datastream.version.inc +++ b/includes/datastream.version.inc @@ -234,7 +234,7 @@ function islandora_revert_datastream_version_form_submit(array $form, array &$fo /** * Gets Audit datastream values from foxml. * - * @param String $pid + * @param string $pid * PID of parent object * * @return array diff --git a/includes/manage_deleted_objects.inc b/includes/manage_deleted_objects.inc index 2708efe3..a6b5e96e 100644 --- a/includes/manage_deleted_objects.inc +++ b/includes/manage_deleted_objects.inc @@ -287,7 +287,7 @@ function islandora_get_contentmodels_with_deleted_members() { /** * Restores deleted object. * - * @param String $pid + * @param string $pid * PID of object to be restored */ function islandora_restore_object_by_pid($pid) { @@ -298,7 +298,7 @@ function islandora_restore_object_by_pid($pid) { /** * Purges deleted object. * - * @param String $pid + * @param string $pid * PID of object to be restored */ function islandora_purge_object_by_pid($pid) { @@ -314,7 +314,7 @@ function islandora_purge_object_by_pid($pid) { * @param int $offset * offset to be added to search * - * @return String + * @return string * Sparql query */ function islandora_get_deleted_query($content_models, $offset = 0) { @@ -332,7 +332,7 @@ function islandora_get_deleted_query($content_models, $offset = 0) { $unions .= "UNION {?subject fm:hasModel ; fm:state fm:Deleted; fm:hasModel ?object; - } + } "; } $optional = "OPTIONAL{?subject fm:label ?label}"; diff --git a/theme/islandora-object.tpl.php b/theme/islandora-object.tpl.php index 6fa306c3..fdd09607 100644 --- a/theme/islandora-object.tpl.php +++ b/theme/islandora-object.tpl.php @@ -60,7 +60,7 @@ ?>

- +
@@ -68,26 +68,10 @@
- +
+ +
+

+
    + +
  • label, "islandora/object/{$collection->id}"); ?>
  • + +
+
+ diff --git a/theme/theme.inc b/theme/theme.inc index b783cfa8..7e54fefd 100644 --- a/theme/theme.inc +++ b/theme/theme.inc @@ -109,6 +109,7 @@ function islandora_preprocess_islandora_default(&$variables) { $islandora_object = $variables['islandora_object']; module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/datastream'); + module_load_include('inc', 'islandora', 'includes/metadata'); $variables['parent_collections'] = islandora_get_parents_from_rels_ext($islandora_object); @@ -140,8 +141,14 @@ function islandora_preprocess_islandora_default(&$variables) { $dc_object = DublinCore::importFromXMLString($islandora_object['DC']->content); $dc_array = $dc_object->asArray(); } + // We should eventually remove the DC object and dc_array code as it only + // exists to not break legacy implementations. $variables['dc_array'] = isset($dc_array) ? $dc_array : array(); $variables['islandora_dublin_core'] = isset($dc_object) ? $dc_object : NULL; + + $variables['parent_collections'] = islandora_get_parents_from_rels_ext($islandora_object); + $variables['metadata'] = islandora_retrieve_metadata_markup($islandora_object, TRUE); + $variables['description'] = islandora_retrieve_description_markup($islandora_object); $variables['islandora_object_label'] = $islandora_object->label; if (isset($islandora_object['TN']) && islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $islandora_object['TN'])) { $variables['islandora_thumbnail_url'] = url("islandora/object/{$islandora_object->id}/datastream/TN/view");