Full ELMS Learning Network documentation
function hook_views_preview_info_alter
×
Error message
User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).cis7 views.api.php | hook_views_preview_info_alter(&$rows, $view) |
cle7 views.api.php | hook_views_preview_info_alter(&$rows, $view) |
elmsmedia7 views.api.php | hook_views_preview_info_alter(&$rows, $view) |
icor7 views.api.php | hook_views_preview_info_alter(&$rows, $view) |
meedjum_blog7 views.api.php | hook_views_preview_info_alter(&$rows, $view) |
mooc7 views.api.php | hook_views_preview_info_alter(&$rows, $view) |
Alter the information box that (optionally) appears with a view preview, including query and performance statistics.
This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. MODULENAME.views.inc must be in the directory specified by the 'path' key returned by MODULENAME_views_api(), or the same directory as the .module file, if 'path' is unspecified.
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.
Parameters
$rows: An associative array with two keys:
- query: An array of rows suitable for theme('table'), containing information about the query and the display title and path.
- statistics: An array of rows suitable for theme('table'), containing performance statistics.
$view: The view object.
See also
Related topics
1 invocation of hook_views_preview_info_alter()
- views_ui_preview in sites/
all/ modules/ ulmus/ views/ includes/ admin.inc - Returns the results of the live preview.
File
- sites/
all/ modules/ ulmus/ views/ views.api.php, line 1040 - Describe hooks provided by the Views module.
Code
function hook_views_preview_info_alter(&$rows, $view) {
// Adds information about the tables being queried by the view to the query
// part of the info box.
$rows['query'][] = array(
t('<strong>Table queue</strong>'),
count($view->query->table_queue) . ': (' . implode(', ', array_keys($view->query->table_queue)) . ')',
);
}