Views' hooks


Functions

 hook_views_data ()
 hook_views_plugins ()
 hook_views_handlers ()
 hook_views_api ()
 hook_views_default_views ()
 hook_views_convert ()
 hook_views_query_substitutions ()
 hook_views_pre_view (&$view, &$display_id, &$args)
 hook_views_pre_build (&$view)
 hook_views_pre_execute (&$view)
 hook_views_pre_render (&$view)
 hook_views_query_alter (&$view, &$query)
 hook_views_admin_links_alter (&$links, $view)
 hook_views_preview_info_alter (&$rows, $view)

Detailed Description

Hooks that can be implemented by other modules in order to implement the Views API.

Function Documentation

hook_views_admin_links_alter ( &$  links,
view 
)

This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. This must either be in the same directory as the .module file or in a subdirectory named 'includes'.

Alter the links that appear over a view. They are in a format suitable for theme('links').

Warning: $view is not a reference in PHP4 and cannot be modified here. But it IS a reference in PHP5, and can be modified. Please be careful with it.

See also:
theme_links

hook_views_api (  ) 

Register View API information. This is required for your module to have its include files loaded.

The full documentation for this hook is in the advanced help.

hook_views_convert (  ) 

Stub hook documentation

This hook should be placed in MODULENAME.views_convert.inc and it will be auto-loaded. This must either be in the same directory as the .module file or in a subdirectory named 'includes'.

hook_views_data (  ) 

Describe table structure to Views.

This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. This must either be in the same directory as the .module file or in a subdirectory named 'includes'.

The full documentation for this hook is in the advanced help. http://views-help.doc.logrus.com/help/views/api-tables

hook_views_default_views (  ) 

This hook allows modules to provide their own views which can either be used as-is or as a "starter" for users to build from.

This hook should be placed in MODULENAME.views_default.inc and it will be auto-loaded. This must either be in the same directory as the .module file or in a subdirectory named 'includes'.

The $view->disabled boolean flag indicates whether the View should be enabled or disabled by default.

Returns:
An associative array containing the structures of views, as generated from the Export tab, keyed by the view name. A best practice is to go through and add t() to all title and label strings, with the exception of menu strings.

hook_views_handlers (  ) 

Register handler, file and parent information so that handlers can be loaded only on request.

The full documentation for this hook is in the advanced help.

hook_views_plugins (  ) 

The full documentation for this hook is now in the advanced help.

This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. This must either be in the same directory as the .module file or in a subdirectory named 'includes'.

This is a stub list as a reminder that this needs to be doc'd and is not used in views anywhere so might not be remembered when this is formally documented:

  • style: 'even empty'

hook_views_pre_build ( &$  view  ) 

This hook is called right before the build process, but after displays are attached and the display performs its pre_execute phase.

Adding output to the view cam be accomplished by placing text on $view->attachment_before and $view->attachment_after

hook_views_pre_execute ( &$  view  ) 

This hook is called right before the execute process. The query is now fully built, but it has not yet been run through db_rewrite_sql.

Adding output to the view cam be accomplished by placing text on $view->attachment_before and $view->attachment_after

hook_views_pre_render ( &$  view  ) 

This hook is called right before the render process. The query has been executed, and the pre_render() phase has already happened for handlers, so all data should be available.

Adding output to the view cam be accomplished by placing text on $view->attachment_before and $view->attachment_after

hook_views_pre_view ( &$  view,
&$  display_id,
&$  args 
)

This hook is called at the very beginning of views processing, before anything is done.

Adding output to the view cam be accomplished by placing text on $view->attachment_before and $view->attachment_after

hook_views_preview_info_alter ( &$  rows,
view 
)

This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. This must either be in the same directory as the .module file or in a subdirectory named 'includes'.

Alter the rows that appear with a view, which includes path and query information. The rows are suitable for theme('table').

Warning: $view is not a reference in PHP4 and cannot be modified here. But it IS a reference in PHP5, and can be modified. Please be careful with it.

See also:
theme_table

hook_views_query_alter ( &$  view,
&$  query 
)

Stub hook documentation

This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. This must either be in the same directory as the .module file or in a subdirectory named 'includes'.

hook_views_query_substitutions (  ) 

Stub hook documentation