[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm
bowersj2
lon-capa-cvs@mail.lon-capa.org
Thu, 12 Jun 2003 20:36:41 -0000
bowersj2 Thu Jun 12 16:36:41 2003 EDT
Modified files:
/loncom/interface lonnavmaps.pm
Log:
Misc. fixups: .pages show in Show Only Homework view. Empty .pages are
suppressed in the Show Only Homework view. Folders can not be opened or
closed in the Show Only Homework mode, because it plays havoc with the
system and it's not worth fixing; clicking on folders like that really
has poorly defined semantics and the user would be just guessing what
would happen when some of the map is suppressed.
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.200 loncom/interface/lonnavmaps.pm:1.201
--- loncom/interface/lonnavmaps.pm:1.200 Thu Jun 12 12:21:20 2003
+++ loncom/interface/lonnavmaps.pm Thu Jun 12 16:36:41 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.200 2003/06/12 16:21:20 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.201 2003/06/12 20:36:41 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -249,17 +249,20 @@
my $suppressEmptySequences = 0;
my $filterFunc = undef;
+ my $resource_no_folder_link = 0;
+
# Display only due homework.
my $showOnlyHomework = 0;
if ($ENV{QUERY_STRING} eq 'showOnlyHomework') {
$showOnlyHomework = 1;
$suppressEmptySequences = 1;
$filterFunc = sub { my $res = shift;
- return $res->completable() || $res->is_sequence();
+ return $res->completable() || $res->is_map();
};
$r->print("<p><font size='+2'>Uncompleted Homework</font></p>");
$ENV{'form.filter'} = '';
$ENV{'form.condition'} = 1;
+ $resource_no_folder_link = 1;
} else {
$r->print("<a href='navmaps?showOnlyHomework'>" .
"Show Only Uncompleted Homework</a><br />");
@@ -272,6 +275,7 @@
'suppressNavmap' => 1,
'suppressEmptySequences' => $suppressEmptySequences,
'filterFunc' => $filterFunc,
+ 'resource_no_folder_link' => $resource_no_folder_link,
'r' => $r};
my $render = render($renderArgs);
$navmap->untieHashes();
@@ -1293,7 +1297,7 @@
if (ref($curRes)) {
# Parallel pre-processing: Do sequences have non-filtered-out children?
- if ($curRes->is_sequence()) {
+ if ($curRes->is_map()) {
$curRes->{DATA}->{HAS_VISIBLE_CHILDREN} = 0;
# Sequences themselves do not count as visible children,
# unless those sequences also have visible children.
@@ -1356,7 +1360,7 @@
}
# If this is an empty sequence and we're filtering them, continue on
- if ($curRes->is_sequence() && $args->{'suppressEmptySequences'} &&
+ if ($curRes->is_map() && $args->{'suppressEmptySequences'} &&
!$curRes->{DATA}->{HAS_VISIBLE_CHILDREN}) {
next;
}