[LON-CAPA-cvs] cvs: loncom /interface lonmsg.pm

harris41 lon-capa-cvs@mail.lon-capa.org
Sat, 16 Feb 2002 19:59:10 -0000


harris41		Sat Feb 16 14:59:10 2002 EDT

  Modified files:              
    /loncom/interface	lonmsg.pm 
  Log:
  map to foreach
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.27 loncom/interface/lonmsg.pm:1.28
--- loncom/interface/lonmsg.pm:1.27	Tue Jan  1 13:38:51 2002
+++ loncom/interface/lonmsg.pm	Sat Feb 16 14:59:10 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.27 2002/01/01 18:38:51 www Exp $
+# $Id: lonmsg.pm,v 1.28 2002/02/16 19:59:10 harris41 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -277,7 +277,7 @@
 <input type=button onClick="uncheckall()" value="Check for None">
 <p>
 ENDDISHEADER
-    map {
+    foreach (sort keys %courselist) {
         my ($end,$start)=split(/\:/,$courselist{$_});
         my $active=1;
         if (($end) && ($now>$end)) { $active=0; }
@@ -296,7 +296,7 @@
                       $reply{'generation'}.
                       ' ('.$_.') '.$section);
         } 
-    } sort keys %courselist;
+    }
 }
 
 # ==================================================== Display Critical Message
@@ -307,7 +307,7 @@
          '<form action=/adm/email method=post>'.
          '<input type=hidden name=confirm value=true>');
       my %what=&Apache::lonnet::dump('critical');
-      map {
+      foreach (sort keys %what) {
           my %content=&unpackagemsg($what{$_});
           $content{'message'}=~s/\n/\<br\>/g;
 	  $r->print('<hr>From: <b>'.$content{'sendername'}.'@'.
@@ -315,7 +315,7 @@
                     ')<br><blockquote>'.$content{'message'}.'</blockquote>'.
   '<input type=submit name="rec_'.$_.'" value="Confirm Receipt">'.
  '<input type=submit name="reprec_'.$_.'" value="Confirm Receipt and Reply">');
-      } sort keys %what;
+      }
       $r->print(
           '<input type=hidden name="displayedcrit" value="true"></form>');
 }
@@ -480,7 +480,7 @@
 
 # --------------------------- Get query string for limited number of parameters
 
-    map {
+    foreach (split(/&/,$ENV{'QUERY_STRING'})) {
        my ($name, $value) = split(/=/,$_);
        $value =~ tr/+/ /;
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
@@ -493,7 +493,7 @@
               $ENV{'form.'.$name}=$value;
 	   }
        }
-    } (split(/&/,$ENV{'QUERY_STRING'}));
+    }
 
 # --------------------------------------------------------------- Render Output
   
@@ -547,7 +547,7 @@
 	  &disall($r);
       }
   } elsif ($ENV{'form.confirm'}) {
-      map {
+      foreach (keys %ENV) {
           if ($_=~/^form\.rec\_(.*)$/) {
 	      $r->print('<b>Confirming Receipt:</b> '.
                         &user_crit_received($1).'<br>');
@@ -558,7 +558,7 @@
                         &user_crit_received($msgid).'<br>');
               &comprep($r,$msgid);
           }
-      } keys %ENV;
+      }
       &discrit($r);
   } elsif ($ENV{'form.critical'}) {
       &discrit($r);
@@ -570,12 +570,12 @@
       &disall($r);
   } elsif ($ENV{'form.markeddel'}) {
       my $total=0;
-      map {
+      foreach (keys %ENV) {
           if ($_=~/^form\.delmark_(.*)$/) {
 	      &statuschange(&Apache::lonnet::unescape($1),'deleted');
               $total++;
           }
-      } keys %ENV;
+      }
       $r->print('Deleted '.$total.' message(s)<p>');
       &disall($r);
   } elsif ($ENV{'form.markunread'}) {
@@ -597,29 +597,29 @@
       my %toaddr=();
       undef %toaddr;
       if ($ENV{'form.sendmode'} eq 'group') {
-          map {
+          foreach (keys %ENV) {
 	      if ($_=~/^form\.send\_to\_\&\&\&[^\&]*\&\&\&\_(.+)$/) {
 		  $toaddr{$1}='';
               }
-          } keys %ENV;
+          }
       } elsif ($ENV{'form.sendmode'} eq 'upload') {
-          map {
+          foreach (split(/[\n\r\f]+/,$ENV{'form.upfile'})) {
               my ($rec,$txt)=split(/\s*\:\s*/,$_);
               if ($txt) {
 		  $rec=~s/\@/\:/;
                   $toaddr{$rec}.=$txt."\n";
               }
-          } split(/[\n\r\f]+/,$ENV{'form.upfile'});
+          }
       } else {
 	  $toaddr{$ENV{'form.recuname'}.':'.$ENV{'form.recdomain'}}='';
       }
       if ($ENV{'form.additionalrec'}) {
-	  map {
+	  foreach (split(/\,/,$ENV{'form.additionalrec'})) {
               my ($auname,$audom)=split(/\@/,$_);
               $toaddr{$auname.':'.$audom}='';
-          } split(/\,/,$ENV{'form.additionalrec'});
+          }
       }
-    map {
+    foreach (keys %toaddr) {
       my ($recuname,$recdomain)=split(/\:/,$_);
       my $msgtxt=$ENV{'form.message'};
       if ($toaddr{$_}) { $msgtxt.='<hr>'.$toaddr{$_}; }    
@@ -637,7 +637,7 @@
                                  $content{'citation'}));
       }
       $r->print('<br>');
-    } keys %toaddr;
+    }
       if ($ENV{'form.displayedcrit'}) {
           &discrit($r);
       } else {