function overlay_close_dialog

Immediately returns HTML to to the browser and closes the overlay.

@todo This function should only request that the overlay close when the page is displayed (as it did in Drupal 7), not immediately end the request.

Parameters

$redirect: (optional) The path that should open in the parent window after the overlay closes. If not set, no redirect will be performed on the parent window.

$redirect_options: (optional) An associative array of options to use when generating the redirect URL.

Return value

\Symfony\Component\HttpFoundation\Response A Response object.

1 call to overlay_close_dialog()
OverlaySubscriber::onRequest in drupal/core/modules/overlay/lib/Drupal/overlay/EventSubscriber/OverlaySubscriber.php
Performs check on the beginning of a request.
1 string reference to 'overlay_close_dialog'
OverlaySubscriber::onRequest in drupal/core/modules/overlay/lib/Drupal/overlay/EventSubscriber/OverlaySubscriber.php
Performs check on the beginning of a request.

File

drupal/core/modules/overlay/overlay.module, line 648
Displays the Drupal administration interface in an overlay.

Code

function overlay_close_dialog($redirect = NULL, $redirect_options = array()) {
  $settings = array(
    'overlayChild' => array(
      'closeOverlay' => TRUE,
    ),
  );

  // Tell the child window to perform the redirection when requested to.
  if (isset($redirect)) {
    $settings['overlayChild']['redirect'] = url($redirect, $redirect_options);
  }
  drupal_add_js($settings, array(
    'type' => 'setting',
  ));

  // Since we are closing the overlay as soon as the page is displayed, we do
  // not want to show any of the page's actual content.
  return overlay_deliver_empty_page();
}