function views_ui_contextual_links_view_alter
views_ui_contextual_links_view_alter(&$element, $items)
Implements hook_contextual_links_view_alter().
File
- core/modules/views_ui/views_ui.module, line 231
- 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 edit links, so that clicking on the // contextual link takes you directly to the correct display tab on the edit // screen. elseif (!empty($element['#links']['entityviewedit-form'])) { $display_id = $items['entity.view.edit_form']['metadata']['display_id']; $route_parameters = $element['#links']['entityviewedit-form']['url']->getRouteParameters() + ['display_id' => $display_id]; $element['#links']['entityviewedit-form']['url'] = Url::fromRoute('entity.view.edit_display_form', $route_parameters); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!views_ui!views_ui.module/function/views_ui_contextual_links_view_alter/8.1.x