diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2008-06-05 09:13:36 +0200 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2008-06-05 09:13:36 +0200 |
commit | c5d21994f26ffee7ebd80fc226220152d3d48ce5 (patch) | |
tree | 1afb2d58d7a60ad05ffa19c1c8907efeaaea447f | |
parent | 3fabc095b23f030883bbfc613b7ae423c71a3054 (diff) | |
download | smokeping-c5d21994f26ffee7ebd80fc226220152d3d48ce5.tar.gz smokeping-c5d21994f26ffee7ebd80fc226220152d3d48ce5.tar.xz |
use menuclass and not just class for menuextra {CLASS}
-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; |