[LON-CAPA-cvs] cvs: rat / lonratsrv.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 24 Jun 2002 14:05:51 -0000


www		Mon Jun 24 10:05:51 2002 EDT

  Modified files:              
    /rat	lonratsrv.pm 
  Log:
  Do not write out <param>-entries for empty parameters (empty values are the
  way to "delete" a parameter).
  
  
Index: rat/lonratsrv.pm
diff -u rat/lonratsrv.pm:1.17 rat/lonratsrv.pm:1.18
--- rat/lonratsrv.pm:1.17	Wed Apr  3 10:30:13 2002
+++ rat/lonratsrv.pm	Mon Jun 24 10:05:51 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Server for RAT Maps
 #
-# $Id: lonratsrv.pm,v 1.17 2002/04/03 15:30:13 matthew Exp $
+# $Id: lonratsrv.pm,v 1.18 2002/06/24 14:05:51 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -262,17 +262,19 @@
            } elsif ($parts[0] eq 'objparms') {
                undef %alltypes;
                undef %allvalues;
-               map {
+               foreach (split(/:/,$parts[$#parts])) {
                    my ($type,$name,$value)=split(/\_\_\_/,$_);
                    $alltypes{$name}=$type;
                    $allvalues{$name}=$value;
-               } split(/:/,$parts[$#parts]);
-               map {
+               }
+               foreach (keys %allvalues) {
+                  if ($allvalues{$_} ne '') {
                    $outstr.='<param to="'.$parts[1].'" type="'
                           .$alltypes{$_}.'" name="'.$_
                           .'" value="'.$allvalues{$_}.'">'
                           ."</param>\n";
-               } keys %allvalues;
+	          }
+               }
            } elsif (($parts[0] ne '') && ($graphdef)) {
 # ------------------------------------------------------------- Graphical input
                $outstr.='<'.$parts[0];