Diff for /loncom/interface/lonnavmaps.pm between versions 1.116 and 1.117

version 1.116, 2002/11/26 16:25:36 version 1.117, 2002/11/26 17:01:29
Line 1384  sub new { Line 1384  sub new {
                   
             if (ref($curRes)) {              if (ref($curRes)) {
                 # If there's only one resource, this will save it                  # If there's only one resource, this will save it
                 if($direction == FORWARD) { $resource = $curRes; $resourceCount++; }                  # we have to filter empty resources from consideration here,
                   # or even "empty", redirecting maps have two (start & finish)
                   # or three (start, finish, plus redirector)
                   if($direction == FORWARD && $curRes->src()) { 
                       $resource = $curRes; $resourceCount++; 
                   }
                 my $resultingVal = $curRes->{DATA}->{$valName};                  my $resultingVal = $curRes->{DATA}->{$valName};
                 my $nextResources = $curRes->$nextResourceMethod();                  my $nextResources = $curRes->$nextResourceMethod();
                 my $nextCount = scalar(@{$nextResources});                  my $nextCount = scalar(@{$nextResources});
Line 1576  sub next { Line 1581  sub next {
     }      }
   
     # If this is a blank resource, don't actually return it.      # If this is a blank resource, don't actually return it.
       # Should you ever find you need it, make sure to add an option to the code
       #  that you can use; other things depend on this behavior.
     if (!$self->{HERE}->src()) {      if (!$self->{HERE}->src()) {
         return $self->next();          return $self->next();
     }      }
Line 1626  package Apache::lonnavmaps::DFSiterator; Line 1633  package Apache::lonnavmaps::DFSiterator;
 #  but this might as well be left seperate, since it is possible some other  #  but this might as well be left seperate, since it is possible some other
 #  use might be found for it. - Jeremy  #  use might be found for it. - Jeremy
   
   # Unlike the main iterator, this DOES return all resources, even blank ones.
   #  The main iterator needs them to correctly preprocess the map.
   
 sub BEGIN_MAP { return 1; }    # begining of a new map  sub BEGIN_MAP { return 1; }    # begining of a new map
 sub END_MAP { return 2; }      # end of the map  sub END_MAP { return 2; }      # end of the map
 sub FORWARD { return 1; }      # go forward  sub FORWARD { return 1; }      # go forward
Line 1763  sub next { Line 1773  sub next {
                                              $self->{CONDITION}, $self->{DIRECTION});                                               $self->{CONDITION}, $self->{DIRECTION});
     }      }
   
     # If this is a blank resource, ignore it.  
     if (!$self->{HERE}->src()) {  
         return $self->next();  
     }  
       
     return $self->{HERE};      return $self->{HERE};
 }  }
   

Removed from v.1.116  
changed lines
  Added in v.1.117


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>