--- loncom/xml/lonxml.pm 2006/11/23 22:11:21 1.427 +++ loncom/xml/lonxml.pm 2006/11/30 01:07:09 1.428 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.427 2006/11/23 22:11:21 banghart Exp $ +# $Id: lonxml.pm,v 1.428 2006/11/30 01:07:09 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1335,10 +1335,12 @@ FULLPAGE my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', 'vi' => 'Save and View', 'dv' => 'Discard Edits and View', + 'un' => 'undo', 'ed' => 'Edit'); my $buttons=(<
+ +
BUTTONS @@ -1418,14 +1420,10 @@ sub handler { # # Edit action? Save file. # - unless ($env{'request.state'} eq 'published') { - if ($env{'form.savethisfile'} || $env{'form.viewmode'}) { - if (&storefile($file,$env{'form.filecont'})) { - &Apache::lonxml::info("". - &mt('Updated').": ". - &Apache::lonlocal::locallocaltime(time). - " "); - } + if (!($env{'request.state'} eq 'published')) { + if ($env{'form.savethisfile'} || $env{'form.viewmode'} || $env{'form.Undo'}) { + my $problem=&Apache::lonnet::getfile($file); + my $error = &Apache::lonhomework::handle_save_or_undo($request, \$problem, \$env{'form.filecont'}); } } my %mystyle;