Browse Source

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

pull/125/head
jonathangreen 13 years ago
parent
commit
8aba4436cc
  1. 36
      islandora.module
  2. 22
      islandora_basic_collection/islandora_basic_collection.install
  3. 4
      islandora_basic_collection/islandora_basic_collection.module
  4. 2
      islandora_basic_collection/theme/islandora-basic-collection-wrapper.tpl.php
  5. 24
      islandora_basic_collection/theme/islandora_basic_collection.theme.inc
  6. 8
      islandora_basic_image/includes/image.process.inc
  7. 24
      islandora_basic_image/islandora_basic_image.install
  8. 6
      islandora_basic_image/islandora_basic_image.module
  9. 0
      islandora_basic_image/theme/islandora-basic-image.tpl.php

36
islandora.module

@ -43,14 +43,14 @@ function islandora_menu() {
$items = array(); $items = array();
$items['admin/islandora'] = array( $items['admin/islandora'] = array(
'title' => 'Islandora Configuration', 'title' => 'Islandora',
'description' => "Configure Islandora's interaction with Fedora", 'description' => "Configure settings associated with Islandora.",
'access arguments' => array('administer site configuration'), 'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
); );
$items['admin/islandora/configure'] = array( $items['admin/islandora/configure'] = array(
'title' => 'Islandora Configuration', 'title' => 'Configuration',
'description' => 'Enter the Islandora collection information here.', 'description' => 'Configure settings for Islandora.',
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('islandora_repository_admin'), 'page arguments' => array('islandora_repository_admin'),
'file' => 'admin/islandora.admin.inc', 'file' => 'admin/islandora.admin.inc',
@ -390,32 +390,32 @@ function islandora_theme() {
function islandora_permission() { function islandora_permission() {
return array( return array(
FEDORA_VIEW => array( FEDORA_VIEW => array(
'title' => t('View Fedora Repository objects and datastreams'), 'title' => t('View repository objects and datastreams'),
'description' => t('Users with this permission will be allowed to view Fedora objects and datastreams. Unless Fedora XACML security policies limits this functionality to certain objects.') 'description' => t('View objects in the repository and their associated datastreams. Note: Fedora XACML security policies may override this permission.')
), ),
FEDORA_ADD_DS => array( FEDORA_ADD_DS => array(
'title' => t('Add Fedora streams to Fedora objects'), 'title' => t('Add datastreams to repository objects'),
'description' => t('Users with this permission will be allowed to add datastreams to Fedora objects. Unless Fedora XACML security policies limits this functionality to certain objects.') 'description' => t('Add datastreams to objects in the repository. Note: Fedora XACML security policies may override this position.')
), ),
FEDORA_METADATA_EDIT => array( FEDORA_METADATA_EDIT => array(
'title' => t('Edit Fedora Metadata'), 'title' => t('Edit metadata'),
'description' => t('Users with this permission will be allowed to edit Fedora Metadata streams') 'description' => t('Edit metadata for objects in the repository.')
), ),
FEDORA_INGEST => array( FEDORA_INGEST => array(
'title' => t('Create new Fedora objects'), 'title' => t('Create new repository objects'),
'description' => t('Users with this permission will be allowed to create new objects in the Fedora repository') 'description' => t('Create new objects in the repository.')
), ),
FEDORA_PURGE => array( FEDORA_PURGE => array(
'title' => t('Permanently remove objects from the Fedora repository'), 'title' => t('Permanently remove objects from the repository'),
'description' => t('Users with this permission will be allowed to Permantly remove objects from the Fedora repository.') 'description' => t('Permanently remove objects from the repository.')
), ),
FEDORA_MODIFY_STATE => array( FEDORA_MODIFY_STATE => array(
'title' => t('Change a Fedora objects state'), 'title' => t('Change repository object states'),
'description' => t('Users with this permission will be allowed to change a Fedora objects state.') 'description' => t('Change the state of objects in the repository (e.g. from Active to Inactive).')
), ),
FEDORA_MANAGE => array( FEDORA_MANAGE => array(
'title' => t('View Fedora Manage tabs'), 'title' => t('View object management tabs'),
'description' => t('Users with this permission will be allowed to view fedora manage manage tabs.') 'description' => t('View tabs that provide object management functions.')
) )
); );
} }

22
islandora_basic_collection/islandora_basic_collection.install

@ -37,10 +37,10 @@ function islandora_basic_collection_install() {
drupal_set_message(st('Unable to install content models %e', array('%e' => $e)), 'error'); drupal_set_message(st('Unable to install content models %e', array('%e' => $e)), 'error');
return; return;
} }
drupal_set_message(st('Content models installed!')); drupal_set_message(st('Content models for the basic collection module installed!'));
} }
else { else {
drupal_set_message(st('Content models already exist!'), 'warning'); drupal_set_message(st('Content models for the basic collection module already exist!'), 'warning');
} }
$collection_query = $rest_connection->api->a->findObjects('query', 'pid=islandora:root'); $collection_query = $rest_connection->api->a->findObjects('query', 'pid=islandora:root');
@ -56,13 +56,13 @@ function islandora_basic_collection_install() {
$datastream->setContentFromUrl($file_path); $datastream->setContentFromUrl($file_path);
$fedora_object->ingestDatastream($datastream); $fedora_object->ingestDatastream($datastream);
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(st('Unable to install collections %e', array('%e' => $e)), 'error'); drupal_set_message(st('Unable to install collections for the basic collection module %e', array('%e' => $e)), 'error');
return; return;
} }
drupal_set_message(st('Collections installed!')); drupal_set_message(st('Collections installed for the basic collection module!'));
} }
else { else {
drupal_set_message(st('Collections already exist!'), 'warning'); drupal_set_message(st('Collections already exist for the basic collection module!'), 'warning');
} }
} }
@ -80,13 +80,13 @@ function islandora_basic_collection_uninstall() {
try { try {
$rest_connection->repository->purgeObject('islandora:collectionCModel'); $rest_connection->repository->purgeObject('islandora:collectionCModel');
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(st('Unable to purge content models %e', array('%e' => $e)), 'error'); drupal_set_message(st('Unable to purge content models for the basic collection module %e', array('%e' => $e)), 'error');
return; return;
} }
drupal_set_message(st('Content models purged!')); drupal_set_message(st('Content models for the basic collection module purged!'));
} }
else { else {
drupal_set_message(st('Content models don\'t exist!'), 'warning'); drupal_set_message(st('Content models for the basic collection module don\'t exist!'), 'warning');
} }
$collection_query = $rest_connection->api->a->findObjects('query', 'pid=islandora:root'); $collection_query = $rest_connection->api->a->findObjects('query', 'pid=islandora:root');
@ -94,12 +94,12 @@ function islandora_basic_collection_uninstall() {
try { try {
$rest_connection->repository->purgeObject('islandora:root'); $rest_connection->repository->purgeObject('islandora:root');
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(st('Unable to purge collections %e', array('%e' => $e)), 'error'); drupal_set_message(st('Unable to purge collections for the basic collection module %e', array('%e' => $e)), 'error');
return; return;
} }
drupal_set_message(st('Collections purged!')); drupal_set_message(st('Collections for the basic collection module purged!'));
} }
else { else {
drupal_set_message(st('Collections don\'t exist!'), 'warning'); drupal_set_message(st('Collections for the basic collection module don\'t exist!'), 'warning');
} }
} }

