From d8e9eefa9be62b7de7a3f74e28cfd7ca84cbbf97 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 27 Dec 2001 15:27:44 +0000 Subject: - Merged 3 tiny include files into "common.inc". --- includes/search.inc | 87 ----------------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 includes/search.inc (limited to 'includes/search.inc') diff --git a/includes/search.inc b/includes/search.inc deleted file mode 100644 index a4d3355f6..000000000 --- a/includes/search.inc +++ /dev/null @@ -1,87 +0,0 @@ -". $item["title"] ."
"; - $output .= " $type ". ($item["user"] ? " - ". $item["user"] : "") ."". ($item["date"] ? " - ". format_date($item["date"], "small") : "") .""; - $output .= "

"; - - return $output; -} - -/* -** Render a generic search form: -*/ - -function search_form($action = 0, $query = 0, $options = 0) { - global $keys; - - if (!$action) { - $action = "module.php?mod=search"; - } - - if (!$query) { - $query = $keys; - } - - $output .= " "; - $output .= " \n"; - - if ($options != 0) { - $output .= "
"; - $output .= t("Restrict search to") .": "; - - foreach (module_list() as $name) { - if (module_hook($name, "search")) { - $output .= " ". t($name); - } - } - } - - return form($output, "post", $action); -} - -/* -** Collect the search results: -*/ - -function search_data() { - global $keys, $edit; - - $keys = check_input($keys); - - if ($keys) { - foreach (module_list() as $name) { - if (module_hook($name, "search") && (!$edit["type"] || $edit["type"][$name]) && ($result = module_invoke($name, "search", check_query($keys)))) { - foreach ($result as $entry) { - $output .= search_item($entry, $name); - } - } - } - if(!$output) { - $output .= t("Your search yielded no results."); - } - } - - return $output; -} - -/* -** Display the search form and the resulting data: -*/ - -function search_type($type = 0, $action = 0, $query = 0, $options = 0) { - global $edit; - - if ($type) { - $edit["type"][$type] = "on"; - } - - return search_form($action, $query, $options) . search_data(); -} - -?> -- cgit v1.2.3