version 1.86, 2002/08/07 19:45:05
|
version 1.88, 2002/08/07 19:59:06
|
Line 299 sub get_max_ids_indices {
|
Line 299 sub get_max_ids_indices {
|
return ($needsfixup,$maxid,$maxindex); |
return ($needsfixup,$maxid,$maxindex); |
} |
} |
|
|
#Arguably this should all be done as an lonnet::ssi instead |
sub get_all_text_unbalanced { |
|
#there is a copy of this in lonxml.pm |
|
my($tag,$pars)= @_; |
|
my $token; |
|
my $result=''; |
|
$tag='<'.$tag.'>'; |
|
while ($token = $$pars[-1]->get_token) { |
|
if (($token->[0] eq 'T')||($token->[0] eq 'C')||($token->[0] eq 'D')) { |
|
$result.=$token->[1]; |
|
} elsif ($token->[0] eq 'PI') { |
|
$result.=$token->[2]; |
|
} elsif ($token->[0] eq 'S') { |
|
$result.=$token->[4]; |
|
} elsif ($token->[0] eq 'E') { |
|
$result.=$token->[2]; |
|
} |
|
if ($result =~ /(.*)$tag(.*)/) { |
|
#&Apache::lonnet::logthis('Got a winner with leftovers ::'.$2); |
|
#&Apache::lonnet::logthis('Result is :'.$1); |
|
$result=$1; |
|
my $redo=$tag.$2; |
|
push (@$pars,HTML::LCParser->new(\$redo)); |
|
$$pars[-1]->xml_mode('1'); |
|
last; |
|
} |
|
} |
|
return $result |
|
} |
|
|
|
#Arguably this should all be done as a lonnet::ssi instead |
sub fix_ids_and_indices { |
sub fix_ids_and_indices { |
my ($logfile,$source,$target)=@_; |
my ($logfile,$source,$target)=@_; |
|
|
Line 352 sub fix_ids_and_indices {
|
Line 381 sub fix_ids_and_indices {
|
} |
} |
foreach my $type ('src','href','background','bgimg') { |
foreach my $type ('src','href','background','bgimg') { |
foreach my $key (keys(%parms)) { |
foreach my $key (keys(%parms)) { |
print $logfile "for $type, and $key\n"; |
|
if ($key =~ /^$type$/i) { |
if ($key =~ /^$type$/i) { |
print $logfile "calling set_allow\n"; |
|
$parms{$key}=&set_allow(\%allow,$logfile, |
$parms{$key}=&set_allow(\%allow,$logfile, |
$target,$tag, |
$target,$tag, |
$parms{$key}); |
$parms{$key}); |
Line 413 sub fix_ids_and_indices {
|
Line 440 sub fix_ids_and_indices {
|
} |
} |
if (!$endtag) { if ($token->[4]=~m:/>$:) { $endtag=' /'; }; } |
if (!$endtag) { if ($token->[4]=~m:/>$:) { $endtag=' /'; }; } |
$outstring.='<'.$tag.$newparmstring.$endtag.'>'; |
$outstring.='<'.$tag.$newparmstring.$endtag.'>'; |
|
if ($lctag eq 'm') { |
|
$outstring.=&get_all_text_unbalanced('/m',\@parser); |
|
} |
} elsif ($token->[0] eq 'E') { |
} elsif ($token->[0] eq 'E') { |
if ($token->[2]) { |
if ($token->[2]) { |
unless ($token->[1] eq 'allow') { |
unless ($token->[1] eq 'allow') { |