Return to londefdef.pm CVS log | Up to [LON-CAPA] / loncom / xml |
version 1.415.4.5, 2011/10/06 22:18:59 | version 1.415.4.6.2.1, 2012/03/05 14:41:15 |
---|---|
Line 56 use LONCAPA(); | Line 56 use LONCAPA(); |
BEGIN { | BEGIN { |
&Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr','hideweboutput')); | &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr','hideweboutput')); |
} | } |
Line 456 sub insert_meta { | Line 456 sub insert_meta { |
<meta />'; | <meta />'; |
} | } |
#-- <start> tag | |
sub start_style { | |
my ($target, $token, $tagstack, $parstack, $parser, $safeeval, $style) = @_; | |
my $currentstring = ''; | |
if ($target eq 'tex') { | |
Apache::lonxml::startredirection(); | |
} else { | |
$currentstring = $token->[4]; | |
} | |
return $currentstring; | |
} | |
sub end_style { | |
my ($target, $token, $tagstack, $parstack, $parser, $safeeval) = @_; | |
my $currentstring = ''; | |
if ($target eq 'tex') { | |
Apache::lonxml::endredirection(); | |
} else { | |
$currentstring = $token->[2]; | |
} | |
return $currentstring; | |
} | |
# accessrule | # accessrule |
sub start_accessrule { | sub start_accessrule { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; | my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; |
Line 3830 sub end_col { | Line 3855 sub end_col { |
#-- <colgroup> tag (end tag optional) | #-- <colgroup> tag (end tag optional) |
sub start_colgroup { | sub start_colgroup { |
my ($target,$token) = @_; | my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; |
my $currentstring = ''; | my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { | if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[4]; | $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; | return $currentstring; |
} | } |
Line 4320 sub start_tbody { | Line 4366 sub start_tbody { |
my $currentstring = ''; | my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { | if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[4]; | $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; | return $currentstring; |
} | } |
Line 4329 sub end_tbody { | Line 4381 sub end_tbody { |
my $currentstring = ''; | my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { | if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[2]; | $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; | return $currentstring; |
} | } |
Line 4339 sub start_tfoot { | Line 4397 sub start_tfoot { |
my $currentstring = ''; | my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { | if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[4]; | $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; | return $currentstring; |
} | } |
Line 4348 sub end_tfoot { | Line 4411 sub end_tfoot { |
my $currentstring = ''; | my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { | if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[2]; | $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; | return $currentstring; |
} | } |
Line 4358 sub start_thead { | Line 4426 sub start_thead { |
my $currentstring = ''; | my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { | if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[4]; | $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; | return $currentstring; |
} | } |
Line 4367 sub end_thead { | Line 4440 sub end_thead { |
my $currentstring = ''; | my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { | if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[2]; | $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; | return $currentstring; |
} | } |