--- loncom/interface/lonnavmaps.pm 2005/02/17 08:29:43 1.316
+++ loncom/interface/lonnavmaps.pm 2005/03/23 22:16:57 1.319
@@ -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.319 2005/03/23 22:16:57 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();
@@ -1059,7 +1060,7 @@ sub render_resource {
$icon = $params->{'indentString'};
}
} else {
- $icon = "
";
+ $icon = "
";
}
# Display the correct map icon to open or shut map
@@ -1432,7 +1433,15 @@ sub render {
#$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);
@@ -2557,11 +2566,11 @@ want to know is if I resources matc
parameter will allow you to avoid potentially expensive enumeration of
all matching resources.
-=item * B(map, filterFunc, recursive):
+=item * B(map, filterFunc, recursive, showall):
Convience method for
- scalar(retrieveResources($map, $filterFunc, $recursive, 1)) > 0
+ scalar(retrieveResources($map, $filterFunc, $recursive, 1, $showall)) > 0
which will tell whether the map has resources matching the description
in the filter function.
@@ -2644,8 +2653,9 @@ sub hasResource {
my $map = shift;
my $filterFunc = shift;
my $recursive = shift;
+ my $showall = shift;
- return scalar($self->retrieveResources($map, $filterFunc, $recursive, 1)) > 0;
+ return scalar($self->retrieveResources($map, $filterFunc, $recursive, 1, $showall)) > 0;
}
1;