[Jifty-commit] r1568 - in jifty/trunk: lib/Jifty/Web
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Jul 14 00:19:42 EDT 2006
Author: trs
Date: Fri Jul 14 00:19:42 2006
New Revision: 1568
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Web/Menu.pm
Log:
r14414 at zot: tom | 2006-07-14 00:19:28 -0400
Only set active child on create if we have a request
Modified: jifty/trunk/lib/Jifty/Web/Menu.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Menu.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Menu.pm Fri Jul 14 00:19:42 2006
@@ -105,23 +105,21 @@
escape_label => 1,
@_
});
- # Activate it
- if (my $url = $self->{children}{$key}->url) {
- # XXX TODO cleanup for mod_perl
- my $base_path = Jifty->web->request->path;
- chomp($base_path);
+ # Activate it
+ if (my $url = $self->{children}{$key}->url and Jifty->web->request) {
+ # XXX TODO cleanup for mod_perl
+ my $base_path = Jifty->web->request->path;
+ chomp($base_path);
- $base_path =~ s/index\.html$//g;
- $base_path =~ s/\/+$//g;
- $url =~ s/\/+$//i;
- if ($url eq $base_path) {
- $self->{children}{$key}->active(1);
+ $base_path =~ s/index\.html$//g;
+ $base_path =~ s/\/+$//g;
+ $url =~ s/\/+$//i;
+
+ if ($url eq $base_path) {
+ $self->{children}{$key}->active(1);
+ }
+ }
}
- }
-
-}
-
-
return $self->{children}{$key}
}
More information about the Jifty-commit
mailing list