--- rat/lonpage.pm 2000/10/31 19:31:42 1.15 +++ rat/lonpage.pm 2001/05/04 19:33:46 1.21 @@ -5,13 +5,14 @@ # # 05/29/00,05/30 Gerd Kortemeyer) # 08/30,08/31,09/06,09/14,09/15,09/16,09/19,09/20,09/21,09/23, -# 10/02,10/10,10/14,10/16,10/18,10/19,10/31 Gerd Kortemeyer +# 10/02,10/10,10/14,10/16,10/18,10/19,10/31,11/6,11/14,11/16 Gerd Kortemeyer package Apache::lonpage; use strict; use Apache::Constants qw(:common :http); use Apache::lonnet(); +use Apache::lonxml(); use HTML::TokeParser; use GDBM_File; @@ -180,8 +181,6 @@ sub handler { my $xmlheader=''; my $xmlbody=''; - my %httpref=(); - # --------------------------------------------- Get SSI output, post parameters for ($i=0;$i<=$#rows;$i++) { @@ -215,7 +214,6 @@ sub handler { my $bodydef=0; my $thisxml=0; my @rlinks=(); - my @alinks=(); if ($output=~/\?xml/) { $isxml=1; $thisxml=1; @@ -233,23 +231,9 @@ sub handler { } elsif ($token->[1] eq 'img') { $rlinks[$#rlinks+1]= $token->[2]->{'src'}; - $alinks[$#alinks+1]= - $token->[2]->{'src'}; } elsif ($token->[1] eq 'embed') { $rlinks[$#rlinks+1]= $token->[2]->{'src'}; - $alinks[$#alinks+1]= - $token->[2]->{'src'}; - } elsif ($token->[1] eq 'applet') { - $alinks[$#alinks+1]= - $token->[2]->{'code'}; - $alinks[$#alinks+1]= - $token->[2]->{'archive'}; - } elsif ($token->[1] eq 'param') { - if ($token->[2]->{'name'} eq 'cabbase') { - $alinks[$#alinks+1]= - $token->[2]->{'value'}; - } } elsif ($token->[1] eq 'base') { $thisdir=$token->[2]->{'href'}; } elsif ($token->[1] eq 'body') { @@ -279,6 +263,8 @@ sub handler { $nforms++; $output=~s/\]*\>//gsi; $output=~s/\<\/form[^\>]*\>//gsi; + $output=~ + s/\<((?:input|select|button|textarea)[^\>]+)name\s*\=\s*[\'\"]*([\w\.\:]+)[\'\"]*([^\>]*)\>/\<$1 name="$prefix$2" $3\>/gsi; } $thisdir=~s/\/[^\/]*$//; map { @@ -289,11 +275,6 @@ sub handler { $output=~s/(\"|\'|\=\s*)$_(\"|\'|\s|\>)/$1$newlocation$2/; } } @rlinks; - map { - $httpref{'httpref.'. - &Apache::lonnet::hreflocation($thisdir,$_)}= - $r->uri; - } @alinks; $output=~s/\<\s*applet/\content_type('text/xml'); @@ -322,15 +301,21 @@ sub handler { } # ------------------------------------------------------------------------ Head $r->print("\n\n".$allmeta); + $allscript=~ + s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs; if ($allscript) { - $r->print("\n\n"); + $r->print("\n\n"); } + $r->print(&Apache::lonxml::registerurl); $r->print("\n\n"); # ------------------------------------------------------------------ Start body if ($isxml) { $r->print($xmlbody); } else { - $r->print(''); + $r->print( + ''); } # ------------------------------------------------------------------ Start form if ($nforms) {