major => 1,
);
-if ($ENV{PATH_INFO} and $ENV{PATH_INFO} eq '/2') {
+if ($Request and $Request eq '2') {
%scver = (
id => 'hots',
name => 'Heart of the Swarm',
say "<p>Unit properties as seen or measured in $scver{name}\n$patch.";
say "Also see the $_ table." for join(', ',
- ('<a href="/sc/2">StarCraft 2: HotS</a>') x ($scver{major} < 2),
- ('<a href="/sc">original SC: Brood War</a>') x ($scver{major} > 1),
+ (showlink('StarCraft 2: HotS', '/sc/2')) x ($scver{major} < 2),
+ (showlink('original SC: Brood War', '/sc')) x ($scver{major} > 1),
);
say "</p>\n";
sub coltoggle {
my ($name, $id, $nolink) = @_;
- return sprintf(
- (defined $get{order} ? $get{order} eq $id : !$id) ? '%2$s ▼'
- : $nolink ? '%2$s' : '<a href="?%s">%s</a>',
- $id && "order=$id", $name
- );
+ return "$name ▼" if defined $get{order} ? $get{order} eq $id : !$id;
+ return $name if $nolink;
+ return showlink($name, '?'.($id && "order=$id"));
}
:><table class="units">
<thead><tr>