--- loncom/xml/lonxml.pm 2007/08/29 21:49:38 1.454 +++ loncom/xml/lonxml.pm 2007/09/10 19:46:57 1.456 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.454 2007/08/29 21:49:38 albertel Exp $ +# $Id: lonxml.pm,v 1.456 2007/09/10 19:46:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1357,13 +1357,13 @@ sub inserteditinfo { my $initialize=''; my $textarea_id = 'filecont'; my ($add_to_onload, $add_to_onresize); - if ($filetype eq 'html') { - my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons(); - $initialize=&Apache::lonhtmlcommon::spellheader(); - if (!&Apache::lonhtmlcommon::htmlareablocked() && - &Apache::lonhtmlcommon::htmlareabrowser()) { - $textarea_id .= '_htmlarea'; - $initialize.=(< $addbuttons @@ -1383,8 +1383,8 @@ $addbuttons } FULLPAGE - } else { - $initialize.=(< $addbuttons function initDocument() { @@ -1392,9 +1392,12 @@ $addbuttons } FULLPAGE - } - $add_to_onload = 'initDocument();'; - $add_to_onresize = "resize_textarea('$textarea_id','LC_aftertextarea');"; + } + + $add_to_onload = 'initDocument();'; + $add_to_onresize = "resize_textarea('$textarea_id','LC_aftertextarea');"; + + if ($filetype eq 'html') { $xml_help=&Apache::loncommon::helpLatexCheatsheet(); } @@ -1409,7 +1412,7 @@ FULLPAGE my $buttons=(< -
+
BUTTONS @@ -1529,15 +1532,27 @@ ENDNOTFOUND ['editmode']); } if (!$env{'form.editmode'} || $env{'form.viewmode'} || $env{'form.discardview'}) { + &Apache::structuretags::reset_problem_globals(); $result = &Apache::lonxml::xmlparse($request,$target,$filecontents, '',%mystyle); - undef($Apache::lonhomework::parsing_a_task); + # .html files may contain or need to clean + # up if it did + &Apache::structuretags::reset_problem_globals(); + &Apache::lonhomework::finished_parsing(); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['rawmode']); if ($env{'form.rawmode'}) { $result = $filecontents; } + if ($filetype eq 'sty') { + my %options = ('bgcolor' => '#FFFFFF'); + $result = + &Apache::loncommon::start_page(undef,undef,\%options). + &Apache::londefdef::edit_controls(). + $result. + &Apache::loncommon::end_page(); + } } } - + # # Edit action? Insert editing commands #