--- loncom/xml/londefdef.pm 2011/11/14 00:20:42 1.436 +++ loncom/xml/londefdef.pm 2012/02/05 22:53:42 1.437 @@ -1,8 +1,7 @@ - # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.436 2011/11/14 00:20:42 raeburn Exp $ +# $Id: londefdef.pm,v 1.437 2012/02/05 22:53:42 raeburn Exp $ # # # Copyright Michigan State University Board of Trustees @@ -2972,22 +2971,47 @@ sub end_embed { #-- tag (end tag forbidden) sub start_param { my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; - if (&Apache::lonxml::get_param('name',$parstack, - $safeeval,undef,1)=~/^cabbase$/i) { + my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval, + undef,1); + if ($name =~/^cabbase$/i) { my $value=&Apache::lonxml::get_param('value',$parstack, $safeeval,undef,1); &Apache::lonxml::extlink($value); - } - + } elsif ($name eq 'flashvars') { + if (lc(&Apache::lonxml::get_param('type',$parstack,$safeeval,-2,1)) + eq 'application/x-shockwave-flash') { + my $launcher = + &Apache::lonxml::get_param('data',$parstack,$safeeval,-2,1); + if ($launcher) { + &Apache::lonxml::extlink($launcher); + } + my $flashvars=&Apache::lonxml::get_param('value',$parstack, + $safeeval,undef,1); + if ($flashvars ne '') { + foreach my $item (split(/\&/,$flashvars)) { + my ($key,$value)=split(/=/,$item,2); + if ($key eq 'content') { + if ($value ne '') { + my ($dir) = ($launcher =~ m{(.+/)[^/]+$}); + &Apache::lonxml::extlink($dir.$value); + } + } elsif ($key eq 'thumb') { + if ($value ne '') { + &Apache::lonxml::extlink($value); + } + } + } + } + } + } my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1); - &Apache::lonxml::extlink($src); + if ($src ne '') { + &Apache::lonxml::extlink($src); + } my $currentstring = ''; if ($target eq 'web' || $target eq 'webgrade') { my %toconvert; - my $src=&Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1); if ($src) { $toconvert{'src'}= $src; } - my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval, - undef,1); if ($name=~/^cabbase$/i) { $toconvert{'value'}=&Apache::lonxml::get_param('value',$parstack, $safeeval,undef,1);