You are here

function piwik_preprocess_search_results in Piwik Web Analytics 6.2

Same name and namespace in other branches
  1. 7.2 piwik.module \piwik_preprocess_search_results()

Implementation of hook_preprocess_search_results().

Collects the number of search results. It need to be noted, that this function is not executed if the search result is empty.

File

./piwik.module, line 325
Drupal Module: Piwik

Code

function piwik_preprocess_search_results(&$variables) {

  // There is no search result $variable available that hold the number of items
  // found. But the pager item mumber can tell the number of search results.
  global $pager_total_items;
  drupal_add_js('window.piwik_search_results = ' . intval($pager_total_items[0]) . ';', 'inline', 'header');
}