version 1.178, 2003/10/01 21:13:50
|
version 1.189, 2003/10/24 21:48:17
|
Line 50 use Apache::File();
|
Line 50 use Apache::File();
|
use Image::Magick; |
use Image::Magick; |
use Apache::lonmenu(); |
use Apache::lonmenu(); |
use Apache::lonmeta(); |
use Apache::lonmeta(); |
|
use Apache::Constants qw(:common); |
|
|
$Apache::londefdef::TD_redirection=0; |
|
|
|
BEGIN { |
BEGIN { |
|
|
Line 59 BEGIN {
|
Line 59 BEGIN {
|
|
|
} |
} |
|
|
|
sub initialize_londefdef { |
|
$Apache::londefdef::TD_redirection=0; |
|
@Apache::londefdef::table = (); |
|
$Apache::londefdef::select=0; |
|
@Apache::londefdef::description=(); |
|
$Apache::londefdef::DD_redirection=0; |
|
$Apache::londefdef::DT_redirection=0; |
|
} |
|
|
#======================= TAG SUBROUTINES ===================== |
#======================= TAG SUBROUTINES ===================== |
#-- <output> |
#-- <output> |
sub start_output { |
sub start_output { |
Line 140 sub end_tthoption {
|
Line 149 sub end_tthoption {
|
return $result; |
return $result; |
} |
} |
|
|
#-- <html> tag |
#-- <html> tag (end tag optional) |
sub start_html { |
sub start_html { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 159 sub start_html {
|
Line 168 sub start_html {
|
&tth::tthoptions('-L -u0'); |
&tth::tthoptions('-L -u0'); |
} |
} |
} |
} |
if ($target eq 'web') { |
if ($target eq 'web' || $target eq 'edit') { |
$currentstring = &Apache::lonxml::xmlbegin(). |
$currentstring = &Apache::lonxml::xmlbegin(). |
&Apache::lonxml::fontsettings(); |
&Apache::lonxml::fontsettings(); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
Line 188 sub end_html {
|
Line 197 sub end_html {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <head> tag |
#-- <head> tag (end tag optional) |
sub start_head { |
sub start_head { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 201 sub start_head {
|
Line 210 sub start_head {
|
sub end_head { |
sub end_head { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web' && $ENV{'request.state'} eq 'published') { |
$currentstring = &Apache::lonmenu::registerurl(undef,$target). |
$currentstring = &Apache::lonmenu::registerurl(undef,$target). |
$token->[2]; |
$token->[2]; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <map> tag |
#-- <map> tag (end tag required) |
sub start_map { |
sub start_map { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 227 sub end_map {
|
Line 236 sub end_map {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <select> tag |
#-- <select> tag (end tag required) |
sub start_select { |
sub start_select { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} |
} elsif ($target eq 'tex') { |
|
$Apache::londefdef::select=0; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 246 sub end_select {
|
Line 257 sub end_select {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <option> tag |
#-- <option> tag (end tag optional) |
sub start_option { |
sub start_option { |
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') { |
|
$Apache::londefdef::select++; |
|
if ($Apache::londefdef::select == 1) { |
|
$currentstring='\noindent\fbox{'.&Apache::lonxml::get_param('value',$parstack,$safeeval).'}\keephidden{'; |
|
} else { |
|
$currentstring='\keephidden{'; |
|
} |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 261 sub end_option {
|
Line 279 sub end_option {
|
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} |
} elsif ($target eq 'tex') { |
|
$currentstring='}'; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <input> tag |
#-- <input> tag (end tag forbidden) |
sub start_input { |
sub start_input { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 284 sub end_input {
|
Line 304 sub end_input {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <textarea> tag |
#-- <textarea> tag (end tag required) |
sub start_textarea { |
sub start_textarea { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 303 sub end_textarea {
|
Line 323 sub end_textarea {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <form> tag |
#-- <form> tag (end tag required) |
sub start_form { |
sub start_form { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 322 sub end_form {
|
Line 342 sub end_form {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <title> tag |
#-- <title> tag (end tag required) |
sub start_title { |
sub start_title { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 333 sub start_title {
|
Line 353 sub start_title {
|
} |
} |
if ($target eq 'meta') { |
if ($target eq 'meta') { |
$currentstring='<title>'; |
$currentstring='<title>'; |
&start_output(); |
&start_output($target); |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 347 sub end_title {
|
Line 367 sub end_title {
|
$currentstring .= '}'; |
$currentstring .= '}'; |
} |
} |
if ($target eq 'meta') { |
if ($target eq 'meta') { |
&end_output(); |
&end_output($target); |
$currentstring='</title>'; |
$currentstring='</title>'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <meta> tag |
#-- <meta> tag (end tag forbidden) |
sub start_meta { |
sub start_meta { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 467 sub end_accessrule {
|
Line 487 sub end_accessrule {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <body> tag |
#-- <body> tag (end tag required) |
sub start_body { |
sub start_body { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 476 sub start_body {
|
Line 496 sub start_body {
|
&Apache::lonxml::warning("<body> tag found inside of <problem> tag this can cause problems."); |
&Apache::lonxml::warning("<body> tag found inside of <problem> tag this can cause problems."); |
return ''; |
return ''; |
} |
} |
if (!$Apache::lonxml::registered) { |
if (!$Apache::lonxml::registered && |
|
$ENV{'request.state'} eq 'published') { |
$currentstring.='<head>'. |
$currentstring.='<head>'. |
&Apache::lonmenu::registerurl(undef,$target).'</head>'; |
&Apache::lonmenu::registerurl(undef,$target).'</head>'; |
} |
} |
Line 552 sub end_body {
|
Line 573 sub end_body {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <center> tag |
#-- <center> tag (end tag required) |
sub start_center { |
sub start_center { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 575 sub end_center {
|
Line 596 sub end_center {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <b> tag |
#-- <b> tag (end tag required) |
sub start_b { |
sub start_b { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 598 sub end_b {
|
Line 619 sub end_b {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <strong> tag |
#-- <strong> tag (end tag required) |
sub start_strong { |
sub start_strong { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 613 sub start_strong {
|
Line 634 sub start_strong {
|
sub end_strong { |
sub end_strong { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
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 = '}'; |
$currentstring = '}'; |
Line 622 sub end_strong {
|
Line 642 sub end_strong {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <h1> tag |
#-- <h1> tag (end tag required) |
sub start_h1 { |
sub start_h1 { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 643 sub start_h1 {
|
Line 663 sub start_h1 {
|
$currentstring .= $pre.'{\\'.$TeXsize.' \textbf{'; |
$currentstring .= $pre.'{\\'.$TeXsize.' \textbf{'; |
} elsif ($target eq 'meta') { |
} elsif ($target eq 'meta') { |
$currentstring='<subject>'; |
$currentstring='<subject>'; |
&start_output(); |
&start_output($target); |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 665 sub end_h1 {
|
Line 685 sub end_h1 {
|
} |
} |
$currentstring .= '}}'.$post; |
$currentstring .= '}}'.$post; |
} elsif ($target eq 'meta') { |
} elsif ($target eq 'meta') { |
&end_output(); |
&end_output($target); |
$currentstring='</subject>'; |
$currentstring='</subject>'; |
} |
} |
return $currentstring; |
return $currentstring; |
Line 886 sub end_h6 {
|
Line 906 sub end_h6 {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#--- <cite> tag |
#--- <cite> tag (end tag required) |
sub start_cite { |
sub start_cite { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
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 .= "\\textit{"; |
$currentstring .= '\textit{'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 904 sub end_cite {
|
Line 924 sub end_cite {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "}"; |
$currentstring .= '}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <i> tag |
#-- <i> tag (end tag required) |
sub start_i { |
sub start_i { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 932 sub end_i {
|
Line 952 sub end_i {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <address> tag |
#-- <address> tag (end tag required) |
sub start_address { |
sub start_address { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
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 .= "\\textit{"; |
$currentstring .= '\textit{'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 950 sub end_address {
|
Line 970 sub end_address {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "}"; |
$currentstring .= '}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <dfn> tag |
#-- <dfn> tag (end tag required) |
sub start_dfn { |
sub start_dfn { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
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 .= "\\textit{"; |
$currentstring .= '\textit{'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 973 sub end_dfn {
|
Line 993 sub end_dfn {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "}"; |
$currentstring .= '}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <tt> tag |
#-- <tt> tag (end tag required) |
sub start_tt { |
sub start_tt { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1001 sub end_tt {
|
Line 1021 sub end_tt {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <kbd> tag |
#-- <kbd> tag (end tag required) |
sub start_kbd { |
sub start_kbd { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
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 .= "\\texttt"; |
$currentstring .= '\texttt{'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1019 sub end_kbd {
|
Line 1039 sub end_kbd {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "}"; |
$currentstring .= '}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <code> tag |
#-- <code> tag (end tag required) |
sub start_code { |
sub start_code { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1047 sub end_code {
|
Line 1067 sub end_code {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <em> tag |
#-- <em> tag (end tag required) |
sub start_em { |
sub start_em { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1070 sub end_em {
|
Line 1090 sub end_em {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <q> tag |
#-- <q> tag (end tag required) |
sub start_q { |
sub start_q { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
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 .= "\\emph{"; |
$currentstring .= '\emph{'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1088 sub end_q {
|
Line 1108 sub end_q {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "}"; |
$currentstring .= '}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <p> tag |
#-- <p> tag (end tag optional) |
sub start_p { |
sub start_p { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1116 sub end_p {
|
Line 1136 sub end_p {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <br> tag |
#-- <br> tag (end tag forbidden) |
sub start_br { |
sub start_br { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1139 sub end_br {
|
Line 1159 sub end_br {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <big> tag |
#-- <big> tag (end tag required) |
sub start_big { |
sub start_big { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1162 sub end_big {
|
Line 1182 sub end_big {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <small> tag |
#-- <small> tag (end tag required) |
sub start_small { |
sub start_small { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1185 sub end_small {
|
Line 1205 sub end_small {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <basefont> tag |
#-- <basefont> tag (end tag forbidden) |
sub start_basefont { |
sub start_basefont { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1214 sub end_basefont {
|
Line 1234 sub end_basefont {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <font> tag |
#-- <font> tag (end tag required) |
sub start_font { |
sub start_font { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1252 sub end_font {
|
Line 1272 sub end_font {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <strike> tag |
#-- <strike> tag (end tag required) |
sub start_strike { |
sub start_strike { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1278 sub end_strike {
|
Line 1298 sub end_strike {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <s> tag |
#-- <s> tag (end tag required) |
sub start_s { |
sub start_s { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1304 sub end_s {
|
Line 1324 sub end_s {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <sub> tag |
#-- <sub> tag (end tag required) |
sub start_sub { |
sub start_sub { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
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 .= "\$_{ "; |
$currentstring .= "\$_{"; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1322 sub end_sub {
|
Line 1342 sub end_sub {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= " }\$"; |
$currentstring .= "}\$"; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <sup> tag |
#-- <sup> tag (end tag required) |
sub start_sup { |
sub start_sup { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
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 .= "\$^{ "; |
$currentstring .= "\$^{"; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1345 sub end_sup {
|
Line 1365 sub end_sup {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= " }\$"; |
$currentstring .= "}\$"; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <hr> tag |
#-- <hr> tag (end tag forbidden) |
sub start_hr { |
sub start_hr { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1390 sub end_hr {
|
Line 1410 sub end_hr {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <div> tag |
#-- <div> tag (end tag required) |
sub start_div { |
sub start_div { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1409 sub end_div {
|
Line 1429 sub end_div {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <a> tag |
#-- <a> tag (end tag required) |
sub start_a { |
sub start_a { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1439 sub end_a {
|
Line 1459 sub end_a {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <li> tag |
#-- <li> tag (end tag optional) |
sub start_li { |
sub start_li { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1469 sub end_li {
|
Line 1489 sub end_li {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <u> tag |
#-- <u> tag (end tag required) |
sub start_u { |
sub start_u { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1495 sub end_u {
|
Line 1515 sub end_u {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <ul> tag |
#-- <ul> tag (end tag required) |
sub start_ul { |
sub start_ul { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1538 sub end_ul {
|
Line 1558 sub end_ul {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <menu> tag |
#-- <menu> tag (end tag required) |
sub start_menu { |
sub start_menu { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1561 sub end_menu {
|
Line 1581 sub end_menu {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <dir> tag |
#-- <dir> tag (end tag required) |
sub start_dir { |
sub start_dir { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1584 sub end_dir {
|
Line 1604 sub end_dir {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <ol> tag |
#-- <ol> tag (end tag required) |
sub start_ol { |
sub start_ol { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1637 sub end_ol {
|
Line 1657 sub end_ol {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <dl> tag |
#-- <dl> tag (end tag required) |
sub start_dl { |
sub start_dl { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1715 sub item_cleanup {
|
Line 1735 sub item_cleanup {
|
return $item; |
return $item; |
} |
} |
|
|
#-- <dd> tag |
#-- <dd> tag (end tag optional) |
sub start_dd { |
sub start_dd { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 1745 sub end_dd {
|
Line 1765 sub end_dd {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <table> tag |
#-- <table> tag (end tag required) |
sub start_table { |
sub start_table { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $textwidth=''; |
my $textwidth=''; |
Line 1983 sub end_td_tex {
|
Line 2003 sub end_td_tex {
|
$newdata=~s/\\vskip \d*\.?\d*\s*mm/THISISJUSTTEMPORARYSEPARATOR/g; |
$newdata=~s/\\vskip \d*\.?\d*\s*mm/THISISJUSTTEMPORARYSEPARATOR/g; |
my @newdata=split(/THISISJUSTTEMPORARYSEPARATOR/,$newdata); |
my @newdata=split(/THISISJUSTTEMPORARYSEPARATOR/,$newdata); |
foreach my $elementdata (@newdata) { |
foreach my $elementdata (@newdata) { |
$elementdata=~s/^\s+(\S.*)/$1/; |
my $lengthnewdata=1.8*LATEX_length($elementdata); |
$elementdata=~s/(.*\S)\s+$/$1/; |
|
$elementdata=~s/(\s)+/$1/; |
|
my $lengthnewdata=1.8*length($elementdata); |
|
if ($lengthnewdata>$current_length) {$current_length=$lengthnewdata;} |
if ($lengthnewdata>$current_length) {$current_length=$lengthnewdata;} |
} |
} |
} else { |
} else { |
$current_length=1.8*length($data); |
$current_length=1.8*LATEX_length($data); |
} |
} |
$Apache::londefdef::table[-1]{'length'} .= $current_length.','; |
$Apache::londefdef::table[-1]{'length'} .= $current_length.','; |
$Apache::londefdef::table[-1]{'TeXlength'} .= '0,'; |
$Apache::londefdef::table[-1]{'TeXlength'} .= '0,'; |
Line 2071 sub end_th {
|
Line 2088 sub end_th {
|
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
#-- <img> tag |
#-- <img> tag (end tag forbidden) |
sub start_img { |
sub start_img { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval, |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval, |
undef,1); |
undef,1); |
|
if (not $src and ($target eq 'web' or $target eq 'tex')) { |
|
my $inside = &Apache::lonxml::get_all_text("/img",$parser); |
|
&Apache::lonnet::logthis("inside was $inside"); |
|
return ''; |
|
} |
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=$src; |
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=$src; |
my $currentstring = ''; |
my $currentstring = ''; |
my $width_param = ''; |
my $width_param = ''; |
Line 2151 sub start_img {
|
Line 2173 sub start_img {
|
my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat"; |
my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat"; |
$temp_file = Apache::File->new('>>'.$filename); |
$temp_file = Apache::File->new('>>'.$filename); |
print $temp_file "$src\n"; |
print $temp_file "$src\n"; |
$currentstring .= '\vskip 1 mm \graphicspath{{/home/httpd/prtspool/}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; |
$newsrc=~s/\/home\/httpd\/html\/res//; |
|
$newsrc=~s/\/([^\/]+)\.(ps|eps)/\//; |
|
$currentstring .= '\vskip 1 mm \graphicspath{{/home/httpd/prtspool'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; |
} |
} |
} |
} |
} else { |
} else { |
Line 2168 sub start_img {
|
Line 2192 sub start_img {
|
#<allow> tag will care about replication |
#<allow> tag will care about replication |
} |
} |
} |
} |
|
} elsif ($target eq 'edit') { |
|
$currentstring .=&Apache::edit::tag_start($target,$token); |
|
$currentstring .=&Apache::edit::text_arg('Image Url:','src',$token,70). |
|
&Apache::edit::browse('src',undef,'alt').' '. |
|
&Apache::edit::search('src',undef,'alt').'<br />'; |
|
$currentstring .=&Apache::edit::text_arg('Description:','alt',$token,70).'<br />'; |
|
$currentstring .=&Apache::edit::text_arg('width (pixel):','width',$token,5); |
|
$currentstring .=&Apache::edit::text_arg('height (pixel):','height',$token,5).'<br />'; |
|
$currentstring .=&Apache::edit::text_arg('TeXwidth (mm):','TeXwidth',$token,5); |
|
$currentstring .=&Apache::edit::text_arg('TeXheight (mm):','TeXheight',$token,5); |
|
$currentstring .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
|
my $src=&Apache::lonxml::get_param('src',$parstack,$safeeval); |
|
my $alt=&Apache::lonxml::get_param('alt',$parstack,$safeeval); |
|
my $width=&Apache::lonxml::get_param('width',$parstack,$safeeval); |
|
my $height=&Apache::lonxml::get_param('height',$parstack,$safeeval); |
|
$currentstring .= '<img src="'.$src.'" alt="'.$alt.'" '; |
|
if ($width) { $currentstring.=' width="'.$width.'" '; } |
|
if ($height) { $currentstring.=' height="'.$height.'" '; } |
|
$currentstring .= ' />'; |
|
} elsif ($target eq 'modified') { |
|
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
|
$safeeval,'src','alt', |
|
'TeXwidth','TeXheight', |
|
'width','height'); |
|
$src=$token->[2]{'src'}; |
|
if (!$token->[2]{'width'} && !$token->[2]{'height'}) { |
|
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); |
|
&image_replication($src); |
|
if (-e $src) { |
|
my $image = Image::Magick->new; |
|
my ($width, $height, $size, $format) = $image->Ping($src); |
|
if ($width && $height) { |
|
$token->[2]{'width'} =$width; |
|
$token->[2]{'height'}=$height; |
|
$constructtag=1; |
|
} |
|
} |
|
} |
|
if ($constructtag) {$currentstring=&Apache::edit::rebuild_tag($token);} |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 2183 sub end_img {
|
Line 2246 sub end_img {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <applet> tag |
#-- <applet> tag (end tag required) |
sub start_applet { |
sub start_applet { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
|
|
Line 2232 sub end_applet {
|
Line 2295 sub end_applet {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <embed> tag |
#-- <embed> tag (end tag optional/required) |
sub start_embed { |
sub start_embed { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $src=&Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1); |
my $src=&Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1); |
Line 2264 sub end_embed {
|
Line 2327 sub end_embed {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <param> tag |
#-- <param> tag (end tag forbidden) |
sub start_param { |
sub start_param { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
if (&Apache::lonxml::get_param |
if (&Apache::lonxml::get_param |
Line 2319 sub end_allow {
|
Line 2382 sub end_allow {
|
return ''; |
return ''; |
} |
} |
|
|
#-- Frames |
#-- Frames (end tag required) |
|
#-- <frameset> |
sub start_frameset { |
sub start_frameset { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
if (!$Apache::lonxml::registered) { |
if (!$Apache::lonxml::registered && |
|
$ENV{'request.state'} eq 'published') { |
$currentstring.='<head>'. |
$currentstring.='<head>'. |
&Apache::lonmenu::registerurl(undef,$target).'</head>'; |
&Apache::lonmenu::registerurl(undef,$target).'</head>'; |
} |
} |
Line 2364 sub end_frameset {
|
Line 2429 sub end_frameset {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <xmp> |
#-- <xmp> (end tag required) |
sub start_xmp { |
sub start_xmp { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2387 sub end_xmp {
|
Line 2452 sub end_xmp {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <pre> |
#-- <pre> (end tag required) |
sub start_pre { |
sub start_pre { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2470 sub end_blankspace {
|
Line 2535 sub end_blankspace {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <abbr> tag |
#-- <abbr> tag (end tag required) |
sub start_abbr { |
sub start_abbr { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2489 sub end_abbr {
|
Line 2554 sub end_abbr {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <acronym> tag |
#-- <acronym> tag (end tag required) |
sub start_acronym { |
sub start_acronym { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2508 sub end_acronym {
|
Line 2573 sub end_acronym {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <area> tag |
#-- <area> tag (end tag forbidden) |
sub start_area { |
sub start_area { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2527 sub end_area {
|
Line 2592 sub end_area {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <base> tag |
#-- <base> tag (end tag forbidden) |
sub start_base { |
sub start_base { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2546 sub end_base {
|
Line 2611 sub end_base {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <bdo> tag |
#-- <bdo> tag (end tag required) |
sub start_bdo { |
sub start_bdo { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2565 sub end_bdo {
|
Line 2630 sub end_bdo {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <bgsound> tag |
#-- <bgsound> tag (end tag optional) |
sub start_bgsound { |
sub start_bgsound { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2584 sub end_bgsound {
|
Line 2649 sub end_bgsound {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <blink> tag |
#-- <blink> tag (end tag required) |
sub start_blink { |
sub start_blink { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2603 sub end_blink {
|
Line 2668 sub end_blink {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <blockquote> tag |
#-- <blockquote> tag (end tag required) |
sub start_blockquote { |
sub start_blockquote { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2622 sub end_blockquote {
|
Line 2687 sub end_blockquote {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <button> tag |
#-- <button> tag (end tag required) |
sub start_button { |
sub start_button { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2641 sub end_button {
|
Line 2706 sub end_button {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <caption> tag |
#-- <caption> tag (end tag required) |
sub start_caption { |
sub start_caption { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2660 sub end_caption {
|
Line 2725 sub end_caption {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <col> tag |
#-- <col> tag (end tag forbdden) |
sub start_col { |
sub start_col { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2679 sub end_col {
|
Line 2744 sub end_col {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <colgroup> tag |
#-- <colgroup> tag (end tag optional) |
sub start_colgroup { |
sub start_colgroup { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2698 sub end_colgroup {
|
Line 2763 sub end_colgroup {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <del> tag |
#-- <del> tag (end tag required) |
sub start_del { |
sub start_del { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2717 sub end_del {
|
Line 2782 sub end_del {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <fieldset> tag |
#-- <fieldset> tag (end tag required) |
sub start_fieldset { |
sub start_fieldset { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2736 sub end_fieldset {
|
Line 2801 sub end_fieldset {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <frame> tag |
#-- <frame> tag (end tag forbidden) |
sub start_frame { |
sub start_frame { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2755 sub end_frame {
|
Line 2820 sub end_frame {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <iframe> tag |
#-- <iframe> tag (end tag required) |
sub start_iframe { |
sub start_iframe { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2774 sub end_iframe {
|
Line 2839 sub end_iframe {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <ins> tag |
#-- <ins> tag (end tag required) |
sub start_ins { |
sub start_ins { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2793 sub end_ins {
|
Line 2858 sub end_ins {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <isindex> tag |
#-- <isindex> tag (end tag forbidden) |
sub start_isindex { |
sub start_isindex { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2812 sub end_isindex {
|
Line 2877 sub end_isindex {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <keygen> tag |
#-- <keygen> tag (end tag forbidden) |
sub start_keygen { |
sub start_keygen { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2850 sub end_label {
|
Line 2915 sub end_label {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <layer> tag |
#-- <layer> tag (end tag required) |
sub start_layer { |
sub start_layer { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2869 sub end_layer {
|
Line 2934 sub end_layer {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <legend> tag |
#-- <legend> tag (end tag required) |
sub start_legend { |
sub start_legend { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2888 sub end_legend {
|
Line 2953 sub end_legend {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <link> tag |
#-- <link> tag (end tag forbidden) |
sub start_link { |
sub start_link { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2907 sub end_link {
|
Line 2972 sub end_link {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <marquee> tag |
#-- <marquee> tag (end tag optional) |
sub start_marquee { |
sub start_marquee { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2926 sub end_marquee {
|
Line 2991 sub end_marquee {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <malticol> tag |
#-- <multicol> tag (end tag required) |
sub start_malticol { |
sub start_multicol { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
Line 2936 sub start_malticol {
|
Line 3001 sub start_malticol {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
sub end_malticol { |
sub end_multicol { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
Line 2945 sub end_malticol {
|
Line 3010 sub end_malticol {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <nobr> tag |
#-- <nobr> tag (end tag required) |
sub start_nobr { |
sub start_nobr { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} |
} elsif ($target eq 'tex') { |
|
$currentstring='\mbox{'; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 2960 sub end_nobr {
|
Line 3027 sub end_nobr {
|
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} |
} elsif ($target eq 'tex') { |
|
$currentstring='}'; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <noembed> tag |
#-- <noembed> tag (end tag required) |
sub start_noembed { |
sub start_noembed { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 2983 sub end_noembed {
|
Line 3052 sub end_noembed {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <noframes> tag |
#-- <noframes> tag (end tag required) |
sub start_noframes { |
sub start_noframes { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 3002 sub end_noframes {
|
Line 3071 sub end_noframes {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <nolayer> tag |
#-- <nolayer> tag (end tag required) |
sub start_nolayer { |
sub start_nolayer { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 3021 sub end_nolayer {
|
Line 3090 sub end_nolayer {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <noscript> tag |
#-- <noscript> tag (end tag required) |
sub start_noscript { |
sub start_noscript { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 3040 sub end_noscript {
|
Line 3109 sub end_noscript {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <object> tag |
#-- <object> tag (end tag required) |
sub start_object { |
sub start_object { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 3059 sub end_object {
|
Line 3128 sub end_object {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <optgroup> tag |
#-- <optgroup> tag (end tag required) |
sub start_optgroup { |
sub start_optgroup { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 3078 sub end_optgroup {
|
Line 3147 sub end_optgroup {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <samp> tag |
#-- <samp> tag (end tag required) |
sub start_samp { |
sub start_samp { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} |
} elsif ($target eq 'tex') { |
|
$currentstring='\texttt{'; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 3093 sub end_samp {
|
Line 3164 sub end_samp {
|
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} |
} elsif ($target eq 'tex') { |
|
$currentstring='}'; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 3116 sub end_server {
|
Line 3189 sub end_server {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <spacer> tag |
#-- <spacer> tag (end tag forbidden) |
sub start_spacer { |
sub start_spacer { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 3135 sub end_spacer {
|
Line 3208 sub end_spacer {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <span> tag |
#-- <span> tag (end tag required) |
sub start_span { |
sub start_span { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 3154 sub end_span {
|
Line 3227 sub end_span {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
#-- <tbody> tag |
#-- <tbody> tag (end tag optional) |
sub start_tbody { |
sub start_tbody { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
Line 3274 sub end_hideweboutput {
|
Line 3347 sub end_hideweboutput {
|
|
|
sub image_replication { |
sub image_replication { |
my $src = shift; |
my $src = shift; |
if (not -e $src) { |
if (not -e $src) { &Apache::lonnet::repcopy($src); } |
#replicates image itself |
#replicates eps or ps |
&Apache::lonnet::repcopy($src); |
my $epssrc = my $pssrc = $src; |
#replicates eps or ps |
$epssrc =~ s/\.(gif|jpg|jpeg|png)$/.eps/i; |
my $newsrc = $src; |
$pssrc =~ s/\.(gif|jpg|jpeg|png)$/.ps/i; |
$newsrc =~ s/\.(gif|jpg|jpeg|png)$/.eps/i; |
if (not -e $epssrc && not -e $pssrc) { |
if (not -e $newsrc) { |
my $result=&Apache::lonnet::repcopy($epssrc); |
if (&Apache::lonnet::repcopy($newsrc) ne 'OK') { |
if ($result ne OK) { &Apache::lonnet::repcopy($pssrc); } |
$newsrc =~ s/\.eps$/\.ps/; |
|
&Apache::lonnet::repcopy($newsrc); |
|
} |
|
} |
|
} |
} |
return ''; |
return ''; |
} |
} |
Line 3308 sub recalc {
|
Line 3377 sub recalc {
|
return $value.' mm'; |
return $value.' mm'; |
} |
} |
|
|
|
sub LATEX_length { |
|
my $garbage=shift; |
|
$garbage=~s/^\s+(\S.*)/$1/; |
|
$garbage=~s/(.*\S)\s+$/$1/; |
|
$garbage=~s/(\s)+/$1/; |
|
$garbage=~s/(\\begin{([^\}]+)}|\\end{([^\}]+)})//g; |
|
$garbage=~s/(\$\_\{|\$\_|\$\^{|\$\^|\}\$|\$)//g; |
|
$garbage=~s/(\\alpha|\\beta|\\gamma|\\delta|\\epsilon|\\verepsilon|\\zeta|\\eta|\\theta|\\vartheta|\\iota|\\kappa|\\lambda|\\mu|\\nu|\\xi|\\pi|\\varpi|\\rho|\\varrho|\\sigma|\\varsigma|\\tau|\\upsilon|\\phi|\\varphi|\\chi|\\psi|\\omega|\\Gamma|\\Delta|\\Theta|\\Lambda|\\Xi|\\Pi|\\Sigma|\\Upsilon|\\Phi|\\Psi|\\Omega)/1/g; |
|
$garbage=~s/(\\pm|\\mp|\\times|\\div|\\cdot|\\ast|\\star|\\dagger|\\ddagger|\\amalg|\\cap|\\cup|\\uplus|\\sqcap|\\sqcup|\\vee|\\wedge|\\oplus|\\ominus|\\otimes|\\circ|\\bullet|\\diamond|\\lhd|\\rhd|\\unlhd|\\unrhd|\\oslash|\\odot|\\bigcirc|\\Box|\\Diamond|\\bigtriangleup|\\bigtriangledown|\\triangleleft|\\triangleright|\\setminus|\\wr)/1/g; |
|
$garbage=~s/(\\le|\\ll|\\leq|\\ge|\\geq|\\gg|\\neq|\\doreq|\\sim|\\simeq|\\subset|\\subseteq|\\sqsubset|\\sqsubseteq|\\in|\\vdash|\\models|\\supset|\\supseteq|\\sqsupset|\\sqsupseteq|\\ni|\\dash|\\perp|\\approx|\\cong|\\equiv|\\propto|\\prec|\\preceq|\\parallel|\\asymp|\\smile|\\frown|\\bowtie|\\succ|\\succeq|\\mid)/1/g; |
|
$garbage=~s/(\\not<|\\\\not\\le|\\not\\prec|\\not\\preceq|\\not\\subset|\\not\\subseteq|\\not\\sqsubseteq|\\not\\in|\\not>|\\not\\ge|\\not\\succ|\\notsucceq|\\not\\supset|\\notsupseteq|\\not\\sqsupseteq|\\notin|\\not=|\\not\\equiv|\\not\\sim|\\not\\simeq|\\not\\approx|\\not\\cong|\\not\\asymp)/1/g; |
|
$garbage=~s/(\\leftarrow|\\gets|\\Leftarrow|\\rightarrow|\\to|\\Rightarrow|\\leftrightarrow|\\Leftrightarrow|\\mapsto|\\hookleftarrow|\\leftharpoonup|\\leftkarpoondown|\\rightleftharpoons|\\longleftarrow|\\Longleftarrow|\\longrightarrow|\\Longrightarrow|\\longleftrightarrow|\\Longleftrightarrow|\\longmapsto|\\hookrightarrow|\\rightharpoonup|\\rightharpoondown|\\uparrow|\\Uparrow|\\downarrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\nearrow|\\searrow|\\swarrow|\\nwarrow)/1/g; |
|
$garbage=~s/(\\aleph|\\hbar|\\imath|\\jmath|\\ell|\\wp|\\Re|\\Im|\\mho|\\prime|\\emptyset|\\nabla|\\surd|\\partial|\\top|\\bot|\\vdash|\\dashv|\\forall|\\exists|\\neg|\\flat|\\natural|\\sharp|\\\||\\angle|\\backslash|\\Box|\\Diamond|\\triangle|\\clubsuit|\\diamondsuit|\\heartsuit|\\spadesuit|\\Join|\\infty)/ /g; |
|
$garbage=~s/(\\hat{([^}]+)}|\\check{([^}]+)}|\\dot{([^}]+)}|\\breve{([^}]+)}|\\acute{([^}]+)}|\\ddot{([^}]+)}|\\grave{([^}]+)}|\\tilde{([^}]+)}|\\mathring{([^}]+)}|\\bar{([^}]+)}|\\vec{([^}]+)})/$1/g; |
|
my $value=length($garbage); |
|
return $value; |
|
} |
|
|
|
|
|
|
|
|
1; |
1; |
__END__ |
__END__ |