[LON-CAPA-cvs] cvs: loncom /interface groupsort.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 13 Jun 2003 23:33:38 -0000


albertel		Fri Jun 13 19:33:38 2003 EDT

  Modified files:              
    /loncom/interface	groupsort.pm 
  Log:
  - use unknwon.gif for the icon unless we know what it is (BUG#1595)
  
  
Index: loncom/interface/groupsort.pm
diff -u loncom/interface/groupsort.pm:1.19 loncom/interface/groupsort.pm:1.20
--- loncom/interface/groupsort.pm:1.19	Mon Feb  3 13:03:52 2003
+++ loncom/interface/groupsort.pm	Fri Jun 13 19:33:38 2003
@@ -2,7 +2,7 @@
 # The LON-CAPA group sort handler
 # Allows for sorting prior to import into RAT.
 #
-# $Id: groupsort.pm,v 1.19 2003/02/03 18:03:52 harris41 Exp $
+# $Id: groupsort.pm,v 1.20 2003/06/13 23:33:38 albertel Exp $
 # 
 # Copyright Michigan State University Board of Trustees
 #
@@ -331,13 +331,18 @@
 	$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');
 	$r->print("<tr><td bgcolor='$fileclr'>");
 	$r->print(&movers($clen,$ctr));
 	$r->print(&hidden($ctr-1,$thash{$key},$key));
 	$r->print("</td><td bgcolor='$fileclr'>");
 	$r->print(&select_box($clen,$ctr));
 	$r->print("</td><td bgcolor='$fileclr'>");
-	$r->print("<img src='$iconpath$curfext.gif'>");
+	$r->print("<img src='$iconpath$iconname'>");
 	$r->print("</td><td bgcolor='$fileclr'>");
 	$r->print("$thash{$key}</td><td bgcolor='$fileclr'>\n");
 	$r->print("$key</td></tr>\n");