$searchable_node_types)); // Build menu. $items = array(); $items[] = l(variable_get('custom_search_type_selector_all', CUSTOM_SEARCH_ALL_TEXT_DEFAULT), 'search/node/' . $keys); foreach ($node_types as $node_type) { // Count # of results per type. $nbresults = 0; foreach ($variables['results'] as $result) { if ($result['node']->type == $node_type->type) { $nbresults++; } } if ($nbresults) { $items[] = l($node_type->name, 'search/node/' . $keys . ' type:' . $node_type->type); } } if (!isset($variables['filter-title'])) { $variables['filter-title'] = filter_xss(variable_get('custom_search_filter_label', CUSTOM_SEARCH_FILTER_LABEL_DEFAULT)); } if (count($items) > 2) { $variables['filter'] = theme('item_list', array('items' => $items, 'title' => $variables['filter-title'])); } } $variables['theme_hook_suggestions'][] = 'custom_search_results'; } } /* * Customisation of the results info. */ 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'; }