Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3338541
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3338541
Commits
ce61c718
Commit
ce61c718
authored
12 years ago
by
Jess
Committed by
Tim Plunkett
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1808756
by xjm: Clarify the documentation for several API hooks.
parent
7f8c6b53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
views.api.php
+26
-22
26 additions, 22 deletions
views.api.php
with
26 additions
and
22 deletions
views.api.php
+
26
−
22
View file @
ce61c718
...
...
@@ -551,8 +551,11 @@ function hook_views_query_alter(ViewExecutable &$view, QueryPluginBase &$query)
}
/**
* Alter the information box that (optionally) appears with a view preview,
* including query and performance statistics.
* Alter the view preview information.
*
* The view preview information is optionally displayed when a view is
* previewed in the administrative UI. It includes query and performance
* statistics.
*
* @param array $rows
* An associative array with two keys:
...
...
@@ -576,19 +579,19 @@ function hook_views_preview_info_alter(array &$rows, ViewExecutable $view) {
}
/**
*
This hooks allows to a
lter the links at the top of the view edit form.
Some
*
modules might want to add links there.
*
*
@param $links
*
An array of links which will be displayed at the top of the view edit form
.
*
Each entry should be on a form suitable for theme('link').
*
@param view $view
*
The full view object which is currently edited.
*
@param $display_id
*
The current display id which is edited. For example that's 'default' or
*
'page_1'.
*
A
lter 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('link')
.
*
@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
(
&
$links
,
$view
,
$display_id
)
{
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
=
array
(
'export'
=>
$links
[
'export'
])
+
$links
;
...
...
@@ -596,15 +599,16 @@ function hook_views_ui_display_top_links_alter(&$links, $view, $display_id) {
}
/**
* This hook allows to alter the commands which are used on a views ajax
* request.
* Alter the commands used on a Views AJAX request.
*
* @param $commands
* An array of ajax commands
* @param
$view
view
* @param
array
$commands
* An array of ajax commands
.
* @param
\Drupal\views\ViewExecutable $
view
* The view which is requested.
*
* @see views_ajax()
*/
function
hook_views_ajax_data_alter
(
&
$commands
,
$view
)
{
function
hook_views_ajax_data_alter
(
array
&
$commands
,
ViewExecutable
$view
)
{
// Replace Views' method for scrolling to the top of the element with your
// custom scrolling method.
foreach
(
$commands
as
&
$command
)
{
...
...
@@ -615,9 +619,9 @@ function hook_views_ajax_data_alter(&$commands, $view) {
}
/**
* Allow modules to respond to the
Views cache being invalidated
.
* Allow modules to respond to the
invalidation of the Views cache
.
*
* This hook
should
fire whenever a view is enabled, disabled, created,
* This hook
will
fire whenever a view is enabled, disabled, created,
* updated, or deleted.
*
* @see views_invalidate_cache()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment