search.php 758 Bytes
Newer Older
Dries's avatar
   
Dries committed
1
<?php
Dries's avatar
Dries committed
2

Dries's avatar
   
Dries committed
3
include_once "includes/common.inc";
Dries's avatar
Dries committed
4

Dries's avatar
   
Dries committed
5
6
page_header();

Dries's avatar
   
Dries committed
7
function find_module($name) {
Dries's avatar
   
Dries committed
8
  global $options, $type;
Dries's avatar
   
Dries committed
9
  if (module_hook($name, "search")) $options .= "<OPTION VALUE=\"$name\"". ($name == $type ? " SELECTED" : "") .">$name</OPTION>\n";
Dries's avatar
   
Dries committed
10
}
Dries's avatar
Dries committed
11

Dries's avatar
   
Dries committed
12
module_iterate("find_module");
Dries's avatar
   
Dries committed
13

Dries's avatar
   
Dries committed
14
$search .= "<FORM ACTION=\"search.php\" METHOD=\"POST\">\n";
Dries's avatar
CHANGES    
Dries committed
15
$search .= " <INPUT SIZE=\"50\" VALUE=\"". check_form($keys) ."\" NAME=\"keys\" TYPE=\"text\">\n";
Dries's avatar
   
Dries committed
16
$search .= " <SELECT NAME=\"type\">$options</SELECT>\n";
Dries's avatar
   
Dries committed
17
$search .= " <INPUT TYPE=\"submit\" VALUE=\"". t("Search") ."\">\n";
Dries's avatar
   
Dries committed
18
$search .= "</FORM>\n";
Dries's avatar
   
Dries committed
19

Dries's avatar
   
Dries committed
20
$output = search_data($keys, $type);
Dries's avatar
   
Dries committed
21

Dries's avatar
   
Dries committed
22
$theme->header();
Dries's avatar
   
Dries committed
23
24
$theme->box(t("Search"), $search);
$theme->box(t("Result"), $output);
Dries's avatar
   
Dries committed
25
$theme->footer();
Dries's avatar
   
Dries committed
26

Dries's avatar
   
Dries committed
27
28
page_footer();

Dries's avatar
   
Dries committed
29
?>