[LON-CAPA-cvs] cvs: rat / lonpageflip.pm loncom/interface lonnavmaps.pm

www lon-capa-cvs@mail.lon-capa.org
Sun, 18 Aug 2002 21:45:42 -0000


www		Sun Aug 18 17:45:42 2002 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
    /rat	lonpageflip.pm 
  Log:
  Need to replace hard-coded "/res/" by call to lonnet::clutter.
  
  Probably not all place have been caught yet, other routines might also
  use a hard-coded /res/-prefix.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.41 loncom/interface/lonnavmaps.pm:1.42
--- loncom/interface/lonnavmaps.pm:1.41	Mon Aug 12 15:45:12 2002
+++ loncom/interface/lonnavmaps.pm	Sun Aug 18 17:45:41 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.41 2002/08/12 19:45:12 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.42 2002/08/18 21:45:41 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -434,8 +434,10 @@
     &Apache::loncommon::no_cache($r);
     $r->send_http_header;
 
-    my $firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}};
-    my $lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}};
+    my $firstres=$hash{'map_start_'.
+           &Apache::lonnet::clutter($ENV{'request.course.uri'})};
+    my $lastres=$hash{'map_finish_'.
+           &Apache::lonnet::clutter($ENV{'request.course.uri'})};
     if (!(($firstres) && ($lastres))) {
 	$r->print('<html><body>Coursemap undefined.</body></html>');
     } else {
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.28 rat/lonpageflip.pm:1.29
--- rat/lonpageflip.pm:1.28	Mon Aug 12 14:21:42 2002
+++ rat/lonpageflip.pm	Sun Aug 18 17:45:41 2002
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.28 2002/08/12 18:21:42 albertel Exp $
+# $Id: lonpageflip.pm,v 1.29 2002/08/18 21:45:41 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -84,7 +84,7 @@
               if ($direction eq 'forward') {
 # --------------------------------------------------------------------- Forward
                   if ($hash{'type_'.$rid} eq 'finish') {
-	             $rid=$hash{'ids_/res/'.$mapurl}; 
+	             $rid=$hash{'ids_'.&Apache::lonnet::clutter($mapurl)}; 
                   }
                   map {
                       my $thiscond=
@@ -120,7 +120,7 @@
               } elsif ($direction eq 'back') {
 # ------------------------------------------------------------------- Backwards
                   if ($hash{'type_'.$rid} eq 'start') {
-	             $rid=$hash{'ids_/res/'.$mapurl};
+	             $rid=$hash{'ids_'.&Apache::lonnet::clutter($mapurl)};
                   }
                   map {
                       my $thiscond=
@@ -190,7 +190,7 @@
          }
          my $newloc;
          if ($last) {
-            $newloc='/res/'.(split(/\_\_\_/,$last))[1];
+            $newloc=&Apache::lonnet::clutter((split(/\_\_\_/,$last))[1]);
          } else {
 	    $newloc='/adm/noidea.html';
          }  
@@ -211,7 +211,7 @@
              untie(%hash);
          }
          if ($last) {
-	     $currenturl='/res/'.(split(/\_\_\_/,$last))[1];
+	     $currenturl=&Apache::lonnet::clutter((split(/\_\_\_/,$last))[1]);
 	 } else {
 	     $r->content_type('text/html');
              $r->header_out(Location => 
@@ -231,7 +231,8 @@
 # ============================================================ Tie the big hash
           if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
                         &GDBM_READER(),0640)) {
-              my $rid=$hash{'map_pc_/res/'.$startoutmap}.'.'.$mapnum;
+              my $rid=$hash{'map_pc_'.&Apache::lonnet::clutter($startoutmap)}.
+                      '.'.$mapnum;
 
 # ------------------------------------------------- Move forward, backward, etc
               my $endupmap;