3 # Display the manual pages search form
5 require './man-lib.pl';
6 &ui_print_header(undef, $text{'index_title'}, "", "intro", $module_info{'usermin'} ? 0 : 1, 1);
8 # build list of available search options
9 @search = ( "man", "help" );
10 foreach $d (split(/\s+/, $config{'doc_dir'})) {
16 foreach $h (split(/\s+/, $config{'howto_dir'})) {
18 push(@search, "howto");
22 if (-d $config{'kde_dir'}) {
25 if (-d $config{'kernel_dir'}) {
26 push(@search, "kernel");
29 push(@search, "perl");
31 if (-d $config{'custom_dir'}) {
32 push(@search, "custom");
34 push(@search, "google");
36 # display the search form
37 print &ui_form_start("search.cgi");
38 print &ui_table_start($text{'index_header'}, undef, 2);
40 # Search box and boolean mode
41 print &ui_table_row($text{'index_for'},
42 &ui_textbox("for", undef, 50)."<br>".
43 &ui_radio("and", 1, [ [ 1, $text{'index_and'} ],
44 [ 0, $text{'index_or'} ] ]));
47 print &ui_table_row($text{'index_type'},
48 &ui_radio("exact", 1, [ [ 1, $text{'index_name'} ],
49 [ 0, $text{'index_data'} ] ]));
53 foreach $s (@search) {
54 $txt = $text{"index_${s}"};
55 $txt = $config{'custom_desc'}
56 if ($s eq "custom" && $config{'custom_desc'});
57 $sects .= &ui_checkbox("section", $s, $txt, $s eq 'man')."<br>\n";
59 print &ui_table_row($text{'index_where'}, $sects);
61 print &ui_table_end();
62 print &ui_form_end([ [ undef, $text{'index_search'} ] ]);
64 # Form to control search from other modules
65 if (!$module_info{'usermin'}) {
66 @check = $config{'check'} ? split(/\s+/, $config{'check'}) : @search;
68 print &ui_form_start("save_check.cgi");
69 print &ui_hidden("count", scalar(@search));
70 print "<b>$text{'index_others'}</b><br>\n";
72 foreach $s (@search) {
73 push(@grid, &ui_checkbox("check", $s, $text{"index_other_${s}"},
74 &indexof($s, @check) >= 0));
76 print &ui_grid_table(\@grid, 3);
77 print &ui_form_end([ [ undef, $text{'save'} ] ]);
80 &ui_print_footer("/", $text{'index'});