--- rat/lonratsrv.pm 2003/02/03 18:03:53 1.24 +++ rat/lonratsrv.pm 2004/04/23 17:30:33 1.27 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Server for RAT Maps # -# $Id: lonratsrv.pm,v 1.24 2003/02/03 18:03:53 harris41 Exp $ +# $Id: lonratsrv.pm,v 1.27 2004/04/23 17:30:33 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,13 +25,7 @@ # # http://www.lon-capa.org/ # -# (Edit Handler for RAT Maps -# (TeX Content Handler -# -# 05/29/00,05/30 Gerd Kortemeyer) -# 7/1 Gerd Kortemeyer) -# 7/1,7/3,7/4,7/7,7/8,7/10,7/26,10/2 Gerd Kortemeyer -# 5/3,06/25,07/03,07/04,07/05 Gerd Kortemeyer + package Apache::lonratsrv; @@ -81,7 +75,9 @@ sub loadmap { } $instr=join('',@content); } - if ($instr) { + if ($instr eq -2) { + $errtext.='Map not loaded: An error occured while trying to load the map.'; + } elsif ($instr) { my $parser = HTML::TokeParser->new(\$instr); my $token; my $graphmode=0; @@ -290,12 +286,14 @@ sub savemap { } } $outstr.="\n"; - if ($fn=~/^\/*uploaded\/(\w+)\/(\w+)\//) { + if ($fn=~/^\/*uploaded\/(\w+)\/(\w+)\/(.*)$/) { $ENV{'form.output'}=$outstr; my $home=&Apache::lonnet::homeserver($2,$1); - &Apache::lonnet::finishuserfileupload( - $2,$1,$home, - 'output',(split(/\//,$fn))[-1]); + my $result=&Apache::lonnet::finishuserfileupload($2,$1,$home, + 'output',$3); + if ($result != m|^/uploaded/|) { + $errtext.='Map not saved: A network error occured when trying to save the map. '; + } } else { my $fh; if ($fh=Apache::File->new(">$fn")) {