Commit e381f5b3 authored by Dries's avatar Dries

- Removed the default "Your search yielded no results." message as
  suggested by Kristjan.
parent 9f2eec07
......@@ -4,24 +4,35 @@
page_header();
function find_module($name) {
global $options, $type;
if (module_hook($name, "search")) $options .= "<OPTION VALUE=\"$name\"". ($name == $type ? " SELECTED" : "") .">$name</OPTION>\n";
// verify input:
$type = check_input($type);
$keys = check_input($keys);
// build options list:
foreach (module_list() as $name) {
if (module_hook($name, "search")) {
$options .= "<OPTION VALUE=\"$name\"". ($name == $type ? " SELECTED" : "") .">$name</OPTION>\n";
}
}
module_iterate("find_module");
// build form:
$form .= "<FORM ACTION=\"search.php\" METHOD=\"POST\">\n";
$form .= " <INPUT SIZE=\"50\" VALUE=\"". check_form($keys) ."\" NAME=\"keys\" TYPE=\"text\">\n";
$form .= " <SELECT NAME=\"type\">$options</SELECT>\n";
$form .= " <INPUT TYPE=\"submit\" VALUE=\"". t("Search") ."\">\n";
$form .= "</FORM>\n";
$search .= "<FORM ACTION=\"search.php\" METHOD=\"POST\">\n";
$search .= " <INPUT SIZE=\"50\" VALUE=\"". check_form($keys) ."\" NAME=\"keys\" TYPE=\"text\">\n";
$search .= " <SELECT NAME=\"type\">$options</SELECT>\n";
$search .= " <INPUT TYPE=\"submit\" VALUE=\"". t("Search") ."\">\n";
$search .= "</FORM>\n";
// visualize form:
$theme->header();
$output = search_data($keys, $type);
if ($form) {
$theme->box(t("Search"), $form);
}
if ($keys) {
$theme->box(t("Result"), search_data($keys, $type));
}
$theme->header();
$theme->box(t("Search"), $search);
$theme->box(t("Result"), $output);
$theme->footer();
page_footer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment