sub linktext ($%) {
# Return the text of the link to a tag, depending on option linktext.
my ($page, %params) = @_;
- if (exists $params{disp} &&
- exists $pagestate{$page} &&
- exists $pagestate{$page}{meta}{$params{disp}}) {
- return $pagestate{$page}{meta}{$params{disp}};
- }
- else {
- return undef;
- }
+ if (exists $params{show} &&
+ exists $pagestate{$page} &&
+ exists $pagestate{$page}{meta}{$params{show}}) {
+ return $pagestate{$page}{meta}{$params{show}};
+ }
+ else {
+ return undef;
+ }
}
sub preprocess (@) {
if (exists $params{limit}) {
my $i=0;
my %show;
- foreach my $key (sort { $counts{$b} <=> $counts{$a} } keys %counts) {
+ foreach my $key (sort { $counts{$b} <=> $counts{$a} || $a cmp $b } keys %counts) {
last if ++$i > $params{limit};
$show{$key}=$counts{$key};
}
htmllink($params{page}, $params{destpage}, $_, noimageinline => 1, linktext => linktext($_, %params)).
"</td><td>".$counts{$_}."</td></tr>"
}
- sort { $counts{$b} <=> $counts{$a} } keys %counts).
+ sort { $counts{$b} <=> $counts{$a} || $a cmp $b } keys %counts).
"\n</table>\n" ;
}
else {