From b2edd00fa8ad99b8492adc2327505729c76efed2 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 22 Aug 2002 03:28:48 +0000 Subject: [PATCH] Fixed a bug where every navigation element was marked as the selected menu item. --- lib/WebGUI/Navigation.pm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/WebGUI/Navigation.pm b/lib/WebGUI/Navigation.pm index db51c0d5a..f5d68a8a7 100644 --- a/lib/WebGUI/Navigation.pm +++ b/lib/WebGUI/Navigation.pm @@ -79,9 +79,13 @@ sub drawHorizontal { } else { $output .= ' '.$seperator.' '; } - $output .= '' - .$tree->{$pageId}{title}.''; + $output .= ''; + if ($pageId == $session{page}{pageId}) { + $output .= ''.$tree->{$pageId}{title}.''; + } else { + $output .= $tree->{$pageId}{title}; + } + $output .= ''; } return $output; } @@ -128,9 +132,13 @@ sub drawVertical { $leading .= "
"; } foreach $pageId (keys %{$tree}) { - $output .= $padding.$bullet.'' - .$tree->{$pageId}{title}.''.$leading; + $output .= $padding.$bullet.''; + if ($pageId == $session{page}{pageId}) { + $output .= ''.$tree->{$pageId}{title}.''; + } else { + $output .= $tree->{$pageId}{title}; + } + $output .= ''.$leading; $output .= drawVertical($tree->{$pageId}{sub}, $bullet, $class, $spacing, ($indent+1)); } return $output;