function views_ui_contextual_links_view_alter in Views (for Drupal 7) 7.3
Same name and namespace in other branches
- 8.3 views_ui/views_ui.module \views_ui_contextual_links_view_alter()
Implements hook_contextual_links_view_alter().
File
- ./
views_ui.module, line 729 - 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();
}
elseif (!empty($element['#links']['views-ui-edit']) && !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-edit']['href'] .= '/' . $display_id;
}
}