You are here

function template_preprocess_google_appliance_spelling_suggestion in Google Search Appliance 7

Preprocess a spelling suggestion.

File

theme/google_appliance.theme.inc, line 322
theme registry and preprocess functions for the default templates

Code

function template_preprocess_google_appliance_spelling_suggestion(&$vars) {
  $menu_item = menu_get_item();

  // Pop the existing search query to get the base path for the search results.
  array_pop($menu_item['original_map']);
  $search_base = implode('/', $menu_item['original_map']);
  $query_plain = filter_xss($vars['spelling_suggestion'], array());
  $link = l($vars['spelling_suggestion'], $search_base . '/' . $query_plain, array(
    'html' => TRUE,
  ));
  $vars['spelling_suggestion'] = t('Did you mean !linked_suggestion?', array(
    '!linked_suggestion' => $link,
  ));

  // Render template.
}