From 66190b17877a09be27f8c641bf267b334f9bbdae Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 26 Jan 2004 19:22:22 +0000 Subject: - Patch #5393 by Goba: changes the search hook return value, and requires an array containing two elements, the first being the requested title, and the second being the result list. Advantages: * Cleaner search code in common.inc * Po extraction is possible and works fine * No hardcoded exceptions for node and comment modules, since any module can return results in order of relevance (or another order) --- includes/common.inc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index e7a7ef026..8d6cdcc41 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -664,13 +664,8 @@ function search_data($keys = NULL) { if (isset($keys)) { foreach (module_list() as $name) { if (module_hook($name, "search") && (!$edit["type"] || $edit["type"][$name]) && ($result = module_invoke($name, "search", $keys))) { - if ($name == "node" || $name == "comment") { - $output .= "

". t("Matching %names ranked in order of relevance:", array("%name" => $name)) ."

"; - } - else { - $output .= "

". t("Matching {$name}s") .":

"; - } - foreach ($result as $entry) { + $output .= "

$result[0]

"; + foreach ($result[1] as $entry) { $output .= search_item($entry, $name); } } -- cgit v1.2.3