--- loncom/interface/lonhtmlcommon.pm 2004/02/24 23:19:15 1.56 +++ loncom/interface/lonhtmlcommon.pm 2004/03/01 16:04:43 1.57 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.56 2004/02/24 23:19:15 albertel Exp $ +# $Id: lonhtmlcommon.pm,v 1.57 2004/03/01 16:04:43 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -876,7 +876,7 @@ returns: nothing ############################################################ { my @Crumbs; - + sub breadcrumbs { my ($color,$component,$component_help,$function,$domain) = @_; if (! defined($color)) { @@ -891,19 +891,27 @@ returns: nothing ''. '
'. ''; + # + # Make the faq and bug data cascade + my $faq = ''; + my $bug = ''; # The last breadcrumb does not have a link, so handle it seperately. my $last = pop(@Crumbs); + # # The first one should be the course, I guess. if (exists($ENV{'request.course.id'})) { my $cid = $ENV{'request.course.id'}; - unshift(@Crumbs,{href=>'/adm/menu', + unshift(@Crumbs,{ + href=>'/adm/menu', title=>'Go to main menu', text=>$ENV{'course.'.$cid.'.description'}, - }); + }); } my $links .= join('->', map { + $faq = $_->{'faq'} if (exists($_->{'faq'})); + $bug = $_->{'bug'} if (exists($_->{'bug'})); ''. $_->{'text'}.'' } @Crumbs @@ -912,11 +920,13 @@ returns: nothing $links .= ''.$last->{'text'}.''; # my $icons = ''; - if (exists($last->{'faq'})) { - $icons .= &Apache::loncommon::help_open_faq($last->{'faq'}); + $faq = $last->{'faq'} if (exists($last->{'faq'})); + $bug = $last->{'bug'} if (exists($last->{'bug'})); + if ($faq ne '') { + $icons .= &Apache::loncommon::help_open_faq($faq); } - if (exists($last->{'bug'})) { - $icons .= &Apache::loncommon::help_open_bug($last->{'bug'}); + if ($bug ne '') { + $icons .= &Apache::loncommon::help_open_bug($bug); } if ($icons ne '') { $Str .= $icons.' '; @@ -950,7 +960,7 @@ returns: nothing push (@Crumbs,@_); } -} +} # End of scope for @Crumbs ############################################################ ############################################################