summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2008-06-05 09:13:36 +0200
committerTobi Oetiker <tobi@oetiker.ch>2008-06-05 09:13:36 +0200
commitc5d21994f26ffee7ebd80fc226220152d3d48ce5 (patch)
tree1afb2d58d7a60ad05ffa19c1c8907efeaaea447f
parent3fabc095b23f030883bbfc613b7ae423c71a3054 (diff)
downloadsmokeping-c5d21994f26ffee7ebd80fc226220152d3d48ce5.tar.gz
smokeping-c5d21994f26ffee7ebd80fc226220152d3d48ce5.tar.xz
use menuclass and not just class for menuextra {CLASS}
-rw-r--r--lib/Smokeping.pm33
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 = '&nbsp;'.$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/ /&nbsp;/g;
- my $menuadd ="";
- $menuadd = "&nbsp;" 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">&nbsp;-&nbsp;<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 = '&nbsp;'.$menuextra;
+ } else {
+ $menuextra = '';
+ }
+
+ my $menuadd ="";
+ $menuadd = "&nbsp;" x (20 - length($menu.$menuextra)) if length($menu.$menuextra) < 20;
+ $print .= qq{<tr><td class="$class" colspan="2">&nbsp;-&nbsp;<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">&nbsp;&nbsp;</td><td align="left">$prline</td></tr>}
if $prline;