search "performance“ message for user with link to pricing page
Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user