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. 6
      includes/manage_deleted_objects.inc
  3. 34
      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. * Gets Audit datastream values from foxml.
* *
* @param String $pid * @param string $pid
* PID of parent object * PID of parent object
* *
* @return array * @return array

6
includes/manage_deleted_objects.inc

@ -287,7 +287,7 @@ function islandora_get_contentmodels_with_deleted_members() {
/** /**
* Restores deleted object. * Restores deleted object.
* *
* @param String $pid * @param string $pid
* PID of object to be restored * PID of object to be restored
*/ */
function islandora_restore_object_by_pid($pid) { function islandora_restore_object_by_pid($pid) {
@ -298,7 +298,7 @@ function islandora_restore_object_by_pid($pid) {
/** /**
* Purges deleted object. * Purges deleted object.
* *
* @param String $pid * @param string $pid
* PID of object to be restored * PID of object to be restored
*/ */
function islandora_purge_object_by_pid($pid) { function islandora_purge_object_by_pid($pid) {
@ -314,7 +314,7 @@ function islandora_purge_object_by_pid($pid) {
* @param int $offset * @param int $offset
* offset to be added to search * offset to be added to search
* *
* @return String * @return string
* Sparql query * Sparql query
*/ */
function islandora_get_deleted_query($content_models, $offset = 0) { function islandora_get_deleted_query($content_models, $offset = 0) {

34
theme/islandora-object.tpl.php

@ -68,26 +68,10 @@
<?php endif; ?> <?php endif; ?>
<dd></dd> <dd></dd>
</dl> </dl>
<dl class="islandora-inline-metadata islandora-object-fields"> <div class="islandora-default-metadata">
<?php $row_field = 0; ?> <?php print $description; ?>
<?php foreach ($dc_array as $key => $value): ?> <?php print $metadata; ?>
<dt class="<?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>"> </div>
<?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> </div>
<fieldset class="collapsible collapsed" style="display: block; clear:both"> <fieldset class="collapsible collapsed" style="display: block; clear:both">
<legend><span class="fieldset-legend"><?php print t('File details'); ?></span></legend> <legend><span class="fieldset-legend"><?php print t('File details'); ?></span></legend>
@ -112,3 +96,13 @@
</table> </table>
</div> </div>
</fieldset> </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']; $islandora_object = $variables['islandora_object'];
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
module_load_include('inc', 'islandora', 'includes/datastream'); 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); $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_object = DublinCore::importFromXMLString($islandora_object['DC']->content);
$dc_array = $dc_object->asArray(); $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['dc_array'] = isset($dc_array) ? $dc_array : array();
$variables['islandora_dublin_core'] = isset($dc_object) ? $dc_object : NULL; $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; $variables['islandora_object_label'] = $islandora_object->label;
if (isset($islandora_object['TN']) && islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $islandora_object['TN'])) { 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"); $variables['islandora_thumbnail_url'] = url("islandora/object/{$islandora_object->id}/datastream/TN/view");

Loading…
Cancel
Save