[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /xml londefdef.pm

raeburn raeburn at source.lon-capa.org
Tue Nov 15 12:34:19 EST 2011


raeburn		Tue Nov 15 17:34:19 2011 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/xml	londefdef.pm 
  Log:
  - Backport 1.430. (bug 6317).
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.415.4.5 loncom/xml/londefdef.pm:1.415.4.6
--- loncom/xml/londefdef.pm:1.415.4.5	Thu Oct  6 22:18:59 2011
+++ loncom/xml/londefdef.pm	Tue Nov 15 17:34:19 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.415.4.5 2011/10/06 22:18:59 raeburn Exp $
+# $Id: londefdef.pm,v 1.415.4.6 2011/11/15 17:34:19 raeburn Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -3830,11 +3830,32 @@
 
 #-- <colgroup> tag (end tag optional)
 sub start_colgroup {
-    my ($target,$token) = @_;
+    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
-    } 
+    }
+    if ($target eq 'tex') {
+        # TODO: Ensure this tag is in a table:
+
+        # Fetch the attributes and build the hash for the
+        # call to define_colgroup.
+
+        my $span    = &Apache::lonxml::get_param('span',   $parstack, $safeeval);
+        my $halign  = &Apache::lonxml::get_param('halign', $parstack, $safeeval);
+
+        my %colgroup_params;
+        if ($span ne '') {
+            $colgroup_params{'span'} = $span;
+        }
+        if ($halign ne '') {
+            $colgroup_params{'halign'} = $halign;
+        }
+
+        my $table = $Apache::londefdef::table[-1];
+        $table->define_colgroup(\%colgroup_params);
+
+    }
     return $currentstring;
 }
 
@@ -4320,6 +4341,12 @@
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
+    }
+    if ($target eq 'tex') {
+        # TODO: Ensure this tag is within a table:
+
+        my $table = $Apache::londefdef::table[-1];
+        $table->start_body();
     } 
     return $currentstring;
 }
@@ -4329,6 +4356,12 @@
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
+    }
+    if($target eq 'tex') {
+        # TODO: Ensure this tag is within a table:
+
+        my $table = $Apache::londefdef::table[-1];
+        $table->end_body();
     } 
     return $currentstring;
 }
@@ -4339,6 +4372,11 @@
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
+    }
+    if ($target eq 'tex') {
+        # TODO: ensure this is within a table tag.
+        my $table = $Apache::londefdef::table[-1];
+        $table->start_foot();
     } 
     return $currentstring;
 }
@@ -4348,6 +4386,11 @@
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
+    }
+    if ($target eq 'tex') {
+        #  TODO: Ensure this is in side a table
+        my $table = $Apache::londefdef::table[-1];
+        $table->end_foot();
     } 
     return $currentstring;
 }
@@ -4358,6 +4401,11 @@
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
+    }
+    if ($target eq 'tex') {
+        # Assume we're in a table... TODO: Verify that and ignore tag if not.
+        my $table = $Apache::londefdef::table[-1];
+        $table->start_head();
     } 
     return $currentstring;
 }
@@ -4367,6 +4415,12 @@
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
+    }
+    if ($target eq 'tex') {
+        # TODO: Verify we are in a table and ignore tag if not.
+
+        my $table = $Apache::londefdef::table[-1];
+        $table->end_head();
     } 
     return $currentstring;
 }




More information about the LON-CAPA-cvs mailing list