Browse Source

Merge branch '7.x' of github.com:Islandora/islandora into 7.x

pull/110/head
Mitchell MacKenzie 13 years ago
parent
commit
d9cce0e19d
  1. 0
      includes/MimeClass.inc
  2. 0
      includes/datastream.inc
  3. 0
      includes/islandora_dublin_core.inc
  4. 10
      islandora.module
  5. 2
      islandora_basic_collection/islandora_basic_collection.module
  6. 19
      islandora_basic_image/css/islandora_basic_image.theme-rtl.css
  7. 97
      islandora_basic_image/css/islandora_basic_image.theme.css
  8. 48
      islandora_basic_image/islandora-basic-image.tpl.php
  9. 22
      islandora_basic_image/islandora_basic_image.module

0
utils/MimeClass.inc → includes/MimeClass.inc

0
utils/datastream.inc → includes/datastream.inc

0
utils/islandora_dublin_core.inc → includes/islandora_dublin_core.inc

10
islandora.module

@ -124,7 +124,7 @@ function islandora_menu() {
);
$items['islandora/object/%/edit'] = array(
'title' => 'Edit',
'title' => 'Manage',
'page callback' => 'islandora_edit_object',
'page arguments' => array(2),
'type' => MENU_LOCAL_TASK,
@ -144,7 +144,7 @@ function islandora_menu() {
'page callback' => 'islandora_datastream_as_attachment',
'page arguments' => array(2, 4),
'type' => MENU_CALLBACK,
'file' => 'utils/datastream.inc',
'file' => 'includes/datastream.inc',
'access arguments' => array(FEDORA_VIEW),
);
@ -153,7 +153,7 @@ function islandora_menu() {
'page callback' => 'islandora_datastream_as_attachment',
'page arguments' => array(2, 4),
'type' => MENU_CALLBACK,
'file' => 'utils/datastream.inc',
'file' => 'includes/datastream.inc',
'access arguments' => array(FEDORA_VIEW),
);
@ -162,7 +162,7 @@ function islandora_menu() {
'page callback' => 'islandora_datastream_as_attachment',
'page arguments' => array(2, 4),
'type' => MENU_CALLBACK,
'file' => 'utils/datastream.inc',
'file' => 'includes/datastream.inc',
'access arguments' => array(FEDORA_VIEW),
);
@ -525,7 +525,7 @@ function islandora_add_datastream($object_id) {
function islandora_preprocess_islandora_default(&$variables) {
$islandora_object = $variables['islandora_object'];
module_load_include('inc', 'islandora', 'utils/islandora_dublin_core');
module_load_include('inc', 'islandora', 'includes/islandora_dublin_core');
try {
$dc = $islandora_object['DC']->content;
//$dc_xml = simplexml_load_string($dc);

2
islandora_basic_collection/islandora_basic_collection.module

@ -88,7 +88,7 @@ function islandora_basic_collection_islandora_view_object($object, $user, $page_
*/
function islandora_basic_collection_preprocess_islandora_basic_collection(&$variables) {
$islandora_object = $variables['islandora_object'];
module_load_include('inc', 'islandora', 'utils/islandora_dublin_core');
module_load_include('inc', 'islandora', 'includes/islandora_dublin_core');
try {
$dc = $islandora_object['DC']->content;
$dc_object = Dublin_Core::import_from_xml_string($dc);

19
islandora_basic_image/css/islandora_basic_image.theme-rtl.css

@ -0,0 +1,19 @@
/*
Document : islandora_basic_collection.theme-rtl
Created on : May 23, 2012, 11:23:56 AM
Description:
Purpose of the stylesheet follows.
*/
@media all and (min-width: 768px) {
body.no-sidebars .islandora-basic-image-content {
float: right; /* LTR */
padding: 0 0 0 20px;
}
body.no-sidebars .islandora-basic-image-sidebar {
float: left; /* LTR */
}
}

97
islandora_basic_image/css/islandora_basic_image.theme.css

@ -5,4 +5,101 @@
Purpose of the stylesheet follows.
*/
.islandora-basic-image-object img {
height: auto;
max-width: 100%;
*width: 100%;
}
.islandora-basic-image-content,
.islandora-basic-image-sidebar {
display: inline;
position: relative;
}
.islandora-basic-image-metadata {
clear: both;
padding-top: 1.5em;
}
dl.islandora-basic-image-fields {
width:100%;
margin: 0 auto;
letter-spacing:-0.31em;
*letter-spacing:normal;
word-spacing:-0.43em;
}
/*
* The width + left/right padding of DTs/DDs equals 88% when compensating for an image
*/
.islandora-basic-image-metadata dt {
margin-right:-1px;
width:12.5%;
font-weight: bold;
text-align: right;
}
.islandora-basic-image-metadata dd {
width:77%;
}
/*
* In this rule, we reset the white-space (see hack above)
*/
.islandora-basic-image-metadata dt,
.islandora-basic-image-metadata dd {
display:inline-block;
*display:inline;
zoom:1;
letter-spacing:normal;
word-spacing:normal;
vertical-align:top;
padding:5px 0 3px 3%;
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-basic-image-sidebar,
.islandora-basic-image-sidebar,
body.one-sidebar .islandora-basic-image-sidebar,
body.two-sidebars .islandora-basic-image-sidebar {
clear: both;
width: 100%;
}
.islandora-basic-image-sidebar,
.islandora-basic-image-sidebar,
body.one-sidebar .islandora-basic-image-sidebar,
body.two-sidebars .islandora-basic-image-sidebar {
width: 100%;
}
@media all and (min-width: 768px) {
body.no-sidebars .islandora-basic-image-content,
body.no-sidebars .islandora-basic-image-sidebar {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body.no-sidebars .islandora-basic-image-content {
width: 60%;
padding: 0 20px 0 0;
float: left; /* LTR */
}
body.no-sidebars .islandora-basic-image-sidebar {
float: right; /* LTR */
width: 40%;
clear: none;
}
}

48
islandora_basic_image/islandora-basic-image.tpl.php

@ -21,23 +21,35 @@
* along with the program. If not, see <http ://www.gnu.org/licenses/>.
*/
?>
<?php
<?php drupal_set_title(""); ?>
<div class="islandora-basic-image-object">
<div class="islandora-basic-image-content clearfix">
<?php print $islandora_medium_size_url; ?>
</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>
$object = $variables['islandora_object'];
$image_url = $variables['islandora_image_url'];
drupal_set_title($object->label);
foreach ($variables['islandora_dublin_core'] as $element) {
if (!empty($element)) {
foreach ($element as $key => $value) {
foreach ($value as $v) {
if (!empty($v)) {
print '<strong>' . ($key) . '</strong>: ';
print($v) . '<br />';
}
}
}
}
}
print('<img src = "' . $image_url . '"/>');
?>
</div>

22
islandora_basic_image/islandora_basic_image.module

@ -77,7 +77,7 @@ function islandora_basic_image_islandora_view_object($object, $user, $page_numbe
foreach ($object->models as $model) {
if (isset($cmodel_list[$model][ISLANDORA_VIEW_HOOK]) && $cmodel_list[$model][ISLANDORA_VIEW_HOOK] == TRUE) {
$output = theme('islandora_basic_image', array('islandora_object' => $object));
return array('Basic Image Output' => $output);
return array('' => $output);
}
}
return NULL;
@ -91,7 +91,7 @@ function islandora_basic_image_islandora_view_object($object, $user, $page_numbe
*/
function islandora_basic_image_preprocess_islandora_basic_image(&$variables) {
$islandora_object = $variables['islandora_object'];
module_load_include('inc', 'islandora', 'utils/islandora_dublin_core');
module_load_include('inc', 'islandora', 'includes/islandora_dublin_core');
try {
$dc = $islandora_object['DC']->content;
$dc_object = Dublin_Core::import_from_xml_string($dc);
@ -101,15 +101,20 @@ function islandora_basic_image_preprocess_islandora_basic_image(&$variables) {
$variables['islandora_dublin_core'] = $dc_object;
//create a nicer array for themers
//TODO: give this a better home
$dc_array = array();
foreach ($dc_object as $element) {
if (!empty($element)) {
foreach ($element as $key => $value) {
foreach ($value as $v) {
if (!empty($v)) {
$dc_array[] = array($key => $v);
}
foreach ($element as $field => $value) {
// split value if the result value is an array
if (is_array($value)) {
$value = implode(", ", $value);
}
$dc_label = explode(':', $field);
$element_label = ucfirst($dc_label[1]);
$dc_array[$field]['label'] = $element_label;
$dc_array[$field]['value'] = strip_tags($value);
$dc_array[$field]['class'] = strtolower( preg_replace('/[^A-Za-z0-9]/', '-', $field));
}
}
}
@ -124,7 +129,8 @@ function islandora_basic_image_preprocess_islandora_basic_image(&$variables) {
$variables['islandora_thumbnail_url'] = $base_url . '/islandora/object/' . $islandora_object->id . '/datastream/TN/view';
}
if (isset($islandora_object['MEDIUM_SIZE'])) {
$variables['islandora_medium_size_url'] = $base_url . '/islandora/object/' . $islandora_object->id . '/datastream/MEDIUM_SIZE/view';
$medium_size = $base_url . '/islandora/object/' . $islandora_object->id . '/datastream/MEDIUM_SIZE/view';
$variables['islandora_medium_size_url'] = '<img src="' . $medium_size . '"/>';
}
}

Loading…
Cancel
Save