--- loncom/interface/lonspeller.pm 2004/07/27 23:35:34 1.6 +++ loncom/interface/lonspeller.pm 2005/04/07 06:56:23 1.11 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Interface routines for Aspell # -# $Id: lonspeller.pm,v 1.6 2004/07/27 23:35:34 www Exp $ +# $Id: lonspeller.pm,v 1.11 2005/04/07 06:56:23 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,6 +33,8 @@ package Apache::lonspeller; use Apache::Constants qw(:common); use Text::Aspell; use Apache::lonlocal; +use Apache::lonnet; +use Apache::lontexconvert(); use HTML::LCParser; use strict; @@ -40,7 +42,7 @@ my $speller; my $insidelink; sub spellcheck_language { - if ($ENV{'form.lang'}) { return $ENV{'form.lang'}; } + if ($env{'form.lang'}) { return $env{'form.lang'}; } if (&mt('spellcheck_lang') ne 'spellcheck_lang') { return &mt('spellcheck_lang'); } @@ -64,9 +66,12 @@ sub textsection { my $suggestions=join(' ',$speller->suggest($word)); $suggestions=~s/\'/\\\'/gs; if (($suggestions) && (!$insidelink)) { - $output.=''; + my $html=&Apache::lonxml::xmlbegin('encode'); + $output.=''; } $output.=''.$word.''; if (($suggestions) && (!$insidelink)) { $output.=''; } @@ -123,10 +128,12 @@ sub handler { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); &initspeller(); - $r->print(''. + my $html=&Apache::lonxml::xmlbegin(); + $r->print($html.'<head><title>'. &mt('Spell Checker'). ''. - &markeduptext($ENV{'form.text'}). + &Apache::lontexconvert::msgtexconverted( + &markeduptext($env{'form.text'})). ''); return OK; }