Diff for /loncom/xml/lontexconvert.pm between versions 1.28 and 1.30

version 1.28, 2003/11/06 15:27:07 version 1.30, 2004/01/28 20:48:35
Line 51  use Apache::lonmenu; Line 51  use Apache::lonmenu;
   
 # ====================================================================== Header  # ====================================================================== Header
   
   sub init_tth {
       my $options=$ENV{'course.'.$ENV{'request.course.id'}.'.tthoptions'};
       if ($ENV{'browser.mathml'}) {
    &tth::ttminit();
    if ($ENV{'browser.unicode'}) {
       &tth::ttmoptions('-L -u1 '.$options);
    } else {
       &tth::ttmoptions('-L -u0 '.$options);
    }
       } else {
    &tth::tthinit();
    if ($ENV{'browser.unicode'}) {
       &tth::tthoptions('-L -u1 '.$options);
    } else {
       &tth::tthoptions('-L -u0 '.$options);
    }
       }
   }
   
 sub header {  sub header {
   $errorstring='';    $errorstring='';
   my $time=time;    my $time=time;
   if ($ENV{'browser.mathml'}) {    &init_tth();
       &tth::ttminit();  
       if ($ENV{'browser.unicode'}) {  
   &tth::ttmoptions('-L -u1');  
       } else {  
   &tth::ttmoptions('-L -u0');  
       }  
   } else {  
       &tth::tthinit();  
       if ($ENV{'browser.unicode'}) {  
   &tth::tthoptions('-L -u1');  
       } else {  
   &tth::tthoptions('-L -u0');  
       }  
   }  
   return &Apache::lonxml::xmlbegin().    return &Apache::lonxml::xmlbegin().
          &Apache::lonxml::fontsettings().           &Apache::lonxml::fontsettings().
          "\n<head>\n".           "\n<head>\n".
Line 131  sub footer { Line 136  sub footer {
 sub to_convert {  sub to_convert {
     my ($string) = @_;      my ($string) = @_;
     $string=~s/\<br\s*\/?\>/ /gs;      $string=~s/\<br\s*\/?\>/ /gs;
     $string=~s/\s/ /gs;  #    $string=~s/\s/ /gs;
     $string=&HTML::Entities::decode($string);      $string=&HTML::Entities::decode($string);
     return &converted(\$string);      return &converted(\$string);
 }  }
Line 162  sub smiley { Line 167  sub smiley {
   
 sub msgtexconverted {  sub msgtexconverted {
     my $message=shift;      my $message=shift;
       my $email=shift;
     $errorstring='';      $errorstring='';
     if ($ENV{'browser.mathml'}) {      &init_tth();
  &tth::ttminit();  
  if ($ENV{'browser.unicode'}) {  
     &tth::ttmoptions('-L -u1');  
  } else {  
     &tth::ttmoptions('-L -u0');  
  }  
     } else {  
  &tth::tthinit();  
  if ($ENV{'browser.unicode'}) {  
     &tth::tthoptions('-L -u1');  
  } else {  
     &tth::tthoptions('-L -u0');  
  }  
     }  
     my $outmessage='';      my $outmessage='';
     my $tex=0;      my $tex=0;
     foreach (split(/(?:\&lt\;|\<)\/*m\s*(?:\&gt\;|\>)/i,$message)) {      foreach (split(/(?:\&lt\;|\<)\/*m\s*(?:\&gt\;|\>)/i,$message)) {
  if ($tex) {   if ($tex) {
     $outmessage.=&to_convert($_); $tex=0;      if ($email) {
    $outmessage.='</pre><tt>'.&to_convert($_).'</tt><pre>'; $tex=0;
       } else {
    $outmessage.=&to_convert($_); $tex=0;
       }
  } else {   } else {
             $outmessage.=&smiley($_); $tex=1;              $outmessage.=&smiley($_); $tex=1;
  }   }

Removed from v.1.28  
changed lines
  Added in v.1.30


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