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

www lon-capa-cvs@mail.lon-capa.org
Mon, 20 Jan 2003 17:20:52 -0000


www		Mon Jan 20 12:20:52 2003 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Bug #325
  Now shows previews and thumbnails of files in resource space
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.57 loncom/interface/lonindexer.pm:1.58
--- loncom/interface/lonindexer.pm:1.57	Mon Jan 20 11:41:13 2003
+++ loncom/interface/lonindexer.pm	Mon Jan 20 12:20:52 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.57 2003/01/20 16:41:13 www Exp $
+# $Id: lonindexer.pm,v 1.58 2003/01/20 17:20:52 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -846,6 +846,10 @@
                $output='<font size="-2">'.$output.'</font>';
 	   } elsif ($embstyle eq 'img') {
                $output='<img src="'.$filelink.'" />';
+           } elsif ($filelink=~/^\/res\/(\w+)\/(\w+)\//) {
+               $output='<img src="http://'.
+		 $Apache::lonnet::hostname{&Apache::lonnet::homeserver($2,$1)}.
+                 '/cgi-bin/thumbnail.gif?url='.$filelink.'" />';
            }
 	   $r->print('<td valign=bottom> '.($output eq '' ? '&nbsp;':$output).
 		      " </td>\n");