Browse Source

Change the default view to utilize the new metadata framework.

pull/464/head
Jordan Dukart 11 years ago
parent
commit
b42d9c5920
  1. 2
      includes/datastream.version.inc
  2. 8
      includes/manage_deleted_objects.inc
  3. 36
      theme/islandora-object.tpl.php
  4. 7
      theme/theme.inc

2
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

8
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 <info:fedora/$contentmodel>;
fm:state fm:Deleted;
fm:hasModel ?object;
}
}
";
}
$optional = "OPTIONAL{?subject fm:label ?label}";

36
theme/islandora-object.tpl.php

@ -60,7 +60,7 @@
?>
<div class="islandora-object islandora">
<h2><?php print t('Details'); ?></h2>
<dl class="islandora-object-tn">
<dt>
<?php if (isset($variables['islandora_thumbnail_url'])): ?>
@ -68,26 +68,10 @@
<?php endif; ?>
<dd></dd>
</dl>
<dl class="islandora-inline-metadata islandora-object-fields">
<?php $row_field = 0; ?>
<?php foreach ($dc_array as $key => $value): ?>
<dt class="<?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>">
<?php print $value['label']; ?>
</dt>
<dd class="<?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>">
<?php print $value['value']; ?>
</dd>
<?php $row_field++; ?>
<?php endforeach; ?>
<?php if ($parent_collections): ?>
<dt>Collections</dt>
<dd>
<?php foreach ($parent_collections as $collection): ?>
<div><?php print l($collection->label, "islandora/object/{$collection->id}"); ?></div>
<?php endforeach; ?>
</dd>
<?php endif; ?>
</dl>
<div class="islandora-default-metadata">
<?php print $description; ?>
<?php print $metadata; ?>
</div>
</div>
<fieldset class="collapsible collapsed" style="display: block; clear:both">
<legend><span class="fieldset-legend"><?php print t('File details'); ?></span></legend>
@ -112,3 +96,13 @@
</table>
</div>
</fieldset>
<?php if ($parent_collections): ?>
<div>
<h2><?php print t('In collections'); ?></h2>
<ul>
<?php foreach ($parent_collections as $collection): ?>
<li><?php print l($collection->label, "islandora/object/{$collection->id}"); ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

7
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");

Loading…
Cancel
Save