diff options
| author | Darkelarious <darkelarious@333networks.com> | 2017-09-25 23:13:47 +0200 |
|---|---|---|
| committer | Darkelarious <darkelarious@333networks.com> | 2017-09-25 23:13:47 +0200 |
| commit | 18921404e5454cdf202b7b4f70a2777f3e297998 (patch) | |
| tree | d24abef8f510998423cb8f107228e253ee6b4825 /lib/MasterWebInterface/Util/Layout.pm | |
| download | WebInterface-Perl-MS-Perl-18921404e5454cdf202b7b4f70a2777f3e297998.tar.gz WebInterface-Perl-MS-Perl-18921404e5454cdf202b7b4f70a2777f3e297998.zip | |
Web interface for MasterServer-Perl
Diffstat (limited to 'lib/MasterWebInterface/Util/Layout.pm')
| -rwxr-xr-x | lib/MasterWebInterface/Util/Layout.pm | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/MasterWebInterface/Util/Layout.pm b/lib/MasterWebInterface/Util/Layout.pm new file mode 100755 index 0000000..4f62d5e --- /dev/null +++ b/lib/MasterWebInterface/Util/Layout.pm @@ -0,0 +1,60 @@ +package MasterWebInterface::Util::Layout; +use strict; +use warnings; +use TUWF ':html'; +use Exporter 'import'; +our @EXPORT = qw| htmlHeader htmlFooter |; + +################################################################################ +# htmlHeader +# options: title, noindex +################################################################################ +sub htmlHeader { + my($self, %o) = @_; + + html lang => "en"; + head; + title "$o{title} :: $self->{site_title}"; + Link rel => 'shortcut icon', href => "$self->{url}/favicon.ico", type => 'image/x-icon'; + Link rel => 'stylesheet', href => "$self->{url}/style/$self->{style}/style.css", type => "text/css", media => "all"; + meta name => "google-site-verification", content => "tkhIW87EwqNKSGEumMbK-O3vqhwaANWbNxkdLBDGZvI";end; + meta name => 'robots', content => 'noindex,nofollow,nosnippet,noodp,noarchive,noimageindex';end; #FIXME set proper robots params + script type => 'text/javascript', src => "$self->{url}/interface-scripts.js", ''; + end; # head + + body; + div class => 'nav'; + ul; + li; a href => "/", "home"; end; + li; a href => "/g/all", "games"; end; + li; a href => "/s/all", "servers"; end; + end; + end; + + div id => "body"; + # start the page content with a header logo box + div class => "titlebox"; + end; +} + +################################################################################ +# htmlFooter +# options: last edited (not shown) +# General html layout header (bottom) +################################################################################ +sub htmlFooter { + my $self = shift; + br style => "clear:both"; + + div id => 'footer'; + txt "$self->{site_title} | Powered by "; + a href => "http://333networks.com", "333networks"; + txt " & "; + a href => "http://dev.yorhel.nl/tuwf", "TUWF"; + end; + end 'div'; # body + end 'body'; + end 'html'; +} + +1; |
