You are here

function overlay_batch_alter in Drupal 7

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

overlay_get_mode()

File

modules/overlay/overlay.module, line 288
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',
      );
    }
  }
}