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

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 20 Aug 2004 18:43:36 -0000


sakharuk		Fri Aug 20 14:43:36 2004 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Part of the bug 3335 (Printing of simplepages and aboutme doesn't work) is fixed. I very want to know your (Guy) reaction on this correction because I am not sure that I did this in the reasonable way.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.234 loncom/xml/londefdef.pm:1.235
--- loncom/xml/londefdef.pm:1.234	Thu Aug 19 16:20:40 2004
+++ loncom/xml/londefdef.pm	Fri Aug 20 14:43:36 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.234 2004/08/19 20:20:40 albertel Exp $
+# $Id: londefdef.pm,v 1.235 2004/08/20 18:43:36 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2422,8 +2422,13 @@
     } elsif ($target eq 'tex') {
 	$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
         #if uploaded restore the path
+	my $old_src=$src;
 	if ($src=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/simplepage\/([^\/]+)$/) {
 	    $src=&Apache::loncommon::propath($1,$2).'/userfiles/simplepage/'.$3;
+	    if (not -e $src) {
+		$old_src=~/^\/uploaded\/(.*)$/;
+		$src=$Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles/'.$1;
+	    }
 	} elsif ($src=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/aboutme\/([^\/]+)$/) {
 	    $src=&Apache::loncommon::propath($1,$2).'/userfiles/aboutme/'.$3;
 	}