Diff for /loncom/interface/loncommon.pm between versions 1.4 and 1.8

version 1.4, 2001/07/30 22:24:34 version 1.8, 2001/10/26 17:29:28
Line 8 Line 8
 package Apache::loncommon;  package Apache::loncommon;
   
 use strict;  use strict;
   use POSIX qw(strftime);
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::lonmsg();  use Apache::lonmsg();
   
Line 32  sub get_previous_attempt { Line 33  sub get_previous_attempt {
       for ($version=1;$version<=$returnhash{'version'};$version++) {        for ($version=1;$version<=$returnhash{'version'};$version++) {
         $prevattempts.='</tr><tr><th>Attempt '.$version.'</th>';          $prevattempts.='</tr><tr><th>Attempt '.$version.'</th>';
         map {          map {
   $prevattempts.='<td>'.$returnhash{$version.':'.$_}.'</td>';       my $value;
     if ($_ =~ /timestamp/) {
       $value=scalar(localtime($returnhash{$version.':'.$_}));
     } else {
       $value=$returnhash{$version.':'.$_};
     }
     $prevattempts.='<td>'.$value.'</td>';   
         } sort(keys %lasthash);          } sort(keys %lasthash);
       }        }
       $prevattempts.='</tr><tr><th>Current</th>';        $prevattempts.='</tr><tr><th>Current</th>';
       map {        map {
         $prevattempts.='<td>'.$lasthash{$_}.'</td>';   my $value;
    if ($_ =~ /timestamp/) {
     $value=scalar(localtime($lasthash{$_}));
    } else {
     $value=$lasthash{$_};
    }
    $prevattempts.='<td>'.$value.'</td>';
       } sort(keys %lasthash);        } sort(keys %lasthash);
       $prevattempts.='</tr></table>';        $prevattempts.='</tr></table>';
     } else {      } else {
Line 48  sub get_previous_attempt { Line 61  sub get_previous_attempt {
   }    }
 }  }
   
   sub get_unprocessed_cgi {
     my ($query)= @_;
     map {
       my ($name, $value) = split(/=/,$_);
       $value =~ tr/+/ /;
       $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
       if (!defined($ENV{'form.'.$name})) { $ENV{'form.'.$name}=$value; }
     } (split(/&/,$query));
   }
   
   sub cacheheader {
     my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime);
     my $output .='<meta HTTP-EQUIV="Expires" CONTENT="'.$date.'" />
                   <meta HTTP-EQUIV="Cache-control" CONTENT="no-cache" />
                   <meta HTTP-EQUIV="Pragma" CONTENT="no-cache" />';
     return $output;
   }
   
 1;  1;
 __END__;  __END__;

Removed from v.1.4  
changed lines
  Added in v.1.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>