Diff for /loncom/interface/groupsort.pm between versions 1.59 and 1.61

version 1.59, 2007/07/12 19:54:43 version 1.61, 2007/11/02 21:08:45
Line 37  use GDBM_File; Line 37  use GDBM_File;
 use Apache::loncommon;  use Apache::loncommon;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonnet;  use Apache::lonnet;
 use LONCAPA();  use LONCAPA;
   
 my $iconpath; # variable to be accessible to multiple subroutines  my $iconpath; # variable to be accessible to multiple subroutines
 my %hash; # variable to tie to user specific database  my %hash; # variable to tie to user specific database
Line 45  my %hash; # variable to tie to user spec Line 45  my %hash; # variable to tie to user spec
   
 sub update_actions_hash {  sub update_actions_hash {
     my ($hash) = @_;      my ($hash) = @_;
       # be careful in here, there is also a global %hash
     my $acts=$env{'form.acts'};      my $acts=$env{'form.acts'};
     my @Acts=split(/b/,$acts);      my @Acts=split(/b/,$acts);
     my %ahash;      my %ahash;
     my %achash;      my %achash;
     my $ac=0;  
     # some initial hashes for working with data      # some initial hashes for working with data
       my $ac=0;
     foreach (@Acts) {      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++;
Line 60  sub update_actions_hash { Line 61  sub update_actions_hash {
     # sorting through the actions and changing the global database hash      # sorting through the actions and changing the global database hash
     foreach my $key (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) {      foreach my $key (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) {
  if ($ahash{$key} eq '1') {   if ($ahash{$key} eq '1') {
     $hash->{'store_'.$hash{'pre_'.$key.'_link'}}=      $hash->{'store_'.$hash->{'pre_'.$key.'_link'}}=
  $hash->{'pre_'.$key.'_title'};   $hash->{'pre_'.$key.'_title'};
     $hash->{'storectr_'.$hash{'pre_'.$key.'_link'}}=      $hash->{'storectr_'.$hash->{'pre_'.$key.'_link'}}=
  $hash->{'storectr'}+0;   $hash->{'storectr'}+0;
     $hash->{'storectr'}++;      $hash->{'storectr'}++;
  }   }
  if ($ahash{$key} eq '0') {   if ($ahash{$key} eq '0') {
     if ($hash->{'store_'.$hash{'pre_'.$key.'_link'}}) {      if ($hash->{'store_'.$hash->{'pre_'.$key.'_link'}}) {
  delete($hash->{'store_'.$hash{'pre_'.$key.'_link'}});   delete($hash->{'store_'.$hash->{'pre_'.$key.'_link'}});
    delete($hash->{'storectr_'.$hash->{'pre_'.$key.'_link'}});
     }      }
  }   }
     }      }
Line 227  function finish_import() { Line 229  function finish_import() {
     for (var num=0; num<document.forms.groupsort.fnum.value; num++) {      for (var num=0; num<document.forms.groupsort.fnum.value; num++) {
  $begincondition   $begincondition
  opener.document.forms.simpleedit.importdetail.value+='&'+   opener.document.forms.simpleedit.importdetail.value+='&'+
               escape(eval("document.forms.groupsort.title"+num+".value"))+'='+                eval("document.forms.groupsort.title"+num+".value")+'='+
       escape(eval("document.forms.groupsort.filelink"+num+".value"))+'='+        eval("document.forms.groupsort.filelink"+num+".value")+'='+
       escape(eval("document.forms.groupsort.id"+num+".value"));        eval("document.forms.groupsort.id"+num+".value");
  $endcondition   $endcondition
     }      }
     opener.document.forms.simpleedit.submit();      opener.document.forms.simpleedit.submit();
Line 429  END Line 431  END
 # --------------------------------------- Hidden values (returns scalar string)  # --------------------------------------- Hidden values (returns scalar string)
 sub hidden {  sub hidden {
     my ($sel,$title,$filelink,$id) = @_;      my ($sel,$title,$filelink,$id) = @_;
     my $string = '<input type="hidden" name="title'.$sel.'" value="'.$title.      my $string = '<input type="hidden" name="title'.$sel.'" value="'.
  '" />';   &escape($title).'" />';
     $filelink=~s|^/ext/|http://|;      $filelink=~s|^/ext/|http://|;
     $string .= '<input type="hidden" name="filelink'.$sel.'" value="'.      $string .= '<input type="hidden" name="filelink'.$sel.'" value="'.
  $filelink.'" />';   &escape($filelink).'" />';
     $string .= '<input type="hidden" name="id'.$sel.'" value="'.$id.'" />';      $string .= '<input type="hidden" name="id'.$sel.'" value="'.&escape($id).'" />';
     return $string;      return $string;
 }  }
   

Removed from v.1.59  
changed lines
  Added in v.1.61


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