diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Smokeping.pm | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 63d2905..7d205bf 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -660,14 +660,6 @@ sub target_menu($$$$;$){ $class = 'menuactive'; } }; - if ($menuextra){ - $menuextra =~ s/{HOST}/#$host/g; - $menuextra =~ s/{CLASS}/$class/g; - $menuextra = ' '.$menuextra; - } else { - $menuextra = ''; - } - if ($filter){ if (($menu and $menu =~ /$filter/i) or ($title and $title =~ /$filter/i)){ push @matches, ["$path$key$suffix",$menu,$class]; @@ -676,15 +668,22 @@ sub target_menu($$$$;$){ } else { $menu =~ s/ / /g; - my $menuadd =""; - $menuadd = " " x (20 - length($menu.$menuextra)) if length($menu.$menuextra) < 20; - my $menuclass = "menulink"; - if ($key eq $current and !@$open) { - $menuclass = "menulinkactive"; - } - - $print .= qq{<tr><td class="$class" colspan="2"> - <a class="$menuclass" HREF="$path$key$suffix">$menu</a>$menuextra$menuadd</td></tr>\n}; - if ($key eq $current){ + my $menuclass = "menulink"; + if ($key eq $current and !@$open) { + $menuclass = "menulinkactive"; + } + if ($menuextra){ + $menuextra =~ s/{HOST}/#$host/g; + $menuextra =~ s/{CLASS}/$menuclass/g; + $menuextra = ' '.$menuextra; + } else { + $menuextra = ''; + } + + my $menuadd =""; + $menuadd = " " x (20 - length($menu.$menuextra)) if length($menu.$menuextra) < 20; + $print .= qq{<tr><td class="$class" colspan="2"> - <a class="$menuclass" HREF="$path$key$suffix">$menu</a>$menuextra$menuadd</td></tr>\n}; + if ($key eq $current){ my $prline = target_menu $tree->{$key}, $open, "$path$key.",$filter, $suffix; $print .= qq{<tr><td class="$class"> </td><td align="left">$prline</td></tr>} if $prline; |