Alter batch information before a batch is processed.
Called by batch_process() to allow modules to alter a batch before it is processed.
$batch: The associative array of batch information. See batch_set() for details on what this could contain.
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
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',
);
}
}
}