4
islandora_basic_collection/islandora_basic_collection.module

@ -39,8 +39,8 @@ function islandora_basic_collection_menu() {
); );
$items['admin/islandora/basic_collection'] = array( $items['admin/islandora/basic_collection'] = array(
'title' => 'Islandora basic collection', 'title' => 'Core collection',
'description' => 'Configure the basic Collection solution pack.', 'description' => 'Configure the core Islandora collection functionality.',
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'access arguments' => array('administer site configuration'), 'access arguments' => array('administer site configuration'),
'page arguments' => array('islandora_basic_collection_admin'), 'page arguments' => array('islandora_basic_collection_admin'),

2
islandora_basic_collection/theme/islandora-basic-collection-wrapper.tpl.php

@ -25,7 +25,7 @@
<div class="islandora-basic-collection-wrapper"> <div class="islandora-basic-collection-wrapper">
<div class="islandora-basic-collection clearfix"> <div class="islandora-basic-collection clearfix">
<span class="islandora-basic-collection-display-switch"><?php print $switch_view_link; ?></span> <span class="islandora-basic-collection-display-switch"><?php print $grid_link; ?> <?php print $list_link; ?></span>
<?php print $collection_pager; ?> <?php print $collection_pager; ?>
<?php print $collection_content; ?> <?php print $collection_content; ?>
<?php print $collection_pager; ?> <?php print $collection_pager; ?>

24
islandora_basic_collection/theme/islandora_basic_collection.theme.inc

@ -20,23 +20,29 @@ function islandora_basic_collection_preprocess_islandora_basic_collection_wrappe
$display = (empty($_GET['display'])) ? variable_get('islandora_basic_collection_default_view', 'grid') : $_GET['display']; $display = (empty($_GET['display'])) ? variable_get('islandora_basic_collection_default_view', 'grid') : $_GET['display'];
$link_text = (empty($_GET['display'])) ? 'grid' : $_GET['display']; $link_text = (empty($_GET['display'])) ? 'grid' : $_GET['display'];
$query_params = drupal_get_query_parameters($_GET); $query_params = drupal_get_query_parameters($_GET);
global $base_url;
if ($display == 'grid') { if ($display == 'grid') {
$query_params['display'] = 'list'; $query_params['display'] = 'list';
$link_text = 'List View'; $list_link = l('List View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => 'islandora-view-list'),
$link_class = 'islandora-view-default'; 'query' => $query_params));
unset($query_params['display']);
$query_params['display'] = 'grid';
$grid_link = l('Grid View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => array('islandora-view-grid', 'active')),
'query' => $query_params));
$collection_content = theme('islandora_basic_collection_grid', array('islandora_object' => $islandora_object, 'collection_results' => $results)); $collection_content = theme('islandora_basic_collection_grid', array('islandora_object' => $islandora_object, 'collection_results' => $results));
} }
else { else {
$query_params['display'] = 'list';
$list_link = l('List View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => array('islandora-view-list', 'active')),
'query' => $query_params));
unset($query_params['display']);
$query_params['display'] = 'grid'; $query_params['display'] = 'grid';
$link_text = 'Grid View'; $grid_link = l('Grid View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => 'islandora-view-grid'),
$link_class = 'islandora-view-grid'; 'query' => $query_params));
$collection_content = theme('islandora_basic_collection', array('islandora_object' => $islandora_object, 'collection_results' => $results)); $collection_content = theme('islandora_basic_collection', array('islandora_object' => $islandora_object, 'collection_results' => $results));
} }
global $base_url; $variables['list_link'] = $list_link;
$link = l($link_text, $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => $link_class), $variables['grid_link'] = $grid_link;
'query' => $query_params));
$variables['switch_view_link'] = $link;
$variables['collection_content'] = $collection_content; $variables['collection_content'] = $collection_content;
} }

