--- rat/lonpage.pm 2012/11/30 18:16:53 1.98 +++ rat/lonpage.pm 2012/11/30 20:48:20 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Page Handler # -# $Id: lonpage.pm,v 1.98 2012/11/30 18:16:53 raeburn Exp $ +# $Id: lonpage.pm,v 1.99 2012/11/30 20:48:20 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -227,6 +227,7 @@ sub handler { my %ssialink=(); my %cellemb=(); + my %cellexternal=(); my $allscript=''; my $allmeta=''; @@ -244,13 +245,20 @@ sub handler { $lcm*=($#colcont+1)/euclid($lcm,($#colcont+1)); foreach (@colcont) { my $src=$hash{'src_'.$_}; - my ($extension)=($src=~/\.(\w+)$/); + my ($extension)=($src=~/\.(\w+)$/); + $cellexternal{$_}=($hash{'ext_'.$_} eq 'true:'); if ($hash{'encrypted_'.$_}) { $src=&Apache::lonenc::encrypted($src); } $cellemb{$_}= &Apache::loncommon::fileembstyle($extension); - if ($cellemb{$_} eq 'ssi') { + if ($cellexternal{$_}) { + unless (($target eq 'tex') || ($target eq 'tex_answer')) { + $ssibody{$_} = <No iframe support! +ENDEXT + } + } elsif ($cellemb{$_} eq 'ssi') { # --------------------------------------------------------- This is an SSI cell my ($mapid,$resid)=split(/\./,$_); my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$src); @@ -477,7 +485,7 @@ sub handler { unless (($target eq 'tex') || ($target eq 'tex_answer')) { $r->print('print(' bgcolor="'. @@ -499,7 +507,10 @@ sub handler { } $r->print('>'); } - $r->print($ssibody{$rid}); + unless (($cellexternal{$rid}) && + ($target eq 'tex') && ($target eq 'tex_answer')) { + $r->print($ssibody{$rid}); + } unless (($target eq 'tex') || ($target eq 'tex_answer')) { $r->print(''); } @@ -595,6 +606,7 @@ sub get_buttons { $esrc=&Apache::lonenc::encrypted($esrc); } if ($hash->{'src_'.$rid} !~ m-^/uploaded/- + && $hash->{'src_'.$rid} !~ m{^https?://} && !$env{'request.enc'} && ($env{'request.role.adv'} || !$hash->{'encrypted_'.$rid})) { @@ -603,7 +615,8 @@ sub get_buttons { ''. ''; } - if ($hash->{'src_'.$rid} !~ m{^/uploaded/}) { + if (($hash->{'src_'.$rid} !~ m{^/uploaded/}) && + ($hash->{'src_'.$rid} !~ m{^https?://})) { $metainfo .= ''.