--- rat/lonuserstate.pm 2002/08/17 17:40:06 1.37 +++ rat/lonuserstate.pm 2002/09/10 20:53:37 1.43 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construct and maintain state and binary representation of course for user # -# $Id: lonuserstate.pm,v 1.37 2002/08/17 17:40:06 www Exp $ +# $Id: lonuserstate.pm,v 1.43 2002/09/10 20:53:37 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -118,11 +118,18 @@ sub loadmap { unless ($ispage) { $turi=~/\.(\w+)$/; my $embstyle=&Apache::loncommon::fileembstyle($1); - if ($token->[2]->{'external'} eq 'true') { + if ($token->[2]->{'external'} eq 'true') { # external $turi=~s/^http\:\/\//\/adm\/wrapper\/ext\//; - } else { - my $embstyle=&Apache::loncommon::fileembstyle($1); - if (($embstyle eq 'img') || ($embstyle eq 'emb')) { + } elsif ($turi=~/^\/*uploaded\//) { # uploaded + if (($embstyle eq 'img') || ($embstyle eq 'emb') + || ($embstyle eq 'ssi')) { + $turi='/adm/wrapper'.$turi; + } elsif ($turi!~/\.(sequence|page)$/) { + $turi='/adm/coursedocs/showdoc'.$turi; + } + } else { # normal internal resource + if (($embstyle eq 'img') || ($embstyle eq 'emb') + || ($turi=~/\/(syllabus|aboutme|navmaps|smppg|bulletinboard)$/)) { $turi='/adm/wrapper'.$turi; } } @@ -462,7 +469,7 @@ sub readmap { %parmhash=(); $errtext=''; $pc=0; - my $furi='/res/'.&Apache::lonnet::declutter($uri); + my $furi=&Apache::lonnet::clutter($uri); $hash{'src_0.0'}=$furi; $hash{'title_0.0'}=&Apache::lonnet::metadata($uri,'title'); $hash{'ids_'.$furi}='0.0';