--- rat/lonratedt.pm 2002/08/31 00:42:30 1.34 +++ rat/lonratedt.pm 2002/10/03 15:07:25 1.37 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Edit Handler for RAT Maps # -# $Id: lonratedt.pm,v 1.34 2002/08/31 00:42:30 www Exp $ +# $Id: lonratedt.pm,v 1.37 2002/10/03 15:07:25 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -300,6 +300,7 @@ sub pastetarget { my $ext='false'; if ($url=~/^http\:\/\//) { $ext='true'; } $url=~s/\:/\:/g; + $name=~s/\:/\:/g; $resources[$idx]=$name.':'.$url.':'.$ext.':normal:res'; } } @@ -331,10 +332,16 @@ sub startfinish { sub storemap { my $realfn=shift; - my $fn=$realfn.'.tmp'; - unless (-e $fn) { - copy($realfn,$fn); + my $fn=$realfn; +# unless this is forced to work from the original file, use a temporary file +# instead + unless (shift) { + $fn=$realfn.'.tmp'; + unless (-e $fn) { + copy($realfn,$fn); + } } +# store data either into tmp or real file &startfinish(); my $output='graphdef<:>no'; my $k=1; @@ -474,10 +481,14 @@ sub smpedt { $targetmsg='Saving ...
'; copy($tmpfn,&Apache::lonnet::filelocation('',$url)); unlink($tmpfn); + my ($errtext,$fatal)= + &mapread(&Apache::lonnet::filelocation('',$url),''); } if ($ENV{'form.revert'}) { $targetmsg='Reverting ...
'; unlink($tmpfn); + my ($errtext,$fatal)= + &mapread(&Apache::lonnet::filelocation('',$url),''); } if (-e $tmpfn) { $targetmsg= @@ -700,6 +711,7 @@ sub smpedt { $targetdetail.='&'.&Apache::lonnet::escape($name).'='. &Apache::lonnet::escape($url); $idx++; + $name=~s/\:/\:/g; ''; } @order); @@ -736,16 +748,15 @@ sub smpedt { $bodytag $buttons $errtext -

$url

- + - +
Import
Temporary Assembly Workspace  Target
File: $url
- - + + after selected
@@ -759,9 +770,9 @@ value="Browse">
  +"javascript:impfortarget.value=1;groupsearch()" value="Search"> +"javascript:impfortarget.value=1;groupimport();" value="Import"> after selected
$targetmsg