1 views_ui.module views_ui_contextual_links_view_alter(&$element, $items)

Implements hook_contextual_links_view_alter().

File

core/modules/views_ui/views_ui.module, line 810
Provide structure for the administrative interface to Views.

Code

function views_ui_contextual_links_view_alter(&$element, $items) {
  // Remove contextual links from being rendered, when so desired, such as
  // within a View preview.
  if (views_ui_contextual_links_suppress()) {
    $element['#links'] = array();
  }
  // Append the display ID to the Views UI configure links, so that clicking on
  // the contextual link takes you directly to the correct display tab on the
  // configure screen.
  elseif (!empty($element['#links']['views-ui-configure']) && !empty($element['#element']['#views_contextual_links_info']['views_ui']['view_display_id'])) {
    $display_id = $element['#element']['#views_contextual_links_info']['views_ui']['view_display_id'];
    $element['#links']['views-ui-configure']['href'] .= '/' . $display_id;
  }
}