function views_ui_contextual_links_view_alter

Implements hook_contextual_links_view_alter().

File

./views_ui.module, line 730

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;
    }
}