search "performance“ message for user with link to pricing page

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy
2013-02-14 20:00:16 +01:00
parent 0db5022c47
commit 108f77c73d
2 changed files with 47 additions and 14 deletions

View File

@@ -546,12 +546,33 @@ function template_preprocess_materio_search_api_results(array &$variables) {
// $variables['items'] = $variables['index']->loadItems(array_keys($variables['results']['results']));
$variables['result_count'] = $results['result count'];
$variables['sec'] = round($results['performance']['complete'], 3);
$variables['search_performance'] = format_plural(
$results['result count'],
'The search found 1 result.', // in @sec seconds
'The search found @count results.', // in @sec seconds
array('@sec' => $variables['sec'])
);
if(isset($results['breves count'])){
$variables['search_performance'] = format_plural(
$results['breves count'],
'The search found 1 news ',
'The search found @count news '
);
$variables['search_performance'] .= format_plural(
$variables['result_count'] - $results['breves count'],
'and 1 associated matter.',
'and @count associated matters.'
);
$variables['search_performance'] .= format_plural(
$results['could results']['result count'],
' You could find 1 result with a ',
' You could find @count results with a '
);
$variables['search_performance'] .= l(t('full access to materiO\'.'), 'node/11187');
}else{
$variables['search_performance'] = format_plural(
// $results['result count'],
$variables['result_count'],
'The search found 1 result.',
'The search found @count results.'
);
}
//dsm($variables, 'variables');
}