Browse Source

deleted unneeded template, added dc_array to islandora module, cleaned up default collection display

pull/111/head
krisbulman 13 years ago
parent
commit
f418c49b80
  1. 75
      css/islandora.theme.css
  2. 67
      islandora-object.tpl.php
  3. 1
      islandora.module
  4. 52
      islandora_basic_image/islandora-basic-image--islandora-27.tpl.php
  5. 2
      islandora_basic_image/islandora_basic_image.module

75
css/islandora.theme.css

@ -5,4 +5,79 @@
Purpose of the stylesheet follows. Purpose of the stylesheet follows.
*/ */
/*
* Thumbnails float optionally to the left or right of descriptive lists.
*/
.islandora-object-thumb img {
max-width: 100%;
*width: 100%;
border: 1px solid #ccc;
}
dl.islandora-object-thumb {
float: left;
width: 15%;
margin: 0.75em auto;
}
.islandora-object-thumb dt,
.islandora-object-thumb dd {
margin: 0;
}
/*
* These rules will display DTs/DDs as columns.
* Constructs must follow a key/value pair pattern.
* The three last declarations are meant to kill white space between DTs/DDs
* (result of inline-block styling)
*/
dl.islandora-object-fields {
float: right;
width:83%;
margin: 0.75em auto;
letter-spacing:-0.34em;
*letter-spacing:normal;
word-spacing:-0.44em;
border-top:3px solid #ddd;
}
/*
* The width + left/right padding of DTs/DDs equals 88% when compensating for an image
*/
.islandora-object-fields dt {
margin-right:-1px;
width:22.5%;
font-weight: bold;
}
.islandora-object-fields dd {
width:67%;
}
/*
* In this rule, we reset the white-space (see hack above)
*/
.islandora-object-fields dt,
.islandora-object-fields dd {
display:inline-block;
*display:inline;
zoom:1;
letter-spacing:normal;
word-spacing:normal;
vertical-align:top;
padding:6px 2% 4px;
margin:0;
border-top:1px solid #ddd;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word; /* webkit */
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
.islandora-object-fields dt.first,
.islandora-object-fields dd.first {
border-top: 0;
}

67
islandora-object.tpl.php

@ -46,29 +46,48 @@
//dsm($object); //dsm($object);
drupal_set_title($islandora_object->label); drupal_set_title($islandora_object->label);
$dublin_core = $variables['islandora_dublin_core']; // $dublin_core = $variables['islandora_dublin_core'];
print($islandora_object->label . ' ' . $islandora_object->id); // print($islandora_object->label . ' ' . $islandora_object->id);
print ('<h3>datastreams</h3>'); // print ('<h3>datastreams</h3>');
foreach ($islandora_object as $ds) { // foreach ($islandora_object as $ds) {
print $ds->label . '<br>'; // print $ds->label . '<br>';
//do something // //do something
} // }
print('<h3>Dublin Core</h3>'); // print('<h3>Dublin Core</h3>');
foreach ($dublin_core as $element) { // foreach ($dublin_core as $element) {
if (!empty($element)) { // if (!empty($element)) {
// print($element); // // print($element);
foreach ($element as $key => $value) { // foreach ($element as $key => $value) {
foreach($value as $v){ // foreach($value as $v){
if(!empty($v)){ // if(!empty($v)){
print '<strong>'.($key).'</strong>: ';print($v).'<br />'; // print '<strong>'.($key).'</strong>: ';print($v).'<br />';
} // }
} // }
} // }
} // }
} // }
if(isset($variables['islandora_thumbnail_url'])){
print('<img src = "'.$variables['islandora_thumbnail_url'].'"/>');
}
?>
?>
<div class="islandora-object">
<h2>Details</h2>
<dl class="islandora-object-thumb">
<dt>
<?php if(isset($variables['islandora_thumbnail_url'])): ?>
<?php print('<img src = "'.$variables['islandora_thumbnail_url'].'"/>'); ?></dt>
<?php endif; ?>
<dd></dd>
</dl>
<dl class="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; ?>
</dl>
</div>

1
islandora.module

@ -579,6 +579,7 @@ function islandora_preprocess_islandora_default(&$variables) {
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(t('Error retrieving object %s %t', array('%s' => $islandora_object->id, '%t' => $e->getMessage())), 'error'); drupal_set_message(t('Error retrieving object %s %t', array('%s' => $islandora_object->id, '%t' => $e->getMessage())), 'error');
} }
$variables['dc_array'] = $dc_object->as_formatted_array();
$variables['islandora_dublin_core'] = $dc_object; $variables['islandora_dublin_core'] = $dc_object;
$variables['islandora_object_label'] = $islandora_object->label; $variables['islandora_object_label'] = $islandora_object->label;
global $base_url; global $base_url;

52
islandora_basic_image/islandora-basic-image--islandora-27.tpl.php

@ -1,52 +0,0 @@
<?php
/*
* islandora-basic-image--islandora-27.tpl.php
*
*
*
* This file is part of Islandora.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program. If not, see <http ://www.gnu.org/licenses/>.
*/
?>
<?php drupal_set_title(""); ?>
<div class="islandora-basic-image-object">
<div class="islandora-basic-image-content clearfix">
<?php print $islandora_medium_img; ?>
</div>
<div class="islandora-basic-image-sidebar">
<h1 class="title"><?php print $islandora_object_label; ?></h1>
<h3><?php print $dc_array['dc:description']['label']; ?></h3>
<p><?php print $dc_array['dc:description']['value']; ?></p>
</div>
<div class="islandora-basic-image-metadata">
<h4>Details</h4>
<dl class="islandora-basic-image-fields">
<?php $row_field = 0; ?>
<?php foreach($dc_array as $key => $value): ?>
<dt class="solr-label <?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>">
<?php print $value['label']; ?>
</dt>
<?php if ($key == 'PID'): ?>
<?php $value['value'] = l($value['value'], 'fedora/repository/' . htmlspecialchars($value['value'], ENT_QUOTES, 'utf-8')); ?>
<?php endif; ?>
<dd class="solr-value <?php print $value['class']; ?><?php print $row_field == 0 ? ' first' : ''; ?>">
<?php print $value['value']; ?>
</dd>
<?php $row_field++; ?>
<?php endforeach; ?>
</dl>
</div>
</div>

2
islandora_basic_image/islandora_basic_image.module

@ -77,7 +77,7 @@ function islandora_basic_image_menu() {
* @param string $object_id * @param string $object_id
* @return string * @return string
*/ */
/** /*
function islandora_basic_image_manage_object($object_id){ function islandora_basic_image_manage_object($object_id){
return 'Image CModel edit function '.$object_id; return 'Image CModel edit function '.$object_id;
}*/ }*/

Loading…
Cancel
Save