function overlay_overlay_parent_initialize

Implements hook_overlay_parent_initialize().

File

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

Code

function overlay_overlay_parent_initialize() {

  // Let the client side know which paths are administrative.
  $paths = path_get_admin_paths();
  foreach ($paths as &$type) {
    $type = str_replace('<front>', config('system.site')
      ->get('page.front'), $type);
  }
  drupal_add_js(array(
    'overlay' => array(
      'paths' => $paths,
    ),
  ), 'setting');
  $path_prefixes = array();
  if (module_exists('language')) {
    language_negotiation_include();
    if (config('language.negotiation')
      ->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) {

      // Skip the empty string indicating the default language. We always accept
      // paths without a prefix.
      $path_prefixes = language_negotiation_url_prefixes();
      $path_prefixes = array_values(array_filter($path_prefixes));
    }
  }
  drupal_add_js(array(
    'overlay' => array(
      'pathPrefixes' => $path_prefixes,
    ),
  ), 'setting');

  // Pass along the Ajax callback for rerendering sections of the parent window.
  drupal_add_js(array(
    'overlay' => array(
      'ajaxCallback' => 'overlay-ajax',
    ),
  ), 'setting');
}