Browse Source

Merge pull request #464 from jordandukart/7.x-default-view

Change the default view to utilize the new metadata framework.
pull/465/head
Nigel Banks 11 years ago
parent
commit
e7f8b4ecc5
  1. 2
      includes/datastream.version.inc
  2. 8
      includes/manage_deleted_objects.inc
  3. 2
      theme/islandora-dublin-core-display.tpl.php
  4. 36
      theme/islandora-object.tpl.php
  5. 6
      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}";

2
theme/islandora-dublin-core-display.tpl.php

@ -17,7 +17,7 @@
<fieldset <?php $print ? print('class="islandora islandora-metadata"') : print('class="islandora islandora-metadata collapsible collapsed"');?>>
<legend><span class="fieldset-legend"><?php print t('Details'); ?></span></legend>
<div class="fieldset-wrapper">
<dl xmlns:dcterms="http://purl.org/dc/terms/" class="islandora-inline-metadata islandora-metadata-fields">
<dl xmlns:dcterms="http://purl.org/dc/terms/" class="islandora-inline-metadata islandora-metadata-fields islandora-object-fields">
<?php $row_field = 0; ?>
<?php foreach($dc_array as $key => $value): ?>
<dt property="<?php print $value['dcterms']; ?>" content="<?php print filter_xss($value['value']); ?>" class="<?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>">

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; ?>

6
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,13 @@ 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['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