--- loncom/interface/groupsort.pm 2003/10/07 20:30:13 1.24 +++ loncom/interface/groupsort.pm 2004/05/10 08:34:50 1.27 @@ -2,7 +2,7 @@ # The LON-CAPA group sort handler # Allows for sorting prior to import into RAT. # -# $Id: groupsort.pm,v 1.24 2003/10/07 20:30:13 matthew Exp $ +# $Id: groupsort.pm,v 1.27 2004/05/10 08:34:50 taceyjo1 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,6 +39,7 @@ use Apache::Constants qw(:common); use GDBM_File; use Apache::loncommon; use Apache::lonlocal; +use Apache::lonnet; my %hash; # variable to tie to user specific database my $iconpath; # variable to be accessible to multiple subroutines @@ -234,7 +235,10 @@ END my $key = $_; $key =~ s/^store_//; $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'}) { @@ -351,13 +355,7 @@ END foreach (sort {$shash{$a}<=>$shash{$b}} (keys %shash)) { my $key=$_; $ctr++; - my @file_ext = split(/\./,$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'); + my $iconname=&Apache::loncommon::icon($key); if ($clen > 1) { $r->print(""); $r->print(&movers($clen,$ctr)); @@ -367,7 +365,7 @@ END $r->print(""); $r->print(&select_box($clen,$ctr)); $r->print(""); - $r->print(""); + $r->print(""); $r->print(""); $r->print("$thash{$key}\n"); $r->print("$key\n");