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

www lon-capa-cvs@mail.lon-capa.org
Mon, 20 Jan 2003 16:41:14 -0000


www		Mon Jan 20 11:41:14 2003 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Now also shows preview of images if desired.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.56 loncom/interface/lonindexer.pm:1.57
--- loncom/interface/lonindexer.pm:1.56	Wed Jan 15 18:58:58 2003
+++ loncom/interface/lonindexer.pm	Mon Jan 20 11:41:13 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.56 2003/01/15 23:58:58 www Exp $
+# $Id: lonindexer.pm,v 1.57 2003/01/20 16:41:13 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -838,12 +838,15 @@
 	}
         if ($hash{'display_attrs_8'} == 1) {
             my $output='';
-	    if (&Apache::loncommon::fileembstyle($curfext) eq 'ssi') {
+            my $embstyle=&Apache::loncommon::fileembstyle($curfext);
+	    if ($embstyle eq 'ssi') {
 	       $output=&Apache::lonnet::ssi($filelink);
                $output=~s/^.*\<body[^\>]*\>//si;
                $output=~s/\<\/body\s*\>.*$//si;
                $output='<font size="-2">'.$output.'</font>';
-	   }
+	   } elsif ($embstyle eq 'img') {
+               $output='<img src="'.$filelink.'" />';
+           }
 	   $r->print('<td valign=bottom> '.($output eq '' ? '&nbsp;':$output).
 		      " </td>\n");
         }