Diff for /loncom/xml/londefdef.pm between versions 1.167 and 1.175

version 1.167, 2003/08/26 15:05:43 version 1.175, 2003/09/30 19:39:00
Line 410  sub end_meta { Line 410  sub end_meta {
  my $content=&Apache::lonxml::get_param('content',$parstack,$safeeval);   my $content=&Apache::lonxml::get_param('content',$parstack,$safeeval);
  my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval);   my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval);
  if ((not defined $content) && (not defined $name)) {   if ((not defined $content) && (not defined $name)) {
     &Apache::lonxml::startredirection();      &Apache::lonxml::endredirection();
  }   }
     }      }
     return $currentstring;      return $currentstring;
Line 466  sub start_body { Line 466  sub start_body {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
    if ($Apache::lonhomework::parsing_a_problem) {
       &Apache::lonxml::warning("<body> tag found inside of <problem> tag this can cause problems.");
       return '';
    }
  if (!$Apache::lonxml::registered) {   if (!$Apache::lonxml::registered) {
     $currentstring.='<head>'.      $currentstring.='<head>'.
  &Apache::lonmenu::registerurl(undef,$target).'</head>';   &Apache::lonmenu::registerurl(undef,$target).'</head>';
Line 537  sub end_body { Line 541  sub end_body {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\end{document}';     $currentstring = '\strut\newline\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\newline\noindent \end{document}';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 1421  sub start_a { Line 1425  sub start_a {
 }  }
   
 sub end_a {  sub end_a {
     my ($target,$token,$tagstack,$parstack,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring .= $token->[2];   $currentstring .= $token->[2];
Line 1431  sub end_a { Line 1435  sub end_a {
   
 #-- <li> tag  #-- <li> tag
 sub start_li {  sub start_li {
     my ($target,$token,$tagstack,$parstack,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
Line 1634  sub start_dl { Line 1638  sub start_dl {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\begin{description}';     $currentstring = '\begin{description}';
    @Apache::londefdef::description=();
    $Apache::londefdef::DD_redirection=0;
    $Apache::londefdef::DT_redirection=0;
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 sub end_dl {  sub end_dl {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\end{description}';     if ($Apache::londefdef::DT_redirection) {
       my $data=&item_cleanup;
       push @Apache::londefdef::description,'\item['.$data.']';
       $Apache::londefdef::DT_redirection=0;
    } elsif ($Apache::londefdef::DD_redirection) {
       $Apache::londefdef::description[-1].=&Apache::lonxml::endredirection();
    }
    foreach my $element (@Apache::londefdef::description) {
       $currentstring.=' '.$element.' ';
    }
    @Apache::londefdef::description=();
    $currentstring.='\end{description}';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 #-- <dt> tag  #-- <dt> tag (end tag optional)
 sub start_dt {  sub start_dt {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring='';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\item[';     if ($Apache::londefdef::DT_redirection) {
       my $data=&item_cleanup;
       push @Apache::londefdef::description,'\item['.$data.']';
       $Apache::londefdef::DT_redirection=0;
    } elsif ($Apache::londefdef::DD_redirection) {
       $Apache::londefdef::description[-1].=&Apache::lonxml::endredirection();
       $Apache::londefdef::DD_redirection=0;
    }
    &Apache::lonxml::startredirection();
    $Apache::londefdef::DT_redirection=1;
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 sub end_dt {  sub end_dt {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];       $currentstring = $token->[2];    
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = ']';     my $data=&item_cleanup;
    push @Apache::londefdef::description,'\item['.$data.']';
    $Apache::londefdef::DT_redirection=0;
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
   sub item_cleanup {
       my $item=&Apache::lonxml::endredirection();
       $item=~s/\\begin{center}//g;
       $item=~s/\\end{center}//g;
       return $item;
   }
   
 #-- <dd> tag  #-- <dd> tag
 sub start_dd {  sub start_dd {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
Line 1680  sub start_dd { Line 1716  sub start_dd {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  if ($$tagstack[-2] eq 'dl') {   if ($Apache::londefdef::DT_redirection) {
     $currentstring = ' \item [] ';        my $data=&item_cleanup;
  } elsif ($$tagstack[-2] eq 'dt') {      push @Apache::londefdef::description,'\item['.$data.']';
     $currentstring = ']';       $Apache::londefdef::DT_redirection=0;
  }   }
    $Apache::londefdef::DD_redirection=1;
    &Apache::lonxml::startredirection();
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 sub end_dd {  sub end_dd {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];       $currentstring = $token->[2];    
     }       }  elsif ($target eq 'tex') {
    $Apache::londefdef::description[-1].=&Apache::lonxml::endredirection();
    $Apache::londefdef::DD_redirection=0;
       }
     return $currentstring;      return $currentstring;
 }  }
   
Line 2161  sub start_applet { Line 2202  sub start_applet {
     $currentstring='[APPLET: '.$alttag.']';      $currentstring='[APPLET: '.$alttag.']';
  }   }
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\begin{figure} ";   my $code=&Apache::lonxml::get_param('code',$parstack,$safeeval,
          undef,1);
    if ($code=~/TrueFalse\.class/) {
       $currentstring.='\begin{center} $\bigcirc$ True \hskip 10 mm  $\bigcirc$ False\end{center}';
    }
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2172  sub end_applet { Line 2217  sub end_applet {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];   $currentstring = $token->[2];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\end{figure}";  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2195  sub start_embed { Line 2239  sub start_embed {
     $currentstring='[EMBED: '.$alttag.']';      $currentstring='[EMBED: '.$alttag.']';
  }   }
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\begin{figure} ";    
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2205  sub end_embed { Line 2248  sub end_embed {
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {  
  $currentstring = " \\end{figure}";    
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2225  sub start_param { Line 2267  sub start_param {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\begin{figure} ";    
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2236  sub end_param { Line 2277  sub end_param {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\end{figure}";    
     }       } 
     return $currentstring;      return $currentstring;
 }  }

Removed from v.1.167  
changed lines
  Added in v.1.175


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