--- loncom/xml/londefdef.pm 2011/09/15 19:10:45 1.415.4.4 +++ loncom/xml/londefdef.pm 2011/11/15 17:34:19 1.415.4.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.415.4.4 2011/09/15 19:10:45 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 @@ -3312,10 +3312,7 @@ sub start_applet { my $currentstring = ''; if ($target eq 'web' || $target eq 'webgrade') { if ($env{'browser.appletsuppress'} ne 'on') { - $currentstring = &Apache::lonenc::encrypt_ref($token, - {'code'=>$code, - 'archive'=>$archive} - ); + $currentstring = $token->[4]; } else { my $alttag= &Apache::lonxml::get_param('alt',$parstack, $safeeval,undef,1); @@ -3833,11 +3830,32 @@ sub end_col { #-- 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; } @@ -4323,6 +4341,12 @@ sub start_tbody { 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; } @@ -4332,6 +4356,12 @@ sub end_tbody { 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; } @@ -4342,6 +4372,11 @@ sub start_tfoot { 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; } @@ -4351,6 +4386,11 @@ sub end_tfoot { 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; } @@ -4361,6 +4401,11 @@ sub start_thead { 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; } @@ -4370,6 +4415,12 @@ sub end_thead { 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; }