8
islandora_basic_image/includes/image.process.inc

@ -1,11 +1,17 @@
<?php <?php
/** /**
* @file * @file image.process.inc
* *
* This file contains all the functions for image manipulation used in the * This file contains all the functions for image manipulation used in the
* basic image solution pack. * basic image solution pack.
*/ */
/**
* creates the derivatives for this content model type
* @param object $object
* tuque FedoraObject
* @return string
*/
function islandora_basic_image_create_all_derivatives($object) { function islandora_basic_image_create_all_derivatives($object) {
module_load_include('inc', 'islandora', 'includes/mime.detect'); module_load_include('inc', 'islandora', 'includes/mime.detect');
module_load_include('inc', 'islandora_basic_image', 'includes/image_process'); module_load_include('inc', 'islandora_basic_image', 'includes/image_process');

24
islandora_basic_image/islandora_basic_image.install

@ -38,13 +38,13 @@ function islandora_basic_image_install() {
$xml = file_get_contents(drupal_get_path('module', 'islandora_basic_image') . '/xml/simple_islandora_basic_imageCM.xml'); $xml = file_get_contents(drupal_get_path('module', 'islandora_basic_image') . '/xml/simple_islandora_basic_imageCM.xml');
$restConnection->api->m->ingest(array('string' => $xml)); $restConnection->api->m->ingest(array('string' => $xml));
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(t('Unable to install content models %e', array('%e' => $e)), 'error'); drupal_set_message(t('Unable to install content models for the basic image module %e', array('%e' => $e)), 'error');
return; return;
} }
drupal_set_message(t('Content models installed!')); drupal_set_message(t('Content models for the basic image module installed!'));
} }
else { else {
drupal_set_message(t('Content models already exist!'), 'warning'); drupal_set_message(t('Content models for the basic image module already exist!'), 'warning');
} }
$collection_query = $restConnection->api->a->findObjects('query', 'pid=islandora:sp_basic_image_collection'); $collection_query = $restConnection->api->a->findObjects('query', 'pid=islandora:sp_basic_image_collection');
@ -61,13 +61,13 @@ function islandora_basic_image_install() {
$fedora_object->ingestDatastream($datastream); $fedora_object->ingestDatastream($datastream);
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(t('Unable to install collections %e', array('%e' => $e)), 'error'); drupal_set_message(t('Unable to install collections for the basic image module %e', array('%e' => $e)), 'error');
return; return;
} }
drupal_set_message(t('Collections installed!')); drupal_set_message(t('Collections for the basic image module installed!'));
} }
else { else {
drupal_set_message(t('Collections already exist!'), 'warning'); drupal_set_message(t('Collections for the basic image module already exist!'), 'warning');
} }
} }
@ -90,13 +90,13 @@ function islandora_basic_image_uninstall() {
try { try {
$restConnection->repository->purgeObject('islandora:sp_basic_image'); $restConnection->repository->purgeObject('islandora:sp_basic_image');
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(t('Unable to purge content models %e', array('%e' => $e)), 'error'); drupal_set_message(t('Unable to purge content models for the basic image module %e', array('%e' => $e)), 'error');
return; return;
} }
drupal_set_message(t('Content models purged!')); drupal_set_message(t('Content models for the basic image module purged!'));
} }
else { else {
drupal_set_message(t('Content models don\'t exist!'), 'warning'); drupal_set_message(t('Content models for the basic image module don\'t exist!'), 'warning');
} }
$collection_query = $restConnection->api->a->findObjects('query', 'pid=islandora:sp_basic_image_collection'); $collection_query = $restConnection->api->a->findObjects('query', 'pid=islandora:sp_basic_image_collection');
@ -104,12 +104,12 @@ function islandora_basic_image_uninstall() {
try { try {
$restConnection->repository->purgeObject('islandora:sp_basic_image_collection'); $restConnection->repository->purgeObject('islandora:sp_basic_image_collection');
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(t('Unable to purge collections %e', array('%e' => $e)), 'error'); drupal_set_message(t('Unable to purge collections for the basic image module %e', array('%e' => $e)), 'error');
return; return;
} }
drupal_set_message(t('Collections purged!')); drupal_set_message(t('Collections for the basic image module purged!'));
} }
else { else {
drupal_set_message(t('Collections don\'t exist!'), 'warning'); drupal_set_message(t('Collections for the basic image module don\'t exist!'), 'warning');
} }
} }

