You are here

function overlay_page_alter in Drupal 7

Implements hook_page_alter().

File

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

Code

function overlay_page_alter(&$page) {

  // If we are limiting rendering to a subset of page regions, deny access to
  // all other regions so that they will not be processed.
  if ($regions_to_render = overlay_get_regions_to_render()) {
    $skipped_regions = array_diff(element_children($page), $regions_to_render);
    foreach ($skipped_regions as $skipped_region) {
      $page[$skipped_region]['#access'] = FALSE;
    }
  }
  $mode = overlay_get_mode();
  if ($mode == 'child') {

    // Add the overlay wrapper before the html wrapper.
    array_unshift($page['#theme_wrappers'], 'overlay');
  }
  elseif ($mode == 'parent' && ($message = overlay_disable_message())) {
    $page['page_top']['disable_overlay'] = $message;
  }
}