--- loncom/xml/lonxml.pm 2007/11/13 22:16:10 1.469 +++ loncom/xml/lonxml.pm 2007/12/05 14:52:15 1.470 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.469 2007/11/13 22:16:10 albertel Exp $ +# $Id: lonxml.pm,v 1.470 2007/12/05 14:52:15 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1083,7 +1083,7 @@ sub increment_counter { # If the caller supplied the response_id parameter, # Maintain its counter.. creating if necessary. - if(defined($part_response)) { + if (defined($part_response)) { if (!defined($Apache::lonxml::counters_per_part{$part_response})) { $Apache::lonxml::counters_per_part{$part_response} = 0; } @@ -1164,7 +1164,6 @@ sub bubble_lines_for_part { } else { return $Apache::lonxml::counters_per_part{$part_response}; } - } =pod @@ -1477,7 +1476,7 @@ SIMPLECONTENT sub inserteditinfo { - my ($filecontents,$filetype)=@_; + my ($filecontents, $filetype, $filename)=@_; $filecontents = &HTML::Entities::encode($filecontents,'<>&"'); # my $editheader='Edit below
'; my $xml_help = ''; @@ -1529,38 +1528,41 @@ FULLPAGE $xml_help=&Apache::loncommon::helpLatexCheatsheet(); } - my $cleanbut = ''; - my $titledisplay=&display_title(); 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 - $buttons.=&Apache::lonhtmlcommon::spelllink('xmledit','filecont'); + my $spelllink .=&Apache::lonhtmlcommon::spelllink('xmledit','filecont'); my $textarea_events = &Apache::edit::element_change_detection(); my $form_events = &Apache::edit::form_change_detection(); my $editfooter=(<
-$xml_help - -$buttons
- -
-
$buttons -
-$titledisplay -
+
+ +
+ $filename + + $xml_help +
+
+ + + $spelllink +
+
+ + +
+
+ +
+
+ $titledisplay +
ENDFOOTER @@ -1690,11 +1692,12 @@ ENDNOTFOUND unless ($env{'request.state'} eq 'published') { if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'}))) { - my ($edit_info, $add_to_onload, $add_to_onresize)= - &inserteditinfo($filecontents,$filetype); - my $displayfile=$request->uri; $displayfile=~s/^\/[^\/]*//; + + my ($edit_info, $add_to_onload, $add_to_onresize)= + &inserteditinfo($filecontents,$filetype,$displayfile); + my %options = ('add_entries' => {'onresize' => $add_to_onresize, @@ -1710,9 +1713,7 @@ ENDNOTFOUND my $start_page = &Apache::loncommon::start_page(undef,$js, \%options); $result=$start_page. - &Apache::lonxml::message_location().'

'. - $displayfile. - '

'. + &Apache::lonxml::message_location(). $edit_info. &Apache::loncommon::end_page(); }