version 1.48, 2002/03/06 20:37:38
|
version 1.51, 2002/04/05 18:11:11
|
Line 50 use Apache::lonxml;
|
Line 50 use Apache::lonxml;
|
|
|
BEGIN { |
BEGIN { |
|
|
&Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','tr','td','allow','frameset','pre','insert','externallink')); |
&Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','allow','frameset','pre','insert','externallink','table','tr','td')); |
|
|
} |
} |
|
|
Line 353 sub end_m {
|
Line 353 sub end_m {
|
if ($ENV{'request.state'} ne 'published') { |
if ($ENV{'request.state'} ne 'published') { |
$currentstring.=(<<EDITBUTTON); |
$currentstring.=(<<EDITBUTTON); |
<form method="post"> |
<form method="post"> |
<input type="submit" name="showmode" value="Edit" /> |
<input type="submit" name="editmode" value="Edit" /> |
</form> |
</form> |
EDITBUTTON |
EDITBUTTON |
} |
} |
Line 1259 EDITBUTTON
|
Line 1259 EDITBUTTON
|
} |
} |
#-- <table> tag |
#-- <table> tag |
sub start_table { |
sub start_table { |
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 = ''; |
&Apache::lonxml::startredirection; |
|
my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval); |
|
unless (defined $border) { $border = 0; } |
|
@Apache::londefdef::rows = (); |
|
@Apache::londefdef::columns = (); |
|
$Apache::londefdef::counter_columns = 0; |
|
$Apache::londefdef::hinc = ''; |
|
$Apache::londefdef::vinc = ''; |
|
$Apache::londefdef::vvinc = ''; |
|
if ($border) { |
|
$Apache::londefdef::hinc = '\hline '; |
|
$Apache::londefdef::vinc = '&'; |
|
$Apache::londefdef::vvinc = '|'; |
|
} |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1274 EDITBUTTON
|
Line 1287 EDITBUTTON
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = ''; |
my $output=&Apache::lonxml::endredirection; |
} |
$output =~ s/<\/td>\s*<td\s*([^>]*)>/$Apache::londefdef::vinc/g; |
|
$output =~ s/<td\s*([^>]*)>//g; |
|
$output =~ s/<\/td>//g; |
|
my $header_of_table = '{'.$Apache::londefdef::vvinc; |
|
my $in; |
|
for ($in=0;$in<$Apache::londefdef::counter_columns;$in++) { |
|
$header_of_table .= $Apache::londefdef::columns[$in].$Apache::londefdef::vvinc; |
|
} |
|
$header_of_table .= '}'; |
|
$currentstring .= '\begin{tabular}'.$header_of_table.$output.$Apache::londefdef::hinc.'\end{tabular}'; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
#-- <tr> tag |
#-- <tr> tag |
sub start_tr { |
sub start_tr { |
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 = ''; |
if (substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1) ne '') { |
|
push @Apache::londefdef::rows, substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1); |
|
} else { |
|
push @Apache::londefdef::rows, 'c'; |
|
} |
|
$currentstring = '\hline '; |
|
$Apache::londefdef::counter_columns = 0; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
sub end_tr { |
sub end_tr { |
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 = '\\\\'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
#-- <td> tag |
#-- <td> tag |
sub start_td { |
sub start_td { |
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 = ''; |
my $what_to_push = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1); |
|
if ($what_to_push eq '') { |
|
$what_to_push = substr($Apache::londefdef::rows[0],0,1); |
|
} |
|
push @Apache::londefdef::columns, $what_to_push; |
|
$Apache::londefdef::counter_columns++; |
|
$currentstring = $token->[4];; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
sub end_td { |
sub end_td { |
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 = $token->[2];; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |