--- loncom/xml/lonxml.pm 2006/11/23 02:26:43 1.426
+++ loncom/xml/lonxml.pm 2006/11/23 22:11:21 1.427
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.426 2006/11/23 02:26:43 banghart Exp $
+# $Id: lonxml.pm,v 1.427 2006/11/23 22:11:21 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1334,9 +1334,11 @@ FULLPAGE
my $titledisplay=&display_title();
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
'vi' => 'Save and View',
+ 'dv' => 'Discard Edits and View',
'ed' => 'Edit');
my $buttons=(<
BUTTONS
@@ -1457,7 +1459,8 @@ ENDNOTFOUND
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['editmode']);
}
- if (!$env{'form.editmode'} || $env{'form.viewmode'}) {
+ &Apache::lonnet::logthis("edit mode is ".$env{'form.editmode'});
+ if (!$env{'form.editmode'} || $env{'form.viewmode'} || $env{'form.discardview'}) {
$result = &Apache::lonxml::xmlparse($request,$target,$filecontents,
'',%mystyle);
undef($Apache::lonhomework::parsing_a_task);
@@ -1471,7 +1474,8 @@ ENDNOTFOUND
# Edit action? Insert editing commands
#
unless ($env{'request.state'} eq 'published') {
- if ($env{'form.editmode'} && (!($env{'form.viewmode'}))) {
+ if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))
+ {
my $displayfile=$request->uri;
$displayfile=~s/^\/[^\/]*//;
my %options = ();