Browse Source

global defer derivatives setting

pull/537/head
willtp87 10 years ago
parent
commit
3850720e65
  1. 7
      includes/admin.form.inc
  2. 1
      islandora.install
  3. 11
      islandora.module

7
includes/admin.form.inc

@ -61,6 +61,13 @@ function islandora_repository_admin(array $form, array &$form_state) {
'#description' => t('HTTP caching can reduce network traffic, by allowing clients to used cached copies.'),
'#default_value' => variable_get('islandora_use_datastream_cache_headers', TRUE),
),
'islandora_defer_derivataves_on_ingest' => array(
'#type' => 'checkbox',
'#title' => t('Defer derivative generation during ingest'),
'#description' => t('Prevent derivatives from running during ingest,
useful if derivatives are to be created by an external service.'),
'#default_value' => variable_get('islandora_defer_derivataves_on_ingest', FALSE),
),
),
'islandora_namespace' => array(
'#type' => 'fieldset',

1
islandora.install

@ -46,6 +46,7 @@ function islandora_uninstall() {
// Add new variables to clean up.
$variables = array(
'islandora_ds_replace_exclude_enforced',
'islandora_defer_derivataves_on_ingest',
);
array_walk($variables, 'variable_del');
}

11
islandora.module

@ -1962,3 +1962,14 @@ function islandora_menu_local_tasks_alter(&$data, $router_item, $root_path) {
}
}
}
/**
* Implements hook_islandora_object_alter().
*/
function islandora_islandora_object_alter(AbstractObject $object, array &$context) {
// Prevent derivative creation during ingest if var is set.
if ($context['action'] == 'ingest' && variable_get('islandora_defer_derivataves_on_ingest', FALSE)) {
module_load_include('inc', 'islandora', 'includes/derivatives');
islandora_set_defer_derivatives_flag($object);
}
}

Loading…
Cancel
Save