[LON-CAPA-cvs] cvs: rat / lonuserstate.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 12 Dec 2003 16:38:53 -0000


www		Fri Dec 12 11:38:53 2003 EDT

  Modified files:              
    /rat	lonuserstate.pm 
  Log:
  Bug #2453: pretty bad, fix should go into 1.1
  
  Since the publisher does not longer change every URL into an absolute path,
  and we are officially allowing relative sources in maps, we have to have
  lonuserstate do a hreflocation of map source with respect to the map
  location.
  
  
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.67 rat/lonuserstate.pm:1.68
--- rat/lonuserstate.pm:1.67	Sat Nov  1 11:42:13 2003
+++ rat/lonuserstate.pm	Fri Dec 12 11:38:53 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construct and maintain state and binary representation of course for user
 #
-# $Id: lonuserstate.pm,v 1.67 2003/11/01 16:42:13 www Exp $
+# $Id: lonuserstate.pm,v 1.68 2003/12/12 16:38:53 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -164,9 +164,12 @@
 				$turi='/adm/coursedocs/showdoc'.$turi;
                             }
                         } else { # normal internal resource
-                           if (($embstyle eq 'img') || ($embstyle eq 'emb')) {
-			       $turi='/adm/wrapper'.$turi;
-                           }
+			    my $mapdir=$uri;
+			    $mapdir=~s/[^\/]+$//;
+			    $turi=&Apache::lonnet::hreflocation($mapdir,$turi);
+			    if (($embstyle eq 'img') || ($embstyle eq 'emb')) {
+				$turi='/adm/wrapper'.$turi;
+			    }
                         }
 		    }