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

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 12 May 2004 18:29:57 -0000


sakharuk		Wed May 12 14:29:57 2004 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Propath function is used instead of pattern mathing.  
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.213 loncom/xml/londefdef.pm:1.214
--- loncom/xml/londefdef.pm:1.213	Tue May 11 14:41:24 2004
+++ loncom/xml/londefdef.pm	Wed May 12 14:29:57 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.213 2004/05/11 18:41:24 sakharuk Exp $
+# $Id: londefdef.pm,v 1.214 2004/05/12 18:29:57 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2269,9 +2269,8 @@
     } elsif ($target eq 'tex') {
 	$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
         #if uploaded restore the path
-	if ($src=~/^\/uploaded\//) {
- 	    $src=~s/\/(\w)(\w)(\w)([^\/]*)\/simplepage\//\/$1\/$2\/$3\/$1$2$3$4\/userfiles\/simplepage\//;
-	    $src=~s/uploaded/home\/httpd\/lonUsers/;
+	if ($src=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/simplepage\/([^\/]+)$/) {
+	    $src=&Apache::loncommon::propath($1,$2).'/userfiles/simplepage/'.$3;
 	}
 	#if original gif/jpg/png file exist do following:
 	if (-e $src) {