function overlay_batch_alter
7.x overlay.module | overlay_batch_alter(&$batch) |
Implements hook_batch_alter().
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.
See also
File
- drupal-7.x/
modules/ overlay/ overlay.module, line 274 - Displays the Drupal administration interface in an overlay.
Code
function overlay_batch_alter(&$batch) {
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');
}
}
}