2 # Search Webmin modules and help pages and text and config.info
4 $trust_unknown_referers = 1;
5 BEGIN { push(@INC, ".."); };
9 do 'webmin-search-lib.pl';
12 $prod = &get_product_name();
13 $ucprod = ucfirst($prod);
14 &ui_print_unbuffered_header(
15 undef, &text('wsearch_title', $ucprod), "", undef, 0, 1);
17 # Validate search text
20 &error($text{'wsearch_esearch'});
26 print &text('wsearch_searching', "<i>".&html_escape($re)."</i>"),"\n";
27 @rv = &search_webmin($re, \&print_search_dot,
28 $in{'mod'} ? [ split(/\0/, $in{'mod'}) ] : undef);
29 print &text('wsearch_found', scalar(@rv)),"<p>\n";
33 print &ui_columns_start(
34 [ $text{'wsearch_htext'}, $text{'wsearch_htype'},
35 $text{'wsearch_hmod'}, $text{'wsearch_hcgis'} ], 100);
37 $hi = &highlight_text($r->{'text'});
39 $hi = "<a href='$r->{'link'}'>$hi</a>";
42 foreach my $c (@{$r->{'cgis'}}) {
43 ($cmod, $cpage) = split(/\//, $c);
44 ($cpage, $cargs) = split(/\?/, $cpage);
45 $ctitle = &cgi_page_title($cmod, $cpage) || $cpage;
46 if ($r->{'mod'}->{'installed'}) {
47 $cargs ||= &cgi_page_args($cmod, $cpage);
50 # For modules that aren't installed, linking
51 # to a CGI is likely useless
54 if ($cargs eq "none") {
55 push(@links, $ctitle);
58 $cargs = "?".$cargs if ($cargs ne '' &&
59 $cargs !~ /^(\/|%2F)/);
61 "<a href='$cmod/$cpage$cargs'>$ctitle</a>");
65 @links = ( @links[0..1], "..." );
67 print &ui_columns_row([
69 $text{'wsearch_type_'.$r->{'type'}},
70 "<a href='$r->{'mod'}->{'dir'}/'>$r->{'mod'}->{'desc'}</a>",
71 &ui_links_row(\@links),
74 print &ui_columns_end();
77 print "<b>",&text('wsearch_enone',
78 "<tt>".&html_escape($re)."</tt>"),"</b><p>\n";
84 # Print one dot per second
88 if ($now > $last_print_search_dot) {
90 $last_print_search_dot = $now;