aboutsummaryrefslogtreecommitdiff
path: root/lib/MasterWebInterface/Util
diff options
context:
space:
mode:
authorDarkelarious <darkelarious@333networks.com>2021-10-02 23:36:23 +0200
committerDarkelarious <darkelarious@333networks.com>2021-10-02 23:36:23 +0200
commitae716da5bb24039df3073c04905a5e1444a19771 (patch)
treeba2a04e6d32604500d832dc4d5a56b5efb5eb105 /lib/MasterWebInterface/Util
parent177aa717db0e1879433d9a964f70b71b83da4aec (diff)
downloadWebInterface-Perl-ae716da5bb24039df3073c04905a5e1444a19771.tar.gz
WebInterface-Perl-ae716da5bb24039df3073c04905a5e1444a19771.zip
serverflag symbols and style rotation
Diffstat (limited to 'lib/MasterWebInterface/Util')
-rwxr-xr-xlib/MasterWebInterface/Util/Layout.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/MasterWebInterface/Util/Layout.pm b/lib/MasterWebInterface/Util/Layout.pm
index 536aad7..20647fa 100755
--- a/lib/MasterWebInterface/Util/Layout.pm
+++ b/lib/MasterWebInterface/Util/Layout.pm
@@ -15,12 +15,24 @@ sub htmlHeader
# CSS override: allow passing of style from GET --> ?style=classic
my $style = $self->{style};
+
+ # rotate styles for different occasions.
+ my @dt = localtime(time);
+ # specify dates [m/d] = styles
+ if ($dt[4] == 2 && $dt[3] == 31) {$style = "april";} # 31 mar and 1 apr
+ if ($dt[4] == 3 && $dt[3] == 1) {$style = "april";}
+ if ($dt[4] == 9 && $dt[3] >= 1) {$style = "halloween";}
+ if ($dt[4] == 11 && $dt[3] >= 7) {$style = "xmas";}
+
if (my $overrideStyle = $self->reqParam("style") )
{
# default to custom style if specified option doesn't exist
- $style = ( -e "$self->{root}/s/style/$overrideStyle" ) ? $overrideStyle : $self->{style};
+ $style = $overrideStyle;
}
+ # default to default style if specified option does not exist
+ $style = ( -e "$self->{root}/s/style/$style" ) ? $style : $self->{style};
+
html lang => "en";
head;
title "$o{title} :: $self->{site_name} masterserver";