summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-20 18:48:05 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-20 18:48:05 +0000
commit7fe1ece946f0bdfbab9770c0e26d4e6cbef63c7a (patch)
tree6ae1165ab3dc5dd3de0714fd531ff91844099d8c /modules
parent1c054e4bed45b54146e93c9ccaeaf38fa777eedb (diff)
downloadbrdo-7fe1ece946f0bdfbab9770c0e26d4e6cbef63c7a.tar.gz
brdo-7fe1ece946f0bdfbab9770c0e26d4e6cbef63c7a.tar.bz2
#717602 by heyrocker, jhodgdon: Document hook_batch_alter().
Diffstat (limited to 'modules')
-rw-r--r--modules/system/system.api.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 49dfec100..4c97cd757 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -3193,6 +3193,34 @@ function hook_token_info() {
}
/**
+ * Alter batch information before a batch is processed.
+ *
+ * Called by batch_process() to allow modules to alter a batch before it is
+ * processed.
+ *
+ * @param $batch
+ * The associative array of batch information. See batch_set() for details on
+ * what this could contain.
+ *
+ * @see batch_set()
+ * @see batch_process()
+ *
+ * @ingroup batch
+ */
+function hook_batch_alter(&$batch) {
+ // If the current page request is inside the overlay, add ?render=overlay to
+ // the success callback URL, so that it appears correctly within the overlay.
+ if (overlay_get_mode() == 'child') {
+ if (isset($batch['url_options']['query'])) {
+ $batch['url_options']['query']['render'] = 'overlay';
+ }
+ else {
+ $batch['url_options']['query'] = array('render' => 'overlay');
+ }
+ }
+}
+
+/**
* Alter the metadata about available placeholder tokens and token types.
*
* @param $data