[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm
bowersj2
lon-capa-cvs@mail.lon-capa.org
Fri, 15 Nov 2002 20:12:11 -0000
bowersj2 Fri Nov 15 15:12:11 2002 EDT
Modified files:
/loncom/interface lonnavmaps.pm
Log:
Closes bug 964 "Nav map loses your place if you Open All Folders."
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.109 loncom/interface/lonnavmaps.pm:1.110
--- loncom/interface/lonnavmaps.pm:1.109 Fri Nov 15 14:32:09 2002
+++ loncom/interface/lonnavmaps.pm Fri Nov 15 15:12:11 2002
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.109 2002/11/15 19:32:09 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.110 2002/11/15 20:12:11 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -113,10 +113,22 @@
$condition = 1;
}
+ my $currenturl = $ENV{'form.postdata'};
+ $currenturl=~s/^http\:\/\///;
+ $currenturl=~s/^[^\/]+//;
+
+ # alreadyHere allows us to only open the maps necessary to view
+ # the current location once, while at the same time remembering
+ # the current location. Without that check, the user would never
+ # be able to close those maps; the user would close it, and the
+ # currenturl scan would re-open it.
+ my $queryAdd = "postdata=" . &Apache::lonnet::escape($currenturl) .
+ "&alreadyHere=1";
+
if ($condition) {
- $r->print('<a href="navmaps?condition=0&filter=">Close All Folders</a>');
+ $r->print("<a href=\"navmaps?condition=0&filter=&$queryAdd\">Close All Folders</a>");
} else {
- $r->print('<a href="navmaps?condition=1&filter=">Open All Folders</a>');
+ $r->print("<a href=\"navmaps?condition=1&filter=&$queryAdd\">Open All Folders</a>");
}
$r->print('<br> ');
@@ -192,18 +204,6 @@
# maps in their own folders, in favor of "inlining" them.
my $topResource = $navmap->getById("0.0");
my $inlineTopLevelMaps = $topResource->src() =~ m|^/uploaded/.*default\.sequence$|;
-
- my $currenturl = $ENV{'form.postdata'};
- $currenturl=~s/^http\:\/\///;
- $currenturl=~s/^[^\/]+//;
-
- # alreadyHere allows us to only open the maps necessary to view
- # the current location once, while at the same time remembering
- # the current location. Without that check, the user would never
- # be able to close those maps; the user would close it, and the
- # currenturl scan would re-open it.
- my $queryAdd = "postdata=" . &Apache::lonnet::escape($currenturl) .
- "&alreadyHere=1";
# Begin the HTML table
# four cols: resource + indent, chat+feedback, icon, text string