--- loncom/interface/lonhtmlcommon.pm 2004/11/23 14:53:05 1.98 +++ loncom/interface/lonhtmlcommon.pm 2004/11/23 16:04:33 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.98 2004/11/23 14:53:05 matthew Exp $ +# $Id: lonhtmlcommon.pm,v 1.99 2004/11/23 16:04:33 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -904,18 +904,20 @@ sub crumbs { $output.=''.$prefix.'/'; if ($ENV{'user.adv'}) { my $path=$prefix.'/'; - foreach (split('/',$uri)) { - unless ($_) { next; } - $path.=$_; + foreach my $dir (split('/',$uri)) { + if (! $dir) { next; } + $path .= $dir; unless ($path eq $uri) { $path.='/'; } - my $escaped_linkpath = &Apache::loncommon::escape_single($path); + my $linkpath = &Apache::loncommon::escape_single($path); if ($form) { - $escaped_linkpath="javascript:$form.action='". - &Apache::loncommon::escape_single($path). - "';$form.submit();"; + $linkpath= + qq{javascript:$form.action='$linkpath';$form.submit();}; } - my $escaped_target = &Apache::loncommon::escape_single($target); - $output.=''.$_.'/'; + if ($target) { + $target = ' target="'. + &Apache::loncommon::escape_single($target).'"'; + } + $output.=qq{$dir/}; } } else { $output.=$uri;