[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm
www
lon-capa-cvs@mail.lon-capa.org
Tue, 18 Feb 2003 22:19:30 -0000
www Tue Feb 18 17:19:30 2003 EDT
Modified files:
/loncom/xml londefdef.pm
Log:
Need to pass full path to lonmeta::alttag().
The $token->[2]->{'something'} construction is apparently case sensitive,
so, for example, <img SRC="stuff.gif"> does not get recognized. Should this
module then not always call &Apache::lonxml::get_param instead of accessing
the token hash?
FIXED along the way: &image_replication was called BEFORE the full path
was figured out ...
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.116 loncom/xml/londefdef.pm:1.117
--- loncom/xml/londefdef.pm:1.116 Tue Feb 18 16:14:16 2003
+++ loncom/xml/londefdef.pm Tue Feb 18 17:19:30 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.116 2003/02/18 21:14:16 www Exp $
+# $Id: londefdef.pm,v 1.117 2003/02/18 22:19:30 www Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -1602,15 +1602,18 @@
if ($ENV{'browser.imagesuppress'} ne 'on') {
$currentstring = $token->[4];
} else {
- my $alttag=$token->[2]->{'alt'};
+ my $alttag= &Apache::lonxml::get_param
+ ('alt',$parstack,$safeeval,undef,1);
unless ($alttag) {
- $alttag=&Apache::lonmeta::alttag($token->[2]->{'src'});
+ $alttag=&Apache::lonmeta::alttag
+ ($Apache::lonxml::pwd[-1],$src);
}
$currentstring='[IMAGE: '.$alttag.']';
}
} elsif ($target eq 'tex') {
- &image_replication($src);
- $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
+ $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
+ &image_replication($src);
+
#if original gif/jpg/png file exist do following:
if (-e $src) {
#defines the default size of image
@@ -1705,7 +1708,8 @@
} else {
my $alttag=$token->[2]->{'alt'};
unless ($alttag) {
- $alttag=&Apache::lonmeta::alttag($token->[2]->{'code'});
+ $alttag=&Apache::lonmeta::alttag($ENV{'REQUEST_URI'},
+ $token->[2]->{'code'});
}
$currentstring='[APPLET: '.$alttag.']';
}
@@ -1738,7 +1742,8 @@
} else {
my $alttag=$token->[2]->{'alt'};
unless ($alttag) {
- $alttag=&Apache::lonmeta::alttag($token->[2]->{'src'});
+ $alttag=&Apache::lonmeta::alttag($ENV{'REQUEST_URI'},
+ $token->[2]->{'src'});
}
$currentstring='[EMBED: '.$alttag.']';
}