function 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()

1 call to overlay_trigger_refresh()

File

drupal/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']);
  }
}