';
if (($env{'request.course.id'}) && ($env{'form.forceedit'})) {
+ my $url=&Apache::lonnet::hreflocation('',$env{'request.filename'});
+ if ($url =~ /\.html?$/i) {
+ my ($symb,$itemtitle,$displayfile) =
+ &Apache::lonxml::get_courseupload_hierarchy($url);
+ if (($symb ne '') || ($env{'httpref.'.$url} ne '')) {
+ $result .= (' ' x 3).
+ &Apache::lonhtmlcommon::dependencies_button()."\n".
+ &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,$url)."\n";
+ }
+ }
my $viewtext = &mt('Course View');
if (&Apache::loncommon::course_type() eq 'Community') {
$viewtext = &mt('Community View');
@@ -2048,9 +2084,6 @@ sub start_table {
} elsif ($target eq 'tex') {
&disable_para(); # Can't have paras in a table.
-
- # New table code:
-
# Get the parameters that we can do something about:
my $border = &Apache::lonxml::get_param('border', $parstack, $safeeval, undef, 0);
@@ -2071,7 +2104,6 @@ sub start_table {
$table->cell_border(1); # Default for rules is all if rules not defined.
}
}
- # Only all or nothing for cell borders for now:
if ((defined $cell_border)) {
if ($cell_border eq 'all') {
@@ -2889,10 +2921,7 @@ sub start_applet {
&Apache::lonxml::extlink($archive);
my $currentstring = '';
if ($target eq 'web' || $target eq 'webgrade') {
- $currentstring = &Apache::lonenc::encrypt_ref($token,
- {'code'=>$code,
- 'archive'=>$archive}
- );
+ $currentstring = $token->[4];
} elsif ($target eq 'tex') {
# Turn off some stuff we can't be inside thank you LaTeX
@@ -2978,22 +3007,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);
@@ -4201,7 +4255,7 @@ sub get_eps_image {
close(FILE);
}
$src=~s|/home/httpd/html/res|/home/httpd/prtspool|;
- $src=~s|/home/([^/]*)/public_html/|/home/httpd/prtspool/$1/|;
+ $src=~s|/home/httpd/html/priv/[^/]+/([^/]*)/|/home/httpd/prtspool/$1/|;
if ($sext ne "") { # Put the ext. back in to uniquify.
$src =~ s/\.eps$/$sext.eps/;
}
@@ -4220,7 +4274,7 @@ sub get_eps_image {
print FILE "$src\n";
close FILE;
$src=~s|/home/httpd/html/res|/home/httpd/prtspool|;
- $src=~s|/home/([^/]*)/public_html/|/home/httpd/prtspool/$1/|;
+ $src=~s|/home/httpd/html/priv/[^/]+/([^/]*)/|/home/httpd/prtspool/$1/|;
}
my ($path,$file)=($src=~m|(.*)/([^/]*)$|);
$path =~ s/ /\_/g;
@@ -4239,7 +4293,7 @@ sub eps_generation {
my $newsrc = $src;
$newsrc =~ s/(\.bmp|\.gif|\.jpg|\.jpeg)$/\.eps/i;
$newsrc=~s{/home/httpd/html/res}{};
- $newsrc=~s{/home/($LONCAPA::username_re)/public_html/}{/$1/};
+ $newsrc=~s{/home/httpd/html/priv/[^/]+/($LONCAPA::username_re)/}{/$1/};
$newsrc=~s{/\./}{/};
$newsrc=~s{/([^/]+)\.(ps|eps)}{/};
if ($newsrc=~m{/home/httpd/lonUsers/}) {