Browse Source

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

pull/125/merge
rwincewicz 13 years ago
parent
commit
b1b984f12c
  1. 3
      admin/islandora.admin.inc
  2. 37
      includes/tuque.inc
  3. 15
      islandora.module
  4. 13
      islandora_basic_collection/islandora_basic_collection.install
  5. 33
      islandora_basic_image/css/islandora_basic_image.theme.css
  6. 20
      islandora_basic_image/islandora-basic-image.tpl.php
  7. 13
      islandora_basic_image/islandora_basic_image.install

3
admin/islandora.admin.inc

@ -11,8 +11,7 @@ function islandora_repository_admin($form, &$form_state) {
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
if (!IslandoraTuque::exists()) { if (!IslandoraTuque::exists()) {
$message = t('This module requires the !url. Please install sites all libraries folder before continuing.', array('!url' => l(t('Tuque Fedora API'), 'http://github.com/islandora/tuque'))); IslandoraTuque::getError();
drupal_set_message(check_plain($message));
return; return;
} }

37
includes/tuque.inc

@ -1,15 +1,15 @@
<?php <?php
//do this until we expost these in a module or library //do this until we expost these in a module or library
require_once 'sites/all/libraries/tuque/Datastream.php'; @include_once 'sites/all/libraries/tuque/Datastream.php';
require_once 'sites/all/libraries/tuque/FedoraApi.php'; @include_once 'sites/all/libraries/tuque/FedoraApi.php';
require_once 'sites/all/libraries/tuque/FedoraApiSerializer.php'; @include_once 'sites/all/libraries/tuque/FedoraApiSerializer.php';
require_once 'sites/all/libraries/tuque/Object.php'; @include_once 'sites/all/libraries/tuque/Object.php';
require_once 'sites/all/libraries/tuque/RepositoryConnection.php'; @include_once 'sites/all/libraries/tuque/RepositoryConnection.php';
require_once 'sites/all/libraries/tuque/Cache.php'; @include_once 'sites/all/libraries/tuque/Cache.php';
require_once 'sites/all/libraries/tuque/RepositoryException.php'; @include_once 'sites/all/libraries/tuque/RepositoryException.php';
require_once 'sites/all/libraries/tuque/Repository.php'; @include_once 'sites/all/libraries/tuque/Repository.php';
require_once 'sites/all/libraries/tuque/FedoraRelationships.php'; @include_once 'sites/all/libraries/tuque/FedoraRelationships.php';
class IslandoraTuque { class IslandoraTuque {
@ -58,15 +58,24 @@ class IslandoraTuque {
$url = variable_get('islandora_base_url', 'http://localhost:8080/fedora'); $url = variable_get('islandora_base_url', 'http://localhost:8080/fedora');
} }
$this->connection = new RepositoryConnection($url, $user_string, $pass_string); if(self::exists()) {
$this->connection->reuseConnection = TRUE; $this->connection = new RepositoryConnection($url, $user_string, $pass_string);
$this->api = new FedoraApi($this->connection); $this->connection->reuseConnection = TRUE;
$this->cache = new SimpleCache(); $this->api = new FedoraApi($this->connection);
$this->repository = new FedoraRepository($this->api, $this->cache); $this->cache = new SimpleCache();
$this->repository = new FedoraRepository($this->api, $this->cache);
}
} }
static function exists() { static function exists() {
return class_exists('RepositoryConnection'); return class_exists('RepositoryConnection');
} }
static function getError() {
$islandora_doc_link = l(t('Islandora documentation'), 'https://wiki.duraspace.org/display/ISLANDORA/Islandora');
$tuque_link = l(t('Tuque Fedora API'), 'http://github.com/islandora/tuque');
$message = t('Islandora requires the !tuque_url. Please install in /sites/all/libraries/tuque before continuing. See the !islandora_url.', array( '!tuque_url' => $tuque_link, '!islandora_url' => $islandora_doc_link));
drupal_set_message($message, 'error', FALSE);
}
} }

15
islandora.module

