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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 01 Mar 2005 00:41:02 -0000


albertel		Mon Feb 28 19:41:02 2005 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - now that last_known is a symb we can easily find out where we just was
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.316 loncom/interface/lonnavmaps.pm:1.317
--- loncom/interface/lonnavmaps.pm:1.316	Thu Feb 17 03:29:43 2005
+++ loncom/interface/lonnavmaps.pm	Mon Feb 28 19:41:01 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.316 2005/02/17 08:29:43 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.317 2005/03/01 00:41:01 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -30,6 +30,7 @@
 package Apache::lonnavmaps;
 
 use strict;
+use GDBM_File;
 use Apache::Constants qw(:common :http);
 use Apache::loncommon();
 use Apache::lonmenu();
@@ -1432,7 +1433,15 @@
             #$currenturl=~s/^[^\/]+//;
             
             $here = $jump = &Apache::lonnet::symbread($currenturl);
-        }
+        } else {
+	    my $last;
+	    if (tie(my %hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db',
+                    &GDBM_READER(),0640)) {
+		$last=$hash{'last_known'};
+		untie(%hash);
+	    }
+	    if ($last) { $here = $jump = $last; }
+	}
 
         # Step three: Ensure the folders are open
         my $mapIterator = $navmap->getIterator(undef, undef, undef, 1);