6
islandora_basic_image/islandora_basic_image.module

@ -31,8 +31,8 @@
function islandora_basic_image_menu() { function islandora_basic_image_menu() {
$items = array(); $items = array();
$items['admin/islandora/basic_image'] = array( $items['admin/islandora/basic_image'] = array(
'title' => 'Islandora Basic Image', 'title' => 'Basic Image collection',
'description' => 'Configure the basic image solution pack.', 'description' => 'Configure the Basic Image solution pack.',
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'access arguments' => array('administer site configuration'), 'access arguments' => array('administer site configuration'),
'page arguments' => array('islandora_basic_image_admin'), 'page arguments' => array('islandora_basic_image_admin'),
@ -124,7 +124,7 @@ function islandora_basic_image_theme($existing, $type, $theme, $path) {
'variables' => array('islandora_objects' => NULL), 'variables' => array('islandora_objects' => NULL),
), ),
'islandora_basic_image' => array( 'islandora_basic_image' => array(
'template' => 'islandora-basic-image', 'template' => 'theme/islandora-basic-image',
'pattern' => 'islandora_basic_image__', //we can add pids to the end of this pattern in our preprocess function 'pattern' => 'islandora_basic_image__', //we can add pids to the end of this pattern in our preprocess function
// and templates will be able to have have a pid appended to the template name to overide a template on a per object basis // and templates will be able to have have a pid appended to the template name to overide a template on a per object basis
//an example template would be named islandora-basic-image--islandora-27.tpl.phps //an example template would be named islandora-basic-image--islandora-27.tpl.phps

0
islandora_basic_image/islandora-basic-image.tpl.php → islandora_basic_image/theme/islandora-basic-image.tpl.php

Loading…
Cancel
Save