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');
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')));
drupal_set_message(check_plain($message));
IslandoraTuque::getError();
return;
}

37
includes/tuque.inc

@ -1,15 +1,15 @@
<?php
//do this until we expost these in a module or library
require_once 'sites/all/libraries/tuque/Datastream.php';
require_once 'sites/all/libraries/tuque/FedoraApi.php';
require_once 'sites/all/libraries/tuque/FedoraApiSerializer.php';
require_once 'sites/all/libraries/tuque/Object.php';
require_once 'sites/all/libraries/tuque/RepositoryConnection.php';
require_once 'sites/all/libraries/tuque/Cache.php';
require_once 'sites/all/libraries/tuque/RepositoryException.php';
require_once 'sites/all/libraries/tuque/Repository.php';
require_once 'sites/all/libraries/tuque/FedoraRelationships.php';
@include_once 'sites/all/libraries/tuque/Datastream.php';
@include_once 'sites/all/libraries/tuque/FedoraApi.php';
@include_once 'sites/all/libraries/tuque/FedoraApiSerializer.php';
@include_once 'sites/all/libraries/tuque/Object.php';
@include_once 'sites/all/libraries/tuque/RepositoryConnection.php';
@include_once 'sites/all/libraries/tuque/Cache.php';
@include_once 'sites/all/libraries/tuque/RepositoryException.php';
@include_once 'sites/all/libraries/tuque/Repository.php';
@include_once 'sites/all/libraries/tuque/FedoraRelationships.php';
class IslandoraTuque {
@ -58,15 +58,24 @@ class IslandoraTuque {
$url = variable_get('islandora_base_url', 'http://localhost:8080/fedora');
}
$this->connection = new RepositoryConnection($url, $user_string, $pass_string);
$this->connection->reuseConnection = TRUE;
$this->api = new FedoraApi($this->connection);
$this->cache = new SimpleCache();
$this->repository = new FedoraRepository($this->api, $this->cache);
if(self::exists()) {
$this->connection = new RepositoryConnection($url, $user_string, $pass_string);
$this->connection->reuseConnection = TRUE;
$this->api = new FedoraApi($this->connection);
$this->cache = new SimpleCache();
$this->repository = new FedoraRepository($this->api, $this->cache);
}
}
static function exists() {
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();
}
try {
$fedora_object = $islandora_tuque->repository->getObject($object_id);
} catch (Exception $e) {
if(IslandoraTuque::exists()) {
try {
$fedora_object = $islandora_tuque->repository->getObject($object_id);
} catch (Exception $e) {
return NULL;
}
return $fedora_object;
}
else {
IslandoraTuque::getError();
return NULL;
}
return $fedora_object;
}
function islandora_ingest_access_callback($object, $perm) {

13
islandora_basic_collection/islandora_basic_collection.install

@ -1,5 +1,18 @@
<?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
* islandora_basic_collection.install

33
islandora_basic_image/css/islandora_basic_image.theme.css

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

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

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

13
islandora_basic_image/islandora_basic_image.install

@ -5,6 +5,19 @@
* 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
*/

Loading…
Cancel
Save