[LON-CAPA-cvs] cvs: loncom /homework imageresponse.pm

banghart lon-capa-cvs-allow@mail.lon-capa.org
Tue, 19 Jun 2007 20:23:56 -0000


banghart		Tue Jun 19 16:23:56 2007 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm 
  Log:
  	Restrict browsing to image files.
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.82 loncom/homework/imageresponse.pm:1.83
--- loncom/homework/imageresponse.pm:1.82	Tue Apr 17 21:06:22 2007
+++ loncom/homework/imageresponse.pm	Tue Jun 19 16:23:56 2007
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.82 2007/04/18 01:06:22 albertel Exp $
+# $Id: imageresponse.pm,v 1.83 2007/06/19 20:23:56 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -505,6 +505,7 @@
 sub start_image {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result='';
+    my $only = join(',',&Apache::loncommon::filecategorytypes('Pictures'));
     if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze'
 	|| $target eq 'answer') { 
 	&Apache::lonxml::startredirection; 
@@ -515,7 +516,7 @@
 
 	$result=&Apache::edit::tag_start($target,$token,'Clickable Image').
 	    &Apache::edit::editline($token->[1],$bgimg,'Image Source File',40);
-	$result.=&Apache::edit::browse(undef,'textnode').' ';
+	$result.=&Apache::edit::browse(undef,'textnode',undef,$only).' ';
 	$result.=&Apache::edit::search(undef,'textnode').
 	    &Apache::edit::end_row();
     } elsif ($target eq "modified") {