You are here

function views_contextual_links_view_alter in Views (for Drupal 7) 8.3

Same name and namespace in other branches
  1. 7.3 views.module \views_contextual_links_view_alter()

Implements hook_contextual_links_view_alter().

File

./views.module, line 690
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_contextual_links_view_alter(&$element, $items) {

  // If we are rendering views-related contextual links attached to the overall
  // page array, add a class to the list of contextual links. This will be used
  // by the JavaScript added in views_preprocess_html().
  if (!empty($element['#element']['#views_contextual_links_info']) && !empty($element['#element']['#type']) && $element['#element']['#type'] == 'page') {
    $element['#attributes']['class'][] = 'views-contextual-links-page';
  }
}