--- loncom/xml/lonxml.pm 2002/01/07 18:11:57 1.146 +++ loncom/xml/lonxml.pm 2002/01/08 21:11:13 1.147 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.146 2002/01/07 18:11:57 albertel Exp $ +# $Id: lonxml.pm,v 1.147 2002/01/08 21:11:13 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1011,6 +1011,8 @@ sub storefile { if (my $fh=Apache::File->new('>'.$file)) { print $fh $contents; $fh->close(); + } else { + &warning("Unable to save file $file"); } } @@ -1032,23 +1034,38 @@ sub inserteditinfo { SIMPLECONTENT } - my $editheader='Edit below
'; + + $filecontents =~ s::</textarea>:g; +# my $editheader='Edit below
'; my $editfooter=(<

+ +
ENDFOOTER - $result=~s/(\]*\>)/$1$editheader/is; +# $result=~s/(\]*\>)/$1$editheader/is; $result=~s/(\<\/body\>)/$editfooter/is; return $result; } +sub editbutton { + my ($result) = @_; + my $button=(< + + +EDITBUTTON + $result=~s/(\<\/body\>)/$button/is; + return $result; +} + sub handler { my $request=shift; @@ -1077,7 +1094,7 @@ sub handler { } } my %mystyle; - my $result = ''; + my $result = ''; my $filecontents=&Apache::lonnet::getfile($file); if ($filecontents == -1) { $result=(<uri); $request->print($result); return OK; } - + sub debug { if ($Apache::lonxml::debug eq 1) { $|=1;