--- BreadCrumbsold.pm 2006-03-15 16:16:47.000000000 -0600
+++ /usr/pkg/lib/perl5/site_perl/5.8.0/Kwiki/BreadCrumbs.pm 2006-03-15 16:56:00.000000000 -0600
@@ -11,9 +11,9 @@
return unless $self->is_in_cgi;
super;
my $bread_crumbs = $self->hub->cookie->jar->{bread_crumbs} || [];
if ($self->hub->action eq 'display') {
- my $page_id = $self->pages->current->id;
+ my $page_id = join(':',$ENV{SCRIPT_NAME},$self->pages->current->id);
@$bread_crumbs = grep { $_ ne $page_id } @$bread_crumbs;
unshift @$bread_crumbs, $page_id;
}
splice @$bread_crumbs, 10
@@ -51,17 +51,29 @@
my @trail = @{$self->trail};
my $show = $self->preferences->show_bread_crumbs->value;
splice @trail, $show
if @trail > $show;
- my $script_name = $self->config->script_name;
my $pages = $self->hub->pages;
+ my $script_name0 = $ENV{SCRIPT_NAME};
"<hr />" . join ' < ',
map {
- my $page = $pages->new_page($_);
+ my $script_name = $script_name0;
+ my $page_id = $_;
+ my $page = $pages->new_page($page_id);
+ my $uri = $page->uri;
+ my $title = $uri;
+ if ($uri =~ m/([^:]+):(.+)/){ # for bumpless upgrade from older BreadCrumbs
+ ($script_name,$uri) = ($1,$2);
+ if($script_name ne $script_name0){
+ $title = "$uri at $script_name";
+ }else{
+ $title = $uri;
+ };
+ };
sprintf "<a href=\"%s?%s\">%s</a>\n",
$script_name,
- $page->uri,
- $page->title;
+ $uri,
+ $title;
} @trail;
}
__DATA__