latin: common tool to dump static perl include
[sheet.git] / sc.plp
diff --git a/sc.plp b/sc.plp
index b5d81ecd47684c90a7bdd64932ebd355e6e4fef9..3437f8f4aca51ce2da337d4f36f10682a47a93ab 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -49,8 +49,8 @@ my $patch = shift @{$units}
 
 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";
 
@@ -85,11 +85,9 @@ for my $unit (@{$units}) {
 
 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>