You are here

function custom_search_preprocess_search_result in Custom Search 7

Same name and namespace in other branches
  1. 8 custom_search.pages.inc \custom_search_preprocess_search_result()
  2. 6 theme/custom_search.pages.inc \custom_search_preprocess_search_result()

File

theme/custom_search.pages.inc, line 63
User page callbacks for the custom_search module.

Code

function custom_search_preprocess_search_result(&$variables) {
  $infos = array();

  // In Drupal 7 the content type is no longer in the info array.
  if (variable_get('custom_search_results_info_type', TRUE) && $variables['module'] == 'node') {
    $infos[] = $variables['result']['type'];
  }
  if (isset($variables['info_split'])) {
    foreach ($variables['info_split'] as $key => $info) {
      if (variable_get('custom_search_results_info_' . $key, TRUE)) {
        array_push($infos, $info);
      }
    }
  }
  $variables['info'] = implode(' - ', $infos);
  $variables['theme_hook_suggestions'][] = 'custom_search_result';
}