--- loncom/lonnet/perl/lonnet.pm 2003/02/20 19:41:26 1.330 +++ loncom/lonnet/perl/lonnet.pm 2003/03/06 21:08:21 1.333 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.330 2003/02/20 19:41:26 www Exp $ +# $Id: lonnet.pm,v 1.333 2003/03/06 21:08:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -811,6 +811,8 @@ sub ssi_body { &ssi($filelink)); $output=~s/^.*\]*\>//si; $output=~s/\<\/body\s*\>.*$//si; + $output=~ + s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs; return $output; } @@ -2167,6 +2169,7 @@ sub is_on_map { my $filename=$uriparts[$#uriparts]; my $pathname=$uri; $pathname=~s|/\Q$filename\E$||; + $pathname=~s/^adm\/wrapper\///; #Trying to find the conditional for the file my $match=($ENV{'acc.res.'.$ENV{'request.course.id'}.'.'.$pathname}=~ /\&\Q$filename\E\:([\d\|]+)\&/); @@ -3078,12 +3081,19 @@ sub metadata { # my $package=$token->[2]->{'package'}; my $keyroot=''; - if ($prefix) { - $keyroot.=$prefix; - } else { - if (defined($token->[2]->{'part'})) { - $keyroot.='_'.$token->[2]->{'part'}; - } + if (defined($prefix) && $prefix !~ /^__/) { + # prefix that has a part already + $keyroot=$prefix; + } elsif (defined($prefix)) { + # prefix that is missing a part + if (defined($token->[2]->{'part'})) { + $keyroot='_'.$token->[2]->{'part'}.substr($prefix,1); + } + } else { + # no prefix at all + if (defined($token->[2]->{'part'})) { + $keyroot='_'.$token->[2]->{'part'}; + } } if (defined($token->[2]->{'id'})) { $keyroot.='_'.$token->[2]->{'id'};