--- loncom/interface/lonpreferences.pm 2003/09/16 22:40:25 1.28 +++ loncom/interface/lonpreferences.pm 2003/11/07 23:22:21 1.32 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.28 2003/09/16 22:40:25 www Exp $ +# $Id: lonpreferences.pm,v 1.32 2003/11/07 23:22:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,6 +51,7 @@ use Crypt::DES; use DynaLoader; # for Crypt::DES version use Apache::loncommon(); use Apache::lonhtmlcommon(); +use Apache::lonlocal; # # Write lonnet::passwd to do the call below. @@ -108,9 +109,9 @@ sub languagechanger { my $user = $ENV{'user.name'}; my $domain = $ENV{'user.domain'}; my %userenv = &Apache::lonnet::get - ('environment',['language','translator']); - my $language=$userenv{'language'}; - my $translator=$userenv{'translator'}; + ('environment',['languages']); + my $language=$userenv{'languages'}; + my $bodytag=&Apache::loncommon::bodytag( 'Change Your Language Preferences'); $r->print(<Preferred language: ENDLSCREEN - if ($ENV{'user.adv'}) { - $r->print (<Willing to translate for language: - -ENDTRSC - } - $r->print('
'); + $r->print('
'); } @@ -141,29 +136,14 @@ sub verify_and_change_languages { $newlanguage=~s/[^\-\w]//g; my $message=''; if ($newlanguage) { - &Apache::lonnet::put('environment',{'language' => $newlanguage}); - &Apache::lonnet::appenv('environment.language' => $newlanguage); - $message='Set new preferred language to '.$newlanguage; + &Apache::lonnet::put('environment',{'languages' => $newlanguage}); + &Apache::lonnet::appenv('environment.languages' => $newlanguage); + $message='Set new preferred languages to '.$newlanguage; } else { - &Apache::lonnet::del('environment',['language']); - &Apache::lonnet::delenv('environment\.language'); + &Apache::lonnet::del('environment',['languages']); + &Apache::lonnet::delenv('environment\.languages'); $message='Reset preferred language'; } - if ($ENV{'user.adv'}) { - $message.='
'; - my $newtrans = $ENV{'form.translator'}; - $newtrans=~s/[^\-\w]//g; - if ($newtrans) { - &Apache::lonnet::put('environment',{'translator' => $newtrans}); - &Apache::lonnet::appenv('environment.translator' => $newtrans); - $message.='Set translator to '.$newtrans; - } else { - &Apache::lonnet::del('environment',['translator']); - &Apache::lonnet::delenv('environment\.translator'); - $message.='Reset translator'; - } - } - my $bodytag=&Apache::loncommon::bodytag( 'Change Your Language Preferences'); $r->print(<content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); # Some pages contain DES keys and should not be cached. &Apache::loncommon::no_cache($r); $r->send_http_header;