[LON-CAPA-cvs] cvs: loncom /xml lonplot.pm

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 09 Apr 2002 18:01:09 -0000


matthew		Tue Apr  9 14:01:09 2002 EDT

  Modified files:              
    /loncom/xml	lonplot.pm 
  Log:
  Added alttag tag to <gnuplot>
  
  
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.63 loncom/xml/lonplot.pm:1.64
--- loncom/xml/lonplot.pm:1.63	Fri Mar 22 15:05:19 2002
+++ loncom/xml/lonplot.pm	Tue Apr  9 14:01:09 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Dynamic plot
 #
-# $Id: lonplot.pm,v 1.63 2002/03/22 20:05:19 albertel Exp $
+# $Id: lonplot.pm,v 1.64 2002/04/09 18:01:09 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -112,7 +112,7 @@
 ##                                                               ##
 ###################################################################
 my @gnuplot_edit_order = 
-    qw/bgcolor fgcolor height width font transparent grid border align/;
+    qw/alttag bgcolor fgcolor height width font transparent grid border align/;
 
 my $gnuplot_help_text = <<"ENDPLOTHELP";
 <p>
@@ -148,6 +148,13 @@
 
 my %gnuplot_defaults = 
     (
+     alttag       => {
+	 default     => 'dynamically generated plot',
+	 test        => $words_test,
+	 description => 'brief description of the plot',
+      	 edit_type   => 'entry',
+	 size        => '40'
+	 },
      height       => {
 	 default     => 200,
 	 test        => $int_test,
@@ -484,10 +491,10 @@
 	if ($target eq 'web') {
 	    $result .= <<"ENDIMAGE";
 <img src    = "/cgi-bin/plot.gif?file=$filename&output=gif" 
-     width  = "$plot{'width'}" 
+     width  = "$plot{'width'}"
      height = "$plot{'height'}"
      align  = "$plot{'align'}"
-     alt    = "image should be /cgi-bin/plot.gif?$filename" />
+     alt    = "$plot{'alttag'}" />
 ENDIMAGE
         } elsif ($target eq 'tex') {
 	    &Apache::lonnet::ssi('cgi-bin/plot.gif?file=$filename'.