Browse Source

Merge pull request #600 from knjackson30974/7.x-1.5-constant-changes

Changes in ISLANDORA_DERVIATIVE_CREATION_HOOK
7.x-1.5
William Panting 10 years ago
parent
commit
8728511b4a
  1. 4
      includes/derivatives.inc
  2. 2
      includes/object_properties.form.inc
  3. 8
      islandora.module

4
includes/derivatives.inc

@ -83,7 +83,7 @@ function islandora_do_derivatives(AbstractObject $object, array $options) {
$options += array(
'force' => FALSE,
);
$hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object));
$hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object));
uasort($hooks, 'drupal_sort_weight');
$results = array();
$hooks = islandora_filter_derivatives($hooks, $options, $object);
@ -176,7 +176,7 @@ function islandora_do_batch_derivatives(AbstractObject $object, array $options)
$options += array(
'force' => FALSE,
);
$hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object));
$hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object));
uasort($hooks, 'drupal_sort_weight');
$operations = array();

2
includes/object_properties.form.inc

@ -29,7 +29,7 @@ function islandora_object_properties_form(array $form, array &$form_state, Abstr
$regenerate_derivatives_access = FALSE;
if (islandora_object_access(ISLANDORA_REGENERATE_DERIVATIVES, $object)) {
module_load_include('inc', 'islandora', 'includes/derivatives');
$hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object));
$hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object));
$hooks = islandora_filter_derivatives($hooks, array('force' => TRUE), $object);
if (count($hooks) >= 1) {
$regenerate_derivatives_access = TRUE;

8
islandora.module

@ -58,7 +58,11 @@ define('ISLANDORA_DATASTREAM_INGESTED_HOOK', 'islandora_datastream_ingested');
define('ISLANDORA_DATASTREAM_MODIFIED_HOOK', 'islandora_datastream_modified');
define('ISLANDORA_DATASTREAM_PURGED_HOOK', 'islandora_datastream_purged');
define('ISLANDORA_INGEST_STEP_HOOK', 'islandora_ingest_steps');
define('ISLANDORA_DERVIATIVE_CREATION_HOOK', 'islandora_derivative');
define('ISLANDORA_DERIVATIVE_CREATION_HOOK', 'islandora_derivative');
// The "ISLANDORA_DERVIATIVE_CREATION_HOOK" constant has deprecated as of
// 7.x-1.5, and should be removed after the next release.
define('ISLANDORA_DERVIATIVE_CREATION_HOOK', ISLANDORA_DERIVATIVE_CREATION_HOOK);
// Autocomplete paths.
define('ISLANDORA_CONTENT_MODELS_AUTOCOMPLETE', 'islandora/autocomplete/content-models');
@ -1946,7 +1950,7 @@ function islandora_islandora_datastream_access($op, AbstractDatastream $datastre
module_load_include('inc', 'islandora', 'includes/derivatives');
$applicable_hook = FALSE;
$object = $datastream->parent;
$hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object));
$hooks = islandora_invoke_hook_list(ISLANDORA_DERIVATIVE_CREATION_HOOK, $object->models, array($object));
$hooks = islandora_filter_derivatives($hooks, array('force' => TRUE), $object);
foreach ($hooks as $hook) {
if (isset($hook['destination_dsid']) && $hook['destination_dsid'] == $datastream->id &&

Loading…
Cancel
Save