--- loncom/interface/londocs.pm 2004/05/11 06:12:45 1.126 +++ loncom/interface/londocs.pm 2004/05/11 06:37:39 1.127 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.126 2004/05/11 06:12:45 albertel Exp $ +# $Id: londocs.pm,v 1.127 2004/05/11 06:37:39 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -585,6 +585,17 @@ END &Apache::lonnet::declutter($url)); (undef,undef,$url)=&Apache::lonnet::decode_symb($symb); $url=&Apache::lonnet::clutter($url); + if ($url=~/^\/*uploaded\//) { + $url=~/\.(\w+)$/; + my $embstyle=&Apache::loncommon::fileembstyle($1); + if (($embstyle eq 'img') || ($embstyle eq 'emb')) { + $url='/adm/wrapper'.$url; + } elsif ($embstyle eq 'ssi') { + #do nothing with these + } elsif ($url!~/\.(sequence|page)$/) { + $url='/adm/coursedocs/showdoc'.$url; + } + } $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb); } my $parameterset=' '; @@ -1048,7 +1059,7 @@ sub handler { $ENV{'form.folder'}=pop(@folderpath); } if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) { - $showdoc=$1; + $showdoc='/'.$1; } unless ($showdoc) { # got called from remote $forcestandard=($ENV{'form.folder'}=~/^default_/);