Skip to content

Commit

Permalink
Issue #3087465 by zuhair_ak, tim.plunkett, Kristen Pol: Move hook_vie…
Browse files Browse the repository at this point in the history
…ws_ui_display_top_links_alter() to views_ui.api.php

(cherry picked from commit 8a8be6cc82da0125748870d3bc7371967e9d4851)
  • Loading branch information
xjm committed May 9, 2020
1 parent af21739 commit 945ae48
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
21 changes: 0 additions & 21 deletions modules/views/views.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -921,27 +921,6 @@ function hook_views_preview_info_alter(array &$rows, ViewExecutable $view) {
];
}

/**
* Alter the links displayed at the top of the view edit form.
*
* @param array $links
* A renderable array of links which will be displayed at the top of the
* view edit form. Each entry will be in a form suitable for
* '#theme' => 'links'.
* @param \Drupal\views\ViewExecutable $view
* The view object being edited.
* @param string $display_id
* The ID of the display being edited, e.g. 'default' or 'page_1'.
*
* @see \Drupal\views_ui\ViewUI::renderDisplayTop()
*/
function hook_views_ui_display_top_links_alter(array &$links, ViewExecutable $view, $display_id) {
// Put the export link first in the list.
if (isset($links['export'])) {
$links = ['export' => $links['export']] + $links;
}
}

// @todo Describe how to alter a view ajax response with event listeners.

/**
Expand Down
21 changes: 21 additions & 0 deletions modules/views_ui/views_ui.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ function hook_views_ui_display_tab_alter(&$build, \Drupal\views_ui\ViewUI $view,
$build['custom']['#markup'] = 'This text should always appear';
}

/**
* Alter the links displayed at the top of the view edit form.
*
* @param array $links
* A renderable array of links which will be displayed at the top of the
* view edit form. Each entry will be in a form suitable for
* '#theme' => 'links'.
* @param \Drupal\views\ViewExecutable $view
* The view object being edited.
* @param string $display_id
* The ID of the display being edited, e.g. 'default' or 'page_1'.
*
* @see \Drupal\views_ui\ViewUI::renderDisplayTop()
*/
function hook_views_ui_display_top_links_alter(array &$links, ViewExecutable $view, $display_id) {
// Put the export link first in the list.
if (isset($links['export'])) {
$links = ['export' => $links['export']] + $links;
}
}

/**
* @} End of "addtogroup hooks".
*/

0 comments on commit 945ae48

Please sign in to comment.