version 1.48, 2002/03/06 20:37:38
|
version 1.52, 2002/04/08 15:17:01
|
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 = ''; |
my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval); |
|
unless (defined $border) { $border = 0; } |
|
if ($border) { |
|
$Apache::londefdef::table{'hinc'} = '\hline '; |
|
$Apache::londefdef::table{'vinc'} = '&'; |
|
$Apache::londefdef::table{'vvinc'} = '|'; |
|
} else { |
|
$Apache::londefdef::table{'hinc'} = ''; |
|
$Apache::londefdef::table{'vinc'} = ''; |
|
$Apache::londefdef::table{'vvinc'} = ''; |
|
} |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1274 EDITBUTTON
|
Line 1284 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 = ''; |
} |
my $header_of_table = '{'.$Apache::londefdef::table{'vvinc'}; |
|
my $in; |
|
for ($in=0;$in<$Apache::londefdef::table{'counter_columns'};$in++) { |
|
$header_of_table .= @{ $Apache::londefdef::table{'columns'} }[$in].$Apache::londefdef::table{'vvinc'}; |
|
$output .= $Apache::londefdef::table{'rowdata'}[$in]; |
|
chop $output; |
|
$output .= ' \\\\ '; |
|
} |
|
$header_of_table .= '}'; |
|
$currentstring .= '\begin{tabular}'.$header_of_table.$output.$Apache::londefdef::table{'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::table{'rows'} }, substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1); |
|
} else { |
|
push @ {$Apache::londefdef::table{'rows'} }, 'c'; |
|
} |
|
push ( @{ $Apache::londefdef::table{'rowdata'} }, $Apache::londefdef::table{'hinc'}); |
|
$Apache::londefdef::table{'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 = ''; |
} |
} |
|
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::table{'rows'}[0],0,1);; |
|
} |
|
push @{ $Apache::londefdef::table{'columns'} }, $what_to_push; |
|
$Apache::londefdef::table{'counter_columns'}++; |
|
&Apache::lonxml::startredirection(); |
|
; |
} |
} |
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 = ''; |
my $current_row = $#{ $Apache::londedef::table{'rows'} }; |
|
my $data=&Apache::lonxml::endredirection(); |
|
@{ $Apache::londefdef::table{'rowdata'} }[$current_row] .= $data.' '.$Apache::londefdef::table{'vinc'}; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |