Diff for /loncom/interface/groupsort.pm between versions 1.23 and 1.30

version 1.23, 2003/09/23 00:26:10 version 1.30, 2005/02/17 08:29:42
Line 39  use Apache::Constants qw(:common); Line 39  use Apache::Constants qw(:common);
 use GDBM_File;  use GDBM_File;
 use Apache::loncommon;  use Apache::loncommon;
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::lonnet;
   
 my %hash; # variable to tie to user specific database  my %hash; # variable to tie to user specific database
 my $iconpath; # variable to be accessible to multiple subroutines  my $iconpath; # variable to be accessible to multiple subroutines
Line 68  sub handler { Line 69  sub handler {
   
 # finish_import looks different for graphical or "simple" RAT  # finish_import looks different for graphical or "simple" RAT
     my $finishimport='';      my $finishimport='';
     if ($ENV{'form.mode'} eq 'simple') {      if ($ENV{'form.mode'} eq 'simple' || $ENV{'form.mode'} eq '') {
         $finishimport=(<<ENDSMP);          $finishimport=(<<ENDSMP);
 function finish_import() {  function finish_import() {
     opener.document.forms.simpleedit.importdetail.value='';      opener.document.forms.simpleedit.importdetail.value='';
Line 104  ENDADV Line 105  ENDADV
     }      }
   
 # output start of web page  # output start of web page
       my $html=&Apache::lonxml::xmlbegin();
     $r->print(<<END);      $r->print(<<END);
 <html>  $html
 <head>  <head>
 <title>The LearningOnline Network With CAPA Group Sorter</title>  <title>The LearningOnline Network With CAPA Group Sorter</title>
 <script language='javascript'>  <script language='javascript'>
Line 234  END Line 235  END
  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};   if (&Apache::lonnet::gettitle($key) eq '') {
       $thash{$key} = $hash{'store_'.$key};
    } else {
       $thash{$key} = &Apache::lonnet::gettitle($key);
    }
     }      }
  }   }
  if ($ENV{'form.oldval'}) {   if ($ENV{'form.oldval'}) {
Line 314  END Line 319  END
   
         # --- Expand here if "GO BACK" button desired          # --- Expand here if "GO BACK" button desired
         if ($ENV{'form.catalogmode'} eq 'groupimport') {          if ($ENV{'form.catalogmode'} eq 'groupimport') {
               my $resurl = &Apache::loncommon::lastresurl();
     $r->print(<<END);      $r->print(<<END);
 <input type="button" name="alter" value="$lt{'gb'}"  <input type="button" name="alter" value="$lt{'gb'}"
  onClick="window.location='/res/?catalogmode=groupimport'" />&nbsp;   onClick="window.location='$resurl?catalogmode=groupimport'" />&nbsp;
 END  END
         }          }
  if ($ENV{'form.catalogmode'} eq 'groupsearch') {   if ($ENV{'form.catalogmode'} eq 'groupsearch') {
Line 351  END Line 357  END
     foreach (sort {$shash{$a}<=>$shash{$b}} (keys %shash)) {      foreach (sort {$shash{$a}<=>$shash{$b}} (keys %shash)) {
  my $key=$_;   my $key=$_;
  $ctr++;   $ctr++;
  my @file_ext = split(/\./,$key);   my $iconname=&Apache::loncommon::icon($key);
  my $curfext = $file_ext[scalar(@file_ext)-1];  
  my $iconname="unknown.gif";  
  my $embstyle = &Apache::loncommon::fileembstyle($curfext);  
  # The unless conditional that follows is a bit of overkill  
  $iconname = $curfext.".gif" unless  
     (!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn');  
  if ($clen > 1) {   if ($clen > 1) {
     $r->print("<tr><td bgcolor='$fileclr'>");      $r->print("<tr><td bgcolor='$fileclr'>");
     $r->print(&movers($clen,$ctr));      $r->print(&movers($clen,$ctr));
Line 367  END Line 367  END
     $r->print("</td><td bgcolor='$fileclr'>");      $r->print("</td><td bgcolor='$fileclr'>");
     $r->print(&select_box($clen,$ctr));      $r->print(&select_box($clen,$ctr));
     $r->print("</td><td bgcolor='$fileclr'>");      $r->print("</td><td bgcolor='$fileclr'>");
     $r->print("<img src='$iconpath$iconname'>");      $r->print("<img src='$iconname' />");
     $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");

Removed from v.1.23  
changed lines
  Added in v.1.30


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