Browse Source

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

Conflicts:
	islandora_basic_collection/includes/collection_management.inc
pull/122/merge
jonathangreen 13 years ago
parent
commit
f9a5df6e22
  1. 6
      islandora.module
  2. 0
      islandora_basic_collection/includes/change_content_models.inc
  3. 20
      islandora_basic_collection/includes/child_collection.inc
  4. 2
      islandora_basic_collection/includes/collection_management.inc
  5. 2
      islandora_basic_collection/includes/collection_manager_table.inc
  6. 2
      islandora_basic_collection/includes/delete_collection.inc
  7. 10
      islandora_basic_collection/includes/manage_policies.inc
  8. 2
      islandora_basic_collection/includes/move_collection.inc
  9. 22
      islandora_basic_collection/islandora_basic_collection.module
  10. 10
      islandora_basic_image/islandora-basic-image.tpl.php
  11. 6
      islandora_basic_image/islandora_basic_image.module

6
islandora.module

@ -351,6 +351,12 @@ function islandora_get_types() {
return module_invoke_all('islandora_get_types'); return module_invoke_all('islandora_get_types');
} }
function islandora_init() {
if (path_is_admin(current_path())) {
drupal_add_css(drupal_get_path('module', 'islandora') . '/css/islandora.admin.css');
}
}
/** /**
* a function to call other modules edit page. If there are not any modules * a function to call other modules edit page. If there are not any modules
* that handle this function this module will build a default page. * that handle this function this module will build a default page.

0
islandora_basic_collection/includes/ChangeContentModels.inc → islandora_basic_collection/includes/change_content_models.inc

20
islandora_basic_collection/includes/ChildCollection.inc → islandora_basic_collection/includes/child_collection.inc

@ -15,8 +15,28 @@
*/ */
function islandora_create_child_collection_form($form, &$form_state, $this_collection_pid) { function islandora_create_child_collection_form($form, &$form_state, $this_collection_pid) {
module_load_include('inc', 'islandora', 'RestConnection'); module_load_include('inc', 'islandora', 'RestConnection');
module_load_include('inc', 'islandora_basic_collection', 'includes/CollectionPolicy');
$rest_connection = new RestConnection(); $rest_connection = new RestConnection();
$collection_object = new FedoraObject($this_collection_pid, $rest_connection->repository);
$policy_datastream = $collection_object->getDatastream(variable_get('Islandora_Collection_Policy_DSID', 'COLLECTION_POLICY'));
$collection_policy = new CollectionPolicy($policy_datastream->content);
$current_content_models = $collection_policy->getContentModels();
$collection_content_model_exists = FALSE;
foreach ($current_content_models as $current_content_model) {
if ($current_content_model['pid'] == 'islandora:collectionCModel') {
$collection_content_model_exists = TRUE;
}
}
if (!$collection_content_model_exists) {
$form['not_collection'] = array(
'#type' => 'item',
'#title' => t("This object can't contain child collections. To fix this add the islandora:collectionCModel to this object's collection policy"),
);
return $form;
}
$restricted = FALSE; $restricted = FALSE;
if (variable_get('islandora_namespace_restriction_enforced', FALSE)) { if (variable_get('islandora_namespace_restriction_enforced', FALSE)) {
$restricted = TRUE; $restricted = TRUE;

2
islandora_basic_collection/includes/CollectionManagement.inc → islandora_basic_collection/includes/collection_management.inc

@ -67,7 +67,6 @@ function islandora_collections_get_collection_from_pid($pid) {
return $object_pids; return $object_pids;
} }
/** /**
* Returns an array of pids that match the query contained in the collection * Returns an array of pids that match the query contained in the collection
* object's QUERY datastream or in the suppled $query parameter. * object's QUERY datastream or in the suppled $query parameter.
@ -124,7 +123,6 @@ function get_related_items_as_array($collection_pid, $relationship = array('isMe
return $results; return $results;
} }
/** /**
* determines whether we can see the object or not * determines whether we can see the object or not
* checks PID namespace permissions, and user permissions * checks PID namespace permissions, and user permissions

2
islandora_basic_collection/includes/CollectionManagerTable.inc → islandora_basic_collection/includes/collection_manager_table.inc

@ -2,7 +2,7 @@
/** /**
* @file * @file
* CollectionManagerTable.inc * collection_manager_table.inc
*/ */
/** /**

2
islandora_basic_collection/includes/DeleteCollection.inc → islandora_basic_collection/includes/delete_collection.inc

@ -13,7 +13,7 @@
* @return string * @return string
*/ */
function islandora_collection_deletion_form($form, &$form_state, $pid) { function islandora_collection_deletion_form($form, &$form_state, $pid) {
module_load_include('inc', 'islandora_basic_collection', 'CollectionManagerTable'); module_load_include('inc', 'islandora_basic_collection', 'collection_manager_table');
$potential_collections = get_collections_as_option_array(); $potential_collections = get_collections_as_option_array();
$table = islandora_collection_table($pid); $table = islandora_collection_table($pid);
$deletion_message = ($table) ? "Delete Members of this Collection" : "Delete Collection"; $deletion_message = ($table) ? "Delete Members of this Collection" : "Delete Collection";

10
islandora_basic_collection/includes/ManagePolicies.inc → islandora_basic_collection/includes/manage_policies.inc

@ -40,6 +40,7 @@ function islandora_manage_policies_form($form, &$form_state, $collection_pid) {
$collection_policy = new CollectionPolicy($collection_policy_string->content); $collection_policy = new CollectionPolicy($collection_policy_string->content);
$supported_collection_models = $collection_policy->getContentModels(); $supported_collection_models = $collection_policy->getContentModels();
} }
$collection_namespace = substr($collection_pid, 0, strpos($collection_pid, ":")); $collection_namespace = substr($collection_pid, 0, strpos($collection_pid, ":"));
$represented_content_models = get_represented_content_models($collection_pid); $represented_content_models = get_represented_content_models($collection_pid);
@ -58,6 +59,11 @@ function islandora_manage_policies_form($form, &$form_state, $collection_pid) {
$new_options = array_diff_key($new_content_models, $current_models_in_policy); $new_options = array_diff_key($new_content_models, $current_models_in_policy);
} }
$s = '';
if (count($current_models_in_policy) > 1) {
$s = 's';
}
$form['manage_collection_policy']['titlebox'] = array( $form['manage_collection_policy']['titlebox'] = array(
'#type' => 'item', '#type' => 'item',
'#title' => t("Manage collection policy for @collection_pid", array('@collection_pid' => $collection_pid)), '#title' => t("Manage collection policy for @collection_pid", array('@collection_pid' => $collection_pid)),
@ -111,7 +117,7 @@ function islandora_manage_policies_form($form, &$form_state, $collection_pid) {
$form['manage_collection_policy']['remove']['submit'] = array( $form['manage_collection_policy']['remove']['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
'#value' => t('Remove content model from collection policy'), '#value' => t('Remove content model@s from collection policy', array('@s' => $s)),
'#id' => 'remove_cm' '#id' => 'remove_cm'
); );
} }
@ -196,7 +202,7 @@ function islandora_manage_policies_form_submit($form, &$form_state) {
} }
} }
if ($found !== FALSE && $models->length > 1) { if ($found !== FALSE && $models->length > 0) {
$content_models_element->item(0)->removeChild($found); $content_models_element->item(0)->removeChild($found);
$ret = TRUE; $ret = TRUE;
} }

2
islandora_basic_collection/includes/MoveCollection.inc → islandora_basic_collection/includes/move_collection.inc

@ -14,7 +14,7 @@
* @return string * @return string
*/ */
function islandora_collection_migrate_form($form, &$form_state, $pid) { function islandora_collection_migrate_form($form, &$form_state, $pid) {
module_load_include('inc', 'islandora_basic_collection', 'CollectionManagerTable'); module_load_include('inc', 'islandora_basic_collection', 'collection_manager_table');
$potential_collections = get_collections_as_option_array(); $potential_collections = get_collections_as_option_array();
$table = islandora_collection_table($pid); $table = islandora_collection_table($pid);
if (!$table) { if (!$table) {

22
islandora_basic_collection/islandora_basic_collection.module

@ -61,6 +61,12 @@ function islandora_basic_collection_menu() {
return $items; return $items;
} }
function islandora_basic_collection_init() {
if (path_is_admin(current_path())) {
drupal_add_css(drupal_get_path('module', 'islandora_basic_collection') . '/css/islandora_basic_collection.admin.css');
}
}
/** /**
* Implements hook_menu_local_tasks_alter(). * Implements hook_menu_local_tasks_alter().
*/ */
@ -86,13 +92,13 @@ function islandora_basic_collection_menu_local_tasks_alter(&$data, $router_item,
*/ */
function islandora_basic_collection_manage_object($object_id) { function islandora_basic_collection_manage_object($object_id) {
module_load_include('inc', 'islandora_basic_collection', 'includes/CollectionManagement'); module_load_include('inc', 'islandora_basic_collection', 'includes/collection_management');
module_load_include('inc', 'islandora_basic_collection', 'includes/CollectionManagerTable'); module_load_include('inc', 'islandora_basic_collection', 'includes/collection_manager_table');
module_load_include('inc', 'islandora_basic_collection', 'includes/DeleteCollection'); module_load_include('inc', 'islandora_basic_collection', 'includes/delete_collection');
module_load_include('inc', 'islandora_basic_collection', 'includes/MoveCollection'); module_load_include('inc', 'islandora_basic_collection', 'includes/move_collection');
module_load_include('inc', 'islandora_basic_collection', 'includes/ChildCollection'); module_load_include('inc', 'islandora_basic_collection', 'includes/child_collection');
module_load_include('inc', 'islandora_basic_collection', 'includes/ManagePolicies'); module_load_include('inc', 'islandora_basic_collection', 'includes/manage_policies');
module_load_include('inc', 'islandora_basic_collection', 'includes/ChangeContentModels'); module_load_include('inc', 'islandora_basic_collection', 'includes/change_content_models');
$form = array(); $form = array();
@ -210,7 +216,7 @@ function islandora_basic_collection_theme($existing, $type, $theme, $path) {
'islandora_basic_collection_management_form_table' => array( 'islandora_basic_collection_management_form_table' => array(
'file' => 'theme/islandora_basic_collection.theme.inc', 'file' => 'theme/islandora_basic_collection.theme.inc',
'arguments' => array('element' => NULL), 'arguments' => array('element' => NULL),
'file' => 'includes/CollectionManagerTable.inc', 'file' => 'includes/collection_manager_table.inc',
), ),
); );
} }

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

@ -21,20 +21,25 @@
* along with the program. If not, see <http ://www.gnu.org/licenses/>. * along with the program. If not, see <http ://www.gnu.org/licenses/>.
*/ */
?> ?>
<?php if(isset($islandora_object_label)): ?>
<?php drupal_set_title("$islandora_object_label"); ?> <?php drupal_set_title("$islandora_object_label"); ?>
<?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 clearfix">
<?php if(isset($islandora_full_url)): ?> <?php if(isset($islandora_full_url)): ?>
<?php print l($islandora_medium_img, $islandora_full_url, array('html' => TRUE)); ?> <?php print l($islandora_medium_img, $islandora_full_url, array('html' => TRUE)); ?>
<?php else: ?> <?php elseif(isset($islandora_medium_img)): ?>
<?php print $islandora_medium_img; ?> <?php print $islandora_medium_img; ?>
<?php else: ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="islandora-basic-image-sidebar"> <div class="islandora-basic-image-sidebar">
<h1 class="title"><?php print $islandora_object_label; ?></h1> <?php if($dc_array['dc:description']['value']): ?>
<h3><?php print $dc_array['dc:description']['label']; ?></h3> <h3><?php print $dc_array['dc:description']['label']; ?></h3>
<p><?php print $dc_array['dc:description']['value']; ?></p> <p><?php print $dc_array['dc:description']['value']; ?></p>
<?php endif; ?>
<?php if(empty($parent_collections)): ?>
<div> <div>
<h3>In Collections</h3> <h3>In Collections</h3>
<ul> <ul>
@ -43,6 +48,7 @@
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
<?php endif; ?>
</div> </div>
<fieldset class="collapsible collapsed islandora-basic-image-metadata"> <fieldset class="collapsible collapsed islandora-basic-image-metadata">

6
islandora_basic_image/islandora_basic_image.module

@ -132,6 +132,12 @@ function islandora_basic_image_access($object_id) {
return FALSE; return FALSE;
} }
function islandora_basic_image_init() {
if (path_is_admin(current_path())) {
drupal_add_css(drupal_get_path('module', 'islandora_basic_image') . '/css/islandora_basic_image.admin.css');
}
}
/** /**
* Theme registry function * Theme registry function
* We supply a pattern so we can overide templates at the theme level if needed. * We supply a pattern so we can overide templates at the theme level if needed.

Loading…
Cancel
Save