summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping.pm
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2008-02-22 18:15:01 +0100
committerTobi Oetiker <tobi@oetiker.ch>2008-02-22 18:15:01 +0100
commit0c1233317fb699e800d109160a11ff79b3d07dfc (patch)
treee0b49f723c083eb19ce783382f7f29693e7f6690 /lib/Smokeping.pm
parent3e576f158fc4a0dda23a872d9ef8d69dfad7c8e2 (diff)
downloadsmokeping-0c1233317fb699e800d109160a11ff79b3d07dfc.tar.gz
smokeping-0c1233317fb699e800d109160a11ff79b3d07dfc.tar.xz
fixed ordering overview vs menu
Diffstat (limited to 'lib/Smokeping.pm')
-rw-r--r--lib/Smokeping.pm11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index f582263..11b896c 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -600,15 +600,10 @@ sub target_menu($$$$;$){
my $print;
my $current = shift @{$open} || "";
my @hashes;
- if (not defined $tree->{_order}){
- foreach my $prop ( sort grep { ref $tree->{$_} eq 'HASH' and not /^__/} keys %{$tree}) {
- push @hashes, $prop;
- }
- } else {
- foreach my $prop (sort { $tree->{$a}{_order} <=> $tree->{$b}{_order}}
- grep { ref $tree->{$_} eq 'HASH' } keys %{$tree}) {
+ foreach my $prop (sort {$tree->{$a}{_order} ? ($tree->{$a}{_order} <=> $tree->{$b}{_order}) : ($a cmp $b)}
+ grep { ref $tree->{$_} eq 'HASH' and not /^__/ }
+ keys %$tree) {
push @hashes, $prop;
- }
}
return wantarray ? () : "" unless @hashes;