Return to londefdef.pm CVS log | Up to [LON-CAPA] / loncom / xml |
version 1.132, 2003/05/07 17:24:16 | version 1.137, 2003/06/03 13:15:02 |
---|---|
Line 54 use Apache::lonmeta(); | Line 54 use Apache::lonmeta(); |
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')); | &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')); |
} | } |
Line 354 sub start_meta { | Line 354 sub start_meta { |
} else { | } else { |
$currentstring = $token->[4]; | $currentstring = $token->[4]; |
} | } |
} | } elsif ($target eq 'meta') { |
if ($target eq 'meta') { | |
unless (&Apache::lonxml::get_param | unless (&Apache::lonxml::get_param |
('http-equiv',$parstack,$safeeval,undef,1)) { | ('http-equiv',$parstack,$safeeval,undef,1)) { |
my $name=$token->[2]->{'name'}; | my $name=$token->[2]->{'name'}; |
Line 366 sub start_meta { | Line 365 sub start_meta { |
$currentstring='<'.$name.'>'. | $currentstring='<'.$name.'>'. |
&Apache::lonxml::get_param | &Apache::lonxml::get_param |
('content',$parstack,$safeeval,undef,1). | ('content',$parstack,$safeeval,undef,1). |
'</'.$name.'>'; | '</'.$name.'>'; |
} | } |
} | } |
} elsif ($target eq 'tex') { | |
&Apache::lonxml::startredirection(); | |
} | } |
return $currentstring; | return $currentstring; |
} | } |
Line 382 sub end_meta { | Line 383 sub end_meta { |
if ($args ne '') { | if ($args ne '') { |
$currentstring = $token->[4]; | $currentstring = $token->[4]; |
} | } |
} | } elsif ($target eq 'tex') { |
$currentstring=&Apache::lonxml::endredirection(); | |
$currentstring=''; | |
} | |
return $currentstring; | return $currentstring; |
} | } |
Line 1133 sub start_big { | Line 1137 sub start_big { |
if ($target eq 'web') { | if ($target eq 'web') { |
$currentstring .= $token->[4]; | $currentstring .= $token->[4]; |
} elsif ($target eq 'tex') { | } elsif ($target eq 'tex') { |
$currentstring .= '\large{'; | $currentstring .= '{\large '; |
} elsif ($target eq 'latexsource') { | } elsif ($target eq 'latexsource') { |
$currentstring .= '{\Large '; | $currentstring .= '{\Large '; |
} | } |
Line 2224 sub start_frameset { | Line 2228 sub start_frameset { |
$currentstring.='<head>'. | $currentstring.='<head>'. |
&Apache::lonmenu::registerurl(undef,$target).'</head>'; | &Apache::lonmenu::registerurl(undef,$target).'</head>'; |
} | } |
$currentstring .= $token->[4]; | my $onLoad=''; |
foreach my $key (keys(%{$token->[2]})) { | |
if ($key =~ /^onload$/i) { | |
$onLoad.=$token->[2]->{$key}.';'; | |
delete($token->[2]->{$key}); | |
} | |
} | |
$token->[2]->{'onload'}=&Apache::lonmenu::loadevents().';'.$onLoad; | |
my $onUnload=''; | |
foreach my $key (keys(%{$token->[2]})) { | |
if ($key =~ /^onunload$/i) { | |
$onUnload.=$token->[2]->{$key}.';'; | |
delete($token->[2]->{$key}); | |
} | |
} | |
$token->[2]->{'onunload'}=&Apache::lonmenu::unloadevents(). | |
';'.$onUnload; | |
$currentstring .= '<'.$token->[1]; | |
foreach (keys %{$token->[2]}) { | |
$currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"'; | |
} | |
$currentstring.='>'; | |
} | } |
return $currentstring; | return $currentstring; |
} | } |
Line 2245 sub start_pre { | Line 2271 sub start_pre { |
if ($target eq 'web') { | if ($target eq 'web') { |
$currentstring .= $token->[4]; | $currentstring .= $token->[4]; |
} elsif ($target eq 'tex') { | } elsif ($target eq 'tex') { |
my $width = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0); | $currentstring .= '\begin{verbatim}'; |
if (not defined $width) {$width ='\textwidth';} | |
$currentstring .= '\parbox['.$width.']{\begin{verbatim}'; | |
} | } |
return $currentstring; | return $currentstring; |
} | } |
Line 2258 sub end_pre { | Line 2282 sub end_pre { |
if ($target eq 'web') { | if ($target eq 'web') { |
$currentstring .= $token->[2]; | $currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { | } elsif ($target eq 'tex') { |
$currentstring .= '\end{verbatim}}'; | $currentstring .= '\end{verbatim}'; |
} | } |
return $currentstring; | return $currentstring; |
} | } |
Line 3102 sub end_wbr { | Line 3126 sub end_wbr { |
return $currentstring; | return $currentstring; |
} | } |
#-- <hideweboutput> tag | |
sub start_hideweboutput { | |
my ($target,$token) = @_; | |
if ($target eq 'web') { | |
&Apache::lonxml::startredirection(); | |
} | |
return ''; | |
} | |
sub end_hideweboutput { | |
my ($target,$token) = @_; | |
my $currentstring = ''; | |
if ($target eq 'web') { | |
$currentstring = &Apache::lonxml::endredirection(); | |
} | |
return ''; | |
} | |
sub image_replication { | sub image_replication { |
my $src = shift; | my $src = shift; |
if (not -e $src) { | if (not -e $src) { |