@ -434,13 +434,18 @@ function islandora_object_load($object_id) {
$islandora_tuque = new IslandoraTuque(); $islandora_tuque = new IslandoraTuque();
} }
try { if(IslandoraTuque::exists()) {
$fedora_object = $islandora_tuque->repository->getObject($object_id); try {
} catch (Exception $e) { $fedora_object = $islandora_tuque->repository->getObject($object_id);
} catch (Exception $e) {
return NULL;
}
return $fedora_object;
}
else {
IslandoraTuque::getError();
return NULL; return NULL;
} }
return $fedora_object;
} }
function islandora_ingest_access_callback($object, $perm) { function islandora_ingest_access_callback($object, $perm) {

13
islandora_basic_collection/islandora_basic_collection.install

@ -1,5 +1,18 @@
<?php <?php
function islandora_basic_collection_requirements($phase) {
if($phase == 'install') {
module_load_include('inc', 'islandora', 'includes/tuque');
if(!IslandoraTuque::exists()) {
return array(array(
'title' => 'Tuque',
'description' => 'The Islandora Collection solution pack requires the Tuque library.',
'severity' => REQUIREMENT_ERROR,
));
}
}
}
/** /**
* @file * @file
* islandora_basic_collection.install * islandora_basic_collection.install

33
islandora_basic_image/css/islandora_basic_image.theme.css

@ -1,14 +1,22 @@
/* /*
Document : islandora_basic_collection.theme Document : islandora_basic_collection.theme
Created on : May 23, 2012, 11:23:56 AM Created on : May 23, 2012, 11:23:56 AM
Description: Description: The basic image page is a simple flexible layout page
Purpose of the stylesheet follows. that breaks down to two columns when 2 sidebars are visible
*/ */
.islandora-basic-image-content, .islandora-basic-image-content {
.islandora-basic-image-sidebar { background-color: #F2F2F2;
display: inline; border: 1px solid #ddd;
position: relative; -webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
padding: 15px;
}
.islandora-basic-image-content img {
margin: 0;
display: block;
} }
.islandora-basic-image-metadata { .islandora-basic-image-metadata {
@ -42,9 +50,6 @@ dl.islandora-basic-image-fields {
border-top:0; border-top:0;
} }
.islandora-basic-image-sidebar,
.islandora-basic-image-sidebar,
body.one-sidebar .islandora-basic-image-sidebar,
body.two-sidebars .islandora-basic-image-sidebar { body.two-sidebars .islandora-basic-image-sidebar {
clear: both; clear: both;
width: 100%; width: 100%;
@ -53,15 +58,17 @@ body.two-sidebars .islandora-basic-image-sidebar {
@media all and (min-width: 768px) { @media all and (min-width: 768px) {
body.no-sidebars .islandora-basic-image-content { body.no-sidebars .islandora-basic-image-content {
width: 60%; width: 65%;
padding: 0 20px 0 0;
float: left; /* LTR */ float: left; /* LTR */
margin-top: 1em; }
body.no-sidebars .islandora-basic-image-sidebar {
padding-left: 20px;
} }
body.no-sidebars .islandora-basic-image-sidebar { body.no-sidebars .islandora-basic-image-sidebar {
float: right; /* LTR */ float: right; /* LTR */
width: 40%; width: 35%;
clear: none; clear: none;
} }

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

@ -26,22 +26,24 @@
<?php endif; ?> <?php endif; ?>
<div class="islandora-basic-image-object islandora"> <div class="islandora-basic-image-object islandora">
<div class="islandora-basic-image-content clearfix"> <div class="islandora-basic-image-content-wrapper clearfix">
<?php if(isset($islandora_full_url)): ?> <?php if(isset($islandora_medium_img)): ?>
<?php print l($islandora_medium_img, $islandora_full_url, array('html' => TRUE)); ?> <div class="islandora-basic-image-content">
<?php if(isset($islandora_full_url)): ?>
<?php print l($islandora_medium_img, $islandora_full_url, array('html' => TRUE)); ?>
<?php elseif(isset($islandora_medium_img)): ?> <?php elseif(isset($islandora_medium_img)): ?>
<?php print $islandora_medium_img; ?> <?php print $islandora_medium_img; ?>
<?php else: ?> <?php endif; ?>
</div>
<?php endif; ?> <?php endif; ?>
</div>
<div class="islandora-basic-image-sidebar"> <div class="islandora-basic-image-sidebar">
<?php if($dc_array['dc:description']['value']): ?> <?php if($dc_array['dc:description']['value']): ?>
<h3><?php print $dc_array['dc:description']['label']; ?></h3> <h2><?php print $dc_array['dc:description']['label']; ?></h2>
<p><?php print $dc_array['dc:description']['value']; ?></p> <p><?php print $dc_array['dc:description']['value']; ?></p>
<?php endif; ?> <?php endif; ?>
<?php if(empty($parent_collections)): ?> <?php if($parent_collections): ?>
<div> <div>
<h3>In Collections</h3> <h2>In Collections</h2>
<ul> <ul>
<?php foreach($parent_collections as $key => $value): ?> <?php foreach($parent_collections as $key => $value): ?>
<li><?php print $value['label_link'] ?></li> <li><?php print $value['label_link'] ?></li>
@ -50,7 +52,7 @@
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div>
<fieldset class="collapsible collapsed islandora-basic-image-metadata"> <fieldset class="collapsible collapsed islandora-basic-image-metadata">
<legend><span class="fieldset-legend">Extended Details</span></legend> <legend><span class="fieldset-legend">Extended Details</span></legend>
<div class="fieldset-wrapper"> <div class="fieldset-wrapper">

13
islandora_basic_image/islandora_basic_image.install

@ -5,6 +5,19 @@
* islandora-basic-image.install * islandora-basic-image.install
*/ */
function islandora_basic_image_requirements($phase) {
if($phase == 'install') {
module_load_include('inc', 'islandora', 'includes/tuque');
if(!IslandoraTuque::exists()) {
return array(array(
'title' => 'Tuque',
'description' => 'The Islandora Collection solution pack requires the Tuque library.',
'severity' => REQUIREMENT_ERROR,
));
}
}
}
/** /**
* Implements hook_install * Implements hook_install
*/ */

Loading…
Cancel
Save