[LON-CAPA-cvs] cvs: loncom(version_0_99_4) /xml lonplot.pm lonxml.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Sat, 27 Sep 2003 04:15:26 -0000
albertel Sat Sep 27 00:15:26 2003 EDT
Modified files: (Branch: version_0_99_4)
/loncom/xml lonplot.pm lonxml.pm
Log:
- backport lonplot.pm 1.91, lonxml.pm 1.281
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.85 loncom/xml/lonplot.pm:1.85.2.1
--- loncom/xml/lonplot.pm:1.85 Tue Jun 10 14:46:02 2003
+++ loncom/xml/lonplot.pm Sat Sep 27 00:15:26 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Dynamic plot
#
-# $Id: lonplot.pm,v 1.85 2003/06/10 18:46:02 matthew Exp $
+# $Id: lonplot.pm,v 1.85.2.1 2003/09/27 04:15:26 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -513,8 +513,8 @@
alt = "$plot{'alttag'}" />
ENDIMAGE
} elsif ($target eq 'tex') {
- &Apache::lonnet::ssi("/cgi-bin/plot.gif?file=$filename.data&output=eps");
-
+ #might be inside the safe space, register the URL for later
+ &Apache::lonxml::register_ssi("/cgi-bin/plot.gif?file=$filename.data&output=eps");
$result = '\graphicspath{{/home/httpd/perl/tmp/}}\includegraphics[width='.$plot{'texwidth'}.' mm]{'.&Apache::lonnet::unescape($filename).'.eps}';
}
} elsif ($target eq 'edit') {
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.266.2.1 loncom/xml/lonxml.pm:1.266.2.2
--- loncom/xml/lonxml.pm:1.266.2.1 Thu Aug 7 15:31:16 2003
+++ loncom/xml/lonxml.pm Sat Sep 27 00:15:26 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.266.2.1 2003/08/07 19:31:16 albertel Exp $
+# $Id: lonxml.pm,v 1.266.2.2 2003/09/27 04:15:26 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -158,6 +158,9 @@
$Apache::lonxml::style_values='';
$Apache::lonxml::style_end_values='';
+#array of ssi calls that need to occur after we are done parsing
+@Apache::lonxml::ssi_info=();
+
sub xmlbegin {
my $output='';
if ($ENV{'browser.mathml'}) {
@@ -451,6 +454,7 @@
if ($ENV{'request.uri'}) {
&writeallows($ENV{'request.uri'});
}
+ &do_registered_ssi();
if ($Apache::lonxml::counter_changed) { &store_counter() }
return $finaloutput;
}
@@ -699,6 +703,7 @@
&init_counter();
@Apache::lonxml::pwd=();
@Apache::lonxml::extlinks=();
+ @Apache::lonxml::ssi_info=();
if ($target eq 'meta') {
$Apache::lonxml::redirection = 0;
$Apache::lonxml::metamode = 1;
@@ -1072,6 +1077,19 @@
&Apache::lonnet::appenv(%httpref);
}
+sub register_ssi {
+ my ($url,%form)=@_;
+ push (@Apache::lonxml::ssi_info,{'url'=>$url,'form'=>\%form});
+ return '';
+}
+
+sub do_registered_ssi {
+ foreach my $info (@Apache::lonxml::ssi_info) {
+ my %form=%{ $info->{'form'}};
+ my $url=$info->{'url'};
+ &Apache::lonnet::ssi($url,%form);
+ }
+}
#
# Afterburner handles anchors, highlights and links
#