diff options
| author | Darkelarious <darkelarious@333networks.com> | 2022-08-26 13:26:33 +0200 |
|---|---|---|
| committer | Darkelarious <darkelarious@333networks.com> | 2022-08-26 13:26:33 +0200 |
| commit | 8ec88b566c5f3edc65f25adc0716c3493689cd08 (patch) | |
| tree | dbbde9a694f6b4052ec39a45f0010955c668da3c /lib/MasterWebInterface/Util/FilterBox.pm | |
| parent | c5f43733533fe9b5708bd065a12c5fac86ccebed (diff) | |
| download | WebInterface-Perl-8ec88b566c5f3edc65f25adc0716c3493689cd08.tar.gz WebInterface-Perl-8ec88b566c5f3edc65f25adc0716c3493689cd08.zip | |
advanced filtering
Diffstat (limited to 'lib/MasterWebInterface/Util/FilterBox.pm')
| -rwxr-xr-x | lib/MasterWebInterface/Util/FilterBox.pm | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/MasterWebInterface/Util/FilterBox.pm b/lib/MasterWebInterface/Util/FilterBox.pm new file mode 100755 index 0000000..8db7a60 --- /dev/null +++ b/lib/MasterWebInterface/Util/FilterBox.pm @@ -0,0 +1,43 @@ +package MasterWebInterface::Util::FilterBox; +use strict; +use warnings; +use utf8; +use TUWF ':html', 'xml_escape'; +use Exporter 'import'; +our @EXPORT = qw| htmlFilterBox |; + +# generates a filter box, arguments: +# title => games/ (game) servers +# action => form action +# sel => g or s selected +# fq => form query string +sub htmlFilterBox +{ + my($self, %opt) = @_; + + div class => 'mainbox'; + div class => "header"; + h1 "Browse Servers"; + p class => "alttitle", "An overview of games titles and servers that are currently online."; + end; + + # filter box + form action => $opt{gamename} ? "/s/$opt{gamename}" : "/s", 'accept-charset' => 'UTF-8', method => 'get'; + fieldset class => 'simple'; + a href => '/g', $opt{sel} eq 'g' ? (class => 'sel') : (), 'Games'; + a href => '/s', $opt{sel} eq 's' ? (class => 'sel') : (), 'Servers'; + input type => 'text', name => 'q', id => 'q', class => 'text', value => $opt{fq} || 'filter...'; + input type => 'submit', class => 'submit', value => 'submit'; + end 'fieldset'; + end; # form + + div class => "simpleadvanced"; + a href => $opt{gamename} ? "/adv/$opt{gamename}" : "/adv"; + txt "advanced server filter "; + lit "\x{25BE}"; + end; + end; + end 'div'; # mainbox +} + +1; |
