Diff for /loncom/interface/lonmsg.pm between versions 1.221 and 1.222

version 1.221, 2009/01/05 20:04:40 version 1.222, 2009/02/05 00:45:29
Line 194  Returns Line 194  Returns
   %to - a hash, which keys are addresses of users to send messages to    %to - a hash, which keys are addresses of users to send messages to
         the keys will look like   name:domain          the keys will look like   name:domain
   
 =item user_lang()  
   
 =back  =back
   
 =cut  =cut
Line 490  sub sendnotification { Line 488  sub sendnotification {
     my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid,      my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid,
         $symb,$error) = &Apache::lonmsg::unpackmsgid($msgid);          $symb,$error) = &Apache::lonmsg::unpackmsgid($msgid);
     my ($coursetext,$body,$bodybegin,$bodysubj,$bodyend);      my ($coursetext,$body,$bodybegin,$bodysubj,$bodyend);
     my $user_lh = &user_lang($touname,$toudom,$fromcid);      my $user_lh = &Apache::loncommon::user_lang($touname,$toudom,$fromcid);
     if ($fromcid ne '') {      if ($fromcid ne '') {
         $coursetext = "\n".&mt_user($user_lh,'Course').': ';          $coursetext = "\n".&mt_user($user_lh,'Course').': ';
         if ($env{'course.'.$fromcid.'.description'} ne '') {          if ($env{'course.'.$fromcid.'.description'} ne '') {
Line 1025  sub decide_receiver { Line 1023  sub decide_receiver {
     return ($typestyle,%to);      return ($typestyle,%to);
 }  }
   
 sub user_lang {  
     my ($touname,$toudom,$fromcid) = @_;  
     my @userlangs;  
     if (($fromcid ne '') && ($env{'course.'.$fromcid.'.languages'} ne '')) {  
         @userlangs=(@userlangs,split(/\s*(\,|\;|\:)\s*/,  
                     $env{'course.'.$fromcid.'.languages'}));  
     } else {  
         my %langhash = &Apache::loncommon::getlangs($touname,$toudom);  
         if ($langhash{'languages'} ne '') {  
             @userlangs = split(/\s*(\,|\;|\:)\s*/,$langhash{'languages'});  
         } else {  
             my %domdefs = &Apache::lonnet::get_domain_defaults($toudom);  
             if ($domdefs{'lang_def'} ne '') {  
                 @userlangs = ($domdefs{'lang_def'});  
             }  
         }  
     }  
     my @languages=&Apache::lonlocal::get_genlanguages(@userlangs);  
     my $user_lh = Apache::localize->get_handle(@languages);  
     return $user_lh;  
 }  
   
 1;  1;
 __END__  __END__
   

Removed from v.1.221  
changed lines
  Added in v.1.222


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>