[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 04 Aug 2006 21:01:52 -0000
albertel Fri Aug 4 17:01:52 2006 EDT
Modified files:
/loncom/interface lonhtmlcommon.pm
Log:
- was geting a // at the beging of a file path if not adv
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.148 loncom/interface/lonhtmlcommon.pm:1.149
--- loncom/interface/lonhtmlcommon.pm:1.148 Mon Jul 31 14:43:12 2006
+++ loncom/interface/lonhtmlcommon.pm Fri Aug 4 17:01:52 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.148 2006/07/31 18:43:12 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.149 2006/08/04 21:01:52 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -998,7 +998,7 @@
foreach my $dir (split('/',$uri)) {
if (! $dir) { next; }
$path .= $dir;
- if ($path eq $uri) {
+
if ($skiplast) {
$output.=$dir;
last;
@@ -1014,9 +1014,12 @@
$output.=qq{<a href="$linkpath" $target>$dir</a>/};
}
} else {
- $output.=$uri;
+ foreach my $dir (split('/',$uri)) {
+ if (! $dir) { next; }
+ $output.=$dir.'/';
+ }
}
- unless ($uri=~/\/$/) { $output=~s/\/$//; }
+ if ($uri !~ m|/$|) { $output=~s|/$||; }
return $output.'</font>'.($noformat?'':'</b></tt><br />');
}