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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Sat, 08 Mar 2003 20:12:33 -0000


bowersj2		Sat Mar  8 15:12:33 2003 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Fixes bug 1252, Course Navigation entries should not themselves appear
  on the navmap view.
  
  Fixes issue reported by H.K. and never filed as a bug with asking
  for parts multiple times.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.152 loncom/interface/lonnavmaps.pm:1.153
--- loncom/interface/lonnavmaps.pm:1.152	Tue Mar  4 17:30:10 2003
+++ loncom/interface/lonnavmaps.pm	Sat Mar  8 15:12:32 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.152 2003/03/04 22:30:10 matthew Exp $
+# $Id: lonnavmaps.pm,v 1.153 2003/03/08 20:12:32 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -38,6 +38,8 @@
 # YEAR=2002
 # 1/1 Gerd Kortemeyer
 # Oct-Nov Jeremy Bowers
+# YEAR=2003
+# Jeremy Bowers ... lots of days
 
 package Apache::lonnavmaps;
 
@@ -189,7 +191,7 @@
     # renderer call
     my $render = render({ 'cols' => [0,1,2,3],
                           'url' => '/adm/navmaps',
-                          #'printKey' => 1,
+                          'suppressNavmap' => 1,
                           'r' => $r});
 
     $navmap->untieHashes();
@@ -536,7 +538,9 @@
 
 =item * B<printCloseAll>: If true, print the "Close all folders" or "open all folders" links. Default is true.
 
-=item * B<filterFunc>: A function that takes the resource object as its only parameter and returns a true or false value. If true, the resource is displayed. If false, it is simply skipped in the display. By default, all resources are showne.
+=item * B<filterFunc>: A function that takes the resource object as its only parameter and returns a true or false value. If true, the resource is displayed. If false, it is simply skipped in the display. By default, all resources are shown.
+
+=item * B<suppressNavmaps>: If true, will not display Navigate Content resources. Default to false.
 
 =back
 
@@ -815,6 +819,7 @@
     my $here;
     my $jump;
     my $currentJumpIndex = setDefault($args->{'currentJumpIndex'}, 0);    
+    my $suppressNavmap = setDefault($args->{'suppressNavmap'}, 0);
     my $currentJumpDelta = 2; # change this to change how many resources are displayed
                              # before the current resource when using #current
 
@@ -1081,6 +1086,12 @@
             next;
         } 
 
+        # If we're suppressing navmaps and this is a navmap, continue on
+        if ($suppressNavmap && $curRes->src() =~ /^\/adm\/navmaps/) {
+            $curRes = $it->next();
+            next;
+        }
+
         # Does it have multiple parts?
         $args->{'multipart'} = 0;
         $args->{'condensed'} = 0;
@@ -1192,7 +1203,7 @@
             $result .= "    </tr>\n";
             $args->{'isNewBranch'} = 0;
         }
-        
+
         if ($r && $rownum % 20 == 0) {
             $r->print($result);
             $result = "";
@@ -2691,7 +2702,7 @@
 sub extractParts { 
     my $self = shift;
     
-    return if ($self->{PARTS});
+    return if (defined($self->{PARTS}));
     return if ($self->ext);
 
     $self->{PARTS} = [];