version 1.299, 2005/12/01 18:46:17
|
version 1.301, 2005/12/06 22:37:00
|
Line 48 use Apache::lonmenu();
|
Line 48 use Apache::lonmenu();
|
use Apache::lonmeta(); |
use Apache::lonmeta(); |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use File::Basename; |
use File::Basename; |
#use Data::Dumper; |
use Data::Dumper; |
|
|
BEGIN { |
BEGIN { |
|
|
Line 61 BEGIN {
|
Line 61 BEGIN {
|
# Need this 'cause evidently when given an array, Data::Dumper only seems |
# Need this 'cause evidently when given an array, Data::Dumper only seems |
# to dump element 0. |
# to dump element 0. |
# |
# |
#sub debug_dump_table { |
sub debug_dump_table { |
# my $lastrow = $#Apache::londefdef::table; |
my $lastrow = $#Apache::londefdef::table; |
# &Apache::lonnet::logthis("Dumping table: Last row index: $lastrow"); |
&Apache::lonnet::logthis("Dumping table: Last row index: $lastrow"); |
# my $row; |
my $row; |
# for ($row =0; $row <= $lastrow; $row++ ) { |
for ($row =0; $row <= $lastrow; $row++ ) { |
# my $text = Dumper($Apache::londefdef::table[$row]); |
my $text = Dumper($Apache::londefdef::table[$row]); |
# &Apache::lonnet::logthis("table [ $row ]".$text); |
&Apache::lonnet::logthis("table [ $row ]".$text); |
# |
|
# } |
|
#} |
|
|
|
|
} |
|
} |
sub initialize_londefdef { |
sub initialize_londefdef { |
$Apache::londefdef::TD_redirection=0; |
$Apache::londefdef::TD_redirection=0; |
@Apache::londefdef::table = (); |
@Apache::londefdef::table = (); |
Line 2218 sub end_table {
|
Line 2217 sub end_table {
|
my $min_nested_width = 0; |
my $min_nested_width = 0; |
my $max_nested_width = 0; |
my $max_nested_width = 0; |
for (my $col = 0; $col <= $Apache::londefdef::table[-1]{'counter_columns'}; $col++) { |
for (my $col = 0; $col <= $Apache::londefdef::table[-1]{'counter_columns'}; $col++) { |
|
|
$min_nested_width += $min_len[$col]; |
$min_nested_width += $min_len[$col]; |
$max_nested_width += $max_len[$col]; |
$max_nested_width += $max_len[$col]; |
|
|
} |
} |
# Fudge in an extra 5 mm for borders etc: |
# Fudge in an extra 5 mm for borders etc: |
|
|
Line 2262 sub start_tr {
|
Line 2261 sub start_tr {
|
push @ {$Apache::londefdef::table[-1]{'rows'} }, 'l'; |
push @ {$Apache::londefdef::table[-1]{'rows'} }, 'l'; |
} |
} |
push ( @{ $Apache::londefdef::table[-1]{'rowdata'} }, $Apache::londefdef::table[-1]{'hinc'}); |
push ( @{ $Apache::londefdef::table[-1]{'rowdata'} }, $Apache::londefdef::table[-1]{'hinc'}); |
|
# |
|
# Need to save the number of table columns to preserve the max # columns. |
|
# |
|
$Apache::londefdef::table[-1]{'prior_columns'} = $Apache::londefdef::table[-1]{'counter_columns'}; |
$Apache::londefdef::table[-1]{'counter_columns'} = -1; |
$Apache::londefdef::table[-1]{'counter_columns'} = -1; |
push @ {$Apache::londefdef::table[-1]{'TeXlen'}}, []; |
push @ {$Apache::londefdef::table[-1]{'TeXlen'}}, []; |
push @ {$Apache::londefdef::table[-1]{'objectlen'}}, []; |
push @ {$Apache::londefdef::table[-1]{'objectlen'}}, []; |
Line 2281 sub end_tr {
|
Line 2284 sub end_tr {
|
if ($Apache::londefdef::TD_redirection) { |
if ($Apache::londefdef::TD_redirection) { |
&end_td_tex($parstack,$parser,$safeeval); |
&end_td_tex($parstack,$parser,$safeeval); |
} |
} |
|
# Counter columns must be the maximum number of columns seen |
|
# in the table so far so: |
|
if ($Apache::londefdef::table[-1]{'prior_columns'} > $Apache::londefdef::table[-1]{'counter_columns'}) { |
|
$Apache::londefdef::table[-1]{'counter_columns'} = $Apache::londefdef::table[-1]{'prior_columns'}; |
|
} |
|
|
|
|
|
|
Line 2416 sub end_td_tex {
|
Line 2424 sub end_td_tex {
|
push @ {$Apache::londefdef::table[-1]{'minlen'}[$Apache::londefdef::table[-1]{'row_number'}] },$min_length; |
push @ {$Apache::londefdef::table[-1]{'minlen'}[$Apache::londefdef::table[-1]{'row_number'}] },$min_length; |
} |
} |
} |
} |
for (my $in=0; $in<=$#{$Apache::londefdef::table[-1]{'include'}};$in++) { |
for (my $in=0; $in<=$#{$Apache::londefdef::table[-1]{'include'}};$in++) { |
my $nested = $Apache::londefdef::table[-1]{'include'}[$in]; |
my $nested = shift @{$Apache::londefdef::table[-1]{'include'}}; |
&Apache::lonnet::logthis("Nested: $nested"); |
$nested =~ s/\\end\{tabular\}\\strut\\\\/\\end\{tabular\}/; |
$nested =~ s/\\end\{tabular\}\\strut\\\\/\\end\{tabular\}/; |
# $data=~s/\\keephidden\{NEW TABLE ENTRY\}/$Apache::londefdef::table[-1]{'include'}[$in]/; |
&Apache::lonnet::logthis("After sub: $nested"); |
$data =~ s/\\keephidden\{NEW TABLE ENTRY\}/$nested/; |
# $data=~s/\\keephidden\{NEW TABLE ENTRY\}/$Apache::londefdef::table[-1]{'include'}[$in]/; |
|
$data =~ s/\\keephidden\{NEW TABLE ENTRY\}/$nested/; |
} |
} |
# Should be be killing off the 'include' elements as they're used up? |
push @ {$Apache::londefdef::table[-1]{'content'}[-1] },$data; |
push @ {$Apache::londefdef::table[-1]{'content'}[-1] },$data; |
return''; |
return ''; |
} |
} |
|
|
sub end_td { |
sub end_td { |