[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm
bowersj2
lon-capa-cvs@mail.lon-capa.org
Fri, 11 Oct 2002 14:56:43 -0000
bowersj2 Fri Oct 11 10:56:43 2002 EDT
Modified files:
/loncom/interface lonnavmaps.pm
Log:
Fixing the error caused by END_NAV_MAP drop. This is what I should have
done the first time.
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.71 loncom/interface/lonnavmaps.pm:1.72
--- loncom/interface/lonnavmaps.pm:1.71 Tue Oct 8 16:39:43 2002
+++ loncom/interface/lonnavmaps.pm Fri Oct 11 10:56:43 2002
@@ -1,7 +1,8 @@
+
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.71 2002/10/08 20:39:43 www Exp $
+# $Id: lonnavmaps.pm,v 1.72 2002/10/11 14:56:43 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -930,16 +931,21 @@
}
my $mapIterator = $navmap->getIterator(undef, undef, \%filterHash, $condition);
- my $curRes = $mapIterator->next();
undef $res; # so we don't accidentally use it later
- my $indentLevel = -1;
+ my $indentLevel = 0;
my $indentString = "<img src=\"/adm/lonIcons/whitespace1.gif\" width=\"25\" height=\"1\" alt=\"\" border=\"0\" />";
my $isNewBranch = 0;
my $now = time();
my $in24Hours = $now + 24 * 60 * 60;
+ my $depth = 1;
+
+ # We know the first thing is a BEGIN_MAP (see "$self->{STARTED}"
+ # code in iterator->next), so ignore the first one
+ $mapIterator->next();
+ my $curRes = $mapIterator->next();
- while ($curRes != $mapIterator->END_MAP()) {
+ while ($depth > 0) {
if ($curRes == $mapIterator->BEGIN_MAP() ||
$curRes == $mapIterator->BEGIN_BRANCH()) {
$indentLevel++;
@@ -950,6 +956,12 @@
}
if ($curRes == $mapIterator->BEGIN_BRANCH()) {
$isNewBranch = 1;
+ }
+ if ($curRes == $mapIterator->BEGIN_MAP()) {
+ $depth++;
+ }
+ if ($curRes == $mapIterator->END_MAP()) {
+ $depth--;
}
# Is this resource being blotted out?