--- loncom/interface/londocs.pm 2004/05/11 06:12:45 1.126 +++ loncom/interface/londocs.pm 2004/06/10 22:23:35 1.129 @@ -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.129 2004/06/10 22:23:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -399,6 +399,10 @@ sub editor { if ($ENV{'form.cmd'}) { my ($cmd,$idx)=split(/\_/,$ENV{'form.cmd'}); if ($cmd eq 'del') { + my (undef,$url)=split(':',$Apache::lonratedt::resources[$Apache::lonratedt::order[$idx]]); + if ($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) { + &Apache::lonnet::removeuploadedurl($url); + } for (my $i=$idx;$i<$#Apache::lonratedt::order;$i++) { $Apache::lonratedt::order[$i]= $Apache::lonratedt::order[$i+1]; @@ -585,6 +589,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 +1063,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_/); @@ -1310,8 +1325,8 @@ $lt{'title'}:
- + $help{'Uploading_From_Harddrive'}