function overlay_trigger_refresh

overlay_trigger_refresh()

Checks if the parent window needs to be refreshed on this page load.

If the previous page load requested that any page regions be refreshed, or if it requested that the entire page be refreshed when the overlay closes, pass that request via JavaScript to the child window, so it can in turn pass the request to the parent window.

See also

overlay_request_refresh()

overlay_request_page_refresh()

Drupal.overlay.refreshRegions()

File

modules/overlay/overlay.module, line 996
Displays the Drupal administration interface in an overlay.

Code

function overlay_trigger_refresh() {
  if (!empty($_SESSION['overlay_regions_to_refresh'])) {
    $settings = array(
      'overlayChild' => array(
        'refreshRegions' => $_SESSION['overlay_regions_to_refresh'],
      ),
    );
    drupal_add_js($settings, array('type' => 'setting'));
    unset($_SESSION['overlay_regions_to_refresh']);
  }
  if (!empty($_SESSION['overlay_refresh_parent'])) {
    drupal_add_js(array('overlayChild' => array('refreshPage' => TRUE)), array('type' => 'setting'));
    unset($_SESSION['overlay_refresh_parent']);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!overlay!overlay.module/function/overlay_trigger_refresh/7.x