function template_preprocess_overlay_disable_message

Prepares variables for overlay disable message templates.

Default template: overlay-disable-message.html.twig.

Parameters

array $variables: An associative array with an 'element' element, which itself is an associative array containing:

  • profile_link: The link to this user's account.
  • dismiss_message_link: The link to dismiss the overlay.

File

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

Code

function template_preprocess_overlay_disable_message(&$variables) {
  $element = $variables['element'];

  // Add CSS classes to hide the links from most sighted users, while keeping
  // them accessible to screen-reader users and keyboard-only users. To assist
  // screen-reader users, this message appears in both the parent and child
  // documents, but only the one in the child document is part of the tab order.
  foreach (array(
    'profile_link',
    'dismiss_message_link',
  ) as $key) {
    $element[$key]['#options']['attributes']['class'][] = 'element-invisible';
    if (overlay_get_mode() == 'child') {
      $element[$key]['#options']['attributes']['class'][] = 'element-focusable';
    }
  }
  $variables['profile_link'] = $element['profile_link'];
  $variables['dismiss_link'] = $element['dismiss_message_link'];
}