[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm
foxr
lon-capa-cvs-allow@mail.lon-capa.org
Wed, 04 Jul 2007 14:02:16 -0000
foxr Wed Jul 4 10:02:16 2007 EDT
Modified files:
/loncom/xml londefdef.pm
Log:
BZ5283 - only put |'s in if borders are on.
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.371 loncom/xml/londefdef.pm:1.372
--- loncom/xml/londefdef.pm:1.371 Mon Jun 25 21:36:48 2007
+++ loncom/xml/londefdef.pm Wed Jul 4 10:02:14 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.371 2007/06/26 01:36:48 albertel Exp $
+# $Id: londefdef.pm,v 1.372 2007/07/04 14:02:14 foxr Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -2066,6 +2066,7 @@
if ($target eq 'web' || $target eq 'webgrade') {
$currentstring = $token->[2];
} elsif ($target eq 'tex') {
+ my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval);
my $inmemory = '';
my $output = '';
my $WARNING='';
@@ -2313,6 +2314,10 @@
# Do the appropriate magic if this has a colspan
#
+ my $border_char = "";
+ if ($border) {
+ $border_char = "|";
+ }
my $spanwidth = 0;
if ($colspan > 1) {
for (my $spancol = $jn; $spancol < $jn + $colspan; $spancol++) {
@@ -2322,12 +2327,12 @@
$colspan
."}";
if ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'c') {
- $output .= '{|c|}{';
+ $output .= '{'.$border_char.'c'.$border_char.'}{';
} elsif ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'r') {
- $output .= '{|r|}{';
+ $output .= '{'.$border_char.'r'.$border_char.'}{';
}
else {
- $output .= "{|p{$spanwidth mm}|}{";
+ $output .= '{'.$border_char."p{$spanwidth mm}".$border_char.'}{';
}
} else {
@@ -2343,10 +2348,10 @@
if ($rowspan > 1) {
if ($colspan == 1) {
if ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'c') {
- $output .= '\multicolumn{1}{|c|}{';
+ $output .= '\multicolumn{1}{'.$border_char.'c'.$border_char.'}{';
$multirow_aligned = 1;
} elsif ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'r') {
- $output .= '\multicolumn{1}{|r|}{';
+ $output .= '\multicolumn{1}{'.$border_char.'r'.$border_char.'}{';
$multirow_aligned = 1;
}
}
@@ -2383,9 +2388,9 @@
#
if ($colspan == 1 && $rowspan == 1) {
if ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'c') {
- $output .= '\multicolumn{1}{|c|}{';
+ $output .= '\multicolumn{1}{'.$border_char.'c'.$border_char.'}{';
} elsif ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'r') {
- $output .= '\multicolumn{1}{|r|}{';
+ $output .= '\multicolumn{1}{'.$border_char.'r'.$border_char.'}{';
}
}