[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 26 Apr 2002 18:25:56 -0000


sakharuk		Fri Apr 26 14:25:56 2002 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  sorry, I commited the wrong version last time``
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.54 loncom/xml/londefdef.pm:1.55
--- loncom/xml/londefdef.pm:1.54	Fri Apr 26 14:18:37 2002
+++ loncom/xml/londefdef.pm	Fri Apr 26 14:25:56 2002
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.54 2002/04/26 18:18:37 sakharuk Exp $
+# $Id: londefdef.pm,v 1.55 2002/04/26 18:25:56 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1390,7 +1390,14 @@
 	      my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval);
 	      $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
 	      my $file;
-	      my $path;
+	      my $path;	
+              if ($src =~ m!(.*)/([^/]*)$!) {
+		  $file = $2;
+		  $path = $1; 
+	      } else {
+		  $path = $Apache::lonxml::pwd[-1];
+		  $file = $src;
+	      }
 	      $file=~s/(\.gif|\.jpg)$/\.eps/;
 	      if ($path) {
 		$currentstring .= '\graphicspath{{'.$path.'/}}\fbox{\includegraphics{'.$file.'}}';