Browse Source

Merge pull request #415 from ajstanley/7.x

Adds file context for do_function and undo_function
pull/416/head
Jordan Dukart 11 years ago
parent
commit
78bda27947
  1. 6
      includes/ingest.form.inc
  2. 6
      islandora.api.php

6
includes/ingest.form.inc

@ -422,6 +422,9 @@ function islandora_ingest_form_execute_consecutive_callback_steps(array $form, a
function islandora_ingest_form_execute_callback_step(array $form, array &$form_state, array $step) {
$args = array(&$form_state);
$args = isset($step['do_function']['args']) ? array_merge($args, $step['do_function']['args']) : $args;
if (isset($step['do_function']['file'])) {
require_once drupal_get_path('module', $step['module']) . "/" . $step['do_function']['file'];
}
call_user_func_array($step['do_function']['function'], $args);
}
@ -460,6 +463,9 @@ function islandora_ingest_form_undo_consecutive_callback_steps(array $form, arra
function islandora_ingest_form_undo_callback_step(array $form, array &$form_state, array $step) {
$args = array(&$form_state);
$args = isset($step['undo_function']['args']) ? array_merge($args, $step['undo_function']['args']) : $args;
if (isset($step['undo_function']['file'])) {
require_once drupal_get_path('module', $step['module']) . "/" . $step['undo_function']['file'];
}
call_user_func_array($step['undo_function']['function'], $args);
}

6
islandora.api.php

@ -427,17 +427,21 @@ function hook_islandora_undeletable_datastreams(array $models) {
* - do_function: An associate array including:
* - 'function': The callback function to be called.
* - 'args': An array of arguments to pass to the callback function.
* - 'file': A file to include (relative to the module's path, including
* the file's extension).
* - undo_function: An associate array including:
* - 'function': The callback function to be called to reverse the
* executed action in the ingest steps.
* - 'args': An array of arguments to pass to the callback function.
* - 'file': A file to include (relative to the module's path, including
* the file's extension).
* Shared parameters between both types:
* - weight: The "weight" of this step--heavier(/"larger") values sink to the
* end of the process while smaller(/"lighter") values are executed first.
* Both types may optionally include:
* - module: A module from which we want to load an include.
* "Form" type may optionally include:
* - file: A file to include (relative to the module's path, including the
* - 'file': A file to include (relative to the module's path, including the
* file's extension).
*/
function hook_islandora_ingest_steps(array $form_state) {

Loading…
Cancel
Save