Diff for /loncom/interface/groupsort.pm between versions 1.4 and 1.5

version 1.4, 2001/12/11 03:19:16 version 1.5, 2001/12/11 03:37:11
Line 114  END Line 114  END
   
     my %shash; # sort order (key is resource location, value is sort order)      my %shash; # sort order (key is resource location, value is sort order)
     my %thash; # title (key is resource location, value is title)      my %thash; # title (key is resource location, value is title)
     map {      foreach (split(/&/,$ENV{'QUERY_STRING'})) {
        my ($name, $value) = split(/=/,$_);         my ($name, $value) = split(/=/,$_);
        $value =~ tr/+/ /;         $value =~ tr/+/ /;
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
Line 124  END Line 124  END
        if ($name eq 'catalogmode') {         if ($name eq 'catalogmode') {
            $ENV{'form.'.$name}=$value;             $ENV{'form.'.$name}=$value;
        }         }
     } (split(/&/,$ENV{'QUERY_STRING'}));      }
     my $diropendb;      my $diropendb;
     if ($ENV{'form.catalogmode'} eq 'groupsearch') {      if ($ENV{'form.catalogmode'} eq 'groupsearch') {
  $diropendb =    $diropendb = 
Line 140  END Line 140  END
  my %ahash;   my %ahash;
  my %achash;   my %achash;
  my $ac = 0;   my $ac = 0;
  map {   foreach (@Acts) {
     my ($state,$ref) = split(/a/);      my ($state,$ref) = split(/a/);
     $ahash{$ref} = $state;      $ahash{$ref} = $state;
     $achash{$ref} = $ac;      $achash{$ref} = $ac;
     $ac++;      $ac++;
  } (@Acts);   }
  map {   foreach (sort {$achash{$a} <=> $achash{$b}} (keys %ahash)) {
     my $key = $_;      my $key = $_;
     if ($ahash{$key} eq '1') {      if ($ahash{$key} eq '1') {
 # my $keyz=join("<br />",keys %hash);  # my $keyz=join("<br />",keys %hash);
Line 162  END Line 162  END
     delete $hash{'store_'.$hash{'pre_'.$key.'_link'}};      delete $hash{'store_'.$hash{'pre_'.$key.'_link'}};
  }   }
     }      }
  } sort {$achash{$a} <=> $achash{$b}} (keys %ahash);   }
  map {   foreach (keys %hash) {
     if ($_ =~ /^store_/) {      if ($_ =~ /^store_/) {
  my $key = $_;   my $key = $_;
  $key =~ s/^store_//;   $key =~ s/^store_//;
  $shash{$key} = $hash{'storectr_'.$key};   $shash{$key} = $hash{'storectr_'.$key};
  $thash{$key} = $hash{'store_'.$key};   $thash{$key} = $hash{'store_'.$key};
     }      }
  } keys %hash;   }
  if ($ENV{'form.oldval'}) {   if ($ENV{'form.oldval'}) {
     my $newctr = 0;      my $newctr = 0;
     my %chash;      my %chash;
     map {      foreach (sort {$shash{$a} <=> $shash{$b}} (keys %shash)) {
  my $key = $_;   my $key = $_;
  $newctr++;   $newctr++;
  $shash{$key} = $newctr;   $shash{$key} = $newctr;
  $hash{'storectr_'.$key} = $newctr;   $hash{'storectr_'.$key} = $newctr;
  $chash{$newctr} = $key;   $chash{$newctr} = $key;
     } sort {$shash{$a} <=> $shash{$b}} (keys %shash);      }
     my $oldval = $ENV{'form.oldval'};      my $oldval = $ENV{'form.oldval'};
     my $newval = $ENV{'form.newval'};      my $newval = $ENV{'form.newval'};
     if ($oldval != $newval) {      if ($oldval != $newval) {
Line 258  END Line 258  END
       "\n");        "\n");
     $r->print("<td colspan='2' bgcolor='$titleclr'><b>Title</b></td>\n");      $r->print("<td colspan='2' bgcolor='$titleclr'><b>Title</b></td>\n");
     $r->print("<td bgcolor='$titleclr'><b>Path</b></td></tr>\n");      $r->print("<td bgcolor='$titleclr'><b>Path</b></td></tr>\n");
     map {      foreach (sort {$shash{$a}<=>$shash{$b}} (keys %shash)) {
  my $key=$_;   my $key=$_;
  $ctr++;   $ctr++;
  my @file_ext = split(/\./,$key);   my @file_ext = split(/\./,$key);
Line 273  END Line 273  END
  $r->print("</td><td bgcolor='$fileclr'>");   $r->print("</td><td bgcolor='$fileclr'>");
  $r->print("$thash{$key}</td><td bgcolor='$fileclr'>\n");   $r->print("$thash{$key}</td><td bgcolor='$fileclr'>\n");
  $r->print("$key</td></tr>\n");   $r->print("$key</td></tr>\n");
     } sort {$shash{$a}<=>$shash{$b}} (keys %shash);      } 
     $r->print("</table></td></tr></table></form>");      $r->print("</table></td></tr></table></form>");
     $r->print(<<END);      $r->print(<<END);
 </body>  </body>

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


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