Diff for /loncom/interface/lonnavmaps.pm between versions 1.126 and 1.129.2.1

version 1.126, 2003/01/13 22:41:20 version 1.129.2.1, 2003/02/01 19:55:00
Line 273  sub real_handler { Line 273  sub real_handler {
     $mapIterator->next(); # discard the first BEGIN_MAP      $mapIterator->next(); # discard the first BEGIN_MAP
     my $curRes = $mapIterator->next();      my $curRes = $mapIterator->next();
     my $counter = 0;      my $counter = 0;
 <<<<<<< lonnavmaps.pm  
   
     # We only need to do this if we need to open the maps to show the  
     # current position  
     while ($depth > 0 && !$ENV{'form.alreadyHere'}) {  
 =======  
     my $foundJump = ($jumpType == $NOTHING); # look for jump point if we have one      my $foundJump = ($jumpType == $NOTHING); # look for jump point if we have one
     my $looped = 0;       my $looped = 0; 
   
Line 286  sub real_handler { Line 280  sub real_handler {
     # current position. This will change the counter so we can't count      # current position. This will change the counter so we can't count
     # for the jump marker with this loop.      # for the jump marker with this loop.
     while ($depth > 0 && !$ENV{'form.alreadyHere'}) {      while ($depth > 0 && !$ENV{'form.alreadyHere'}) {
 >>>>>>> 1.122  
         if ($curRes == $mapIterator->BEGIN_MAP()) { $depth++; }          if ($curRes == $mapIterator->BEGIN_MAP()) { $depth++; }
         if ($curRes == $mapIterator->END_MAP()) { $depth--; }          if ($curRes == $mapIterator->END_MAP()) { $depth--; }
   
Line 305  sub real_handler { Line 298  sub real_handler {
             }              }
             $ENV{'form.alreadyHere'} = 1;              $ENV{'form.alreadyHere'} = 1;
         }          }
 <<<<<<< lonnavmaps.pm  
               
 =======  
         $looped = 1;          $looped = 1;
   
         $curRes = $mapIterator->next();          $curRes = $mapIterator->next();
Line 337  sub real_handler { Line 327  sub real_handler {
             $foundJump = 1;              $foundJump = 1;
         }          }
   
 >>>>>>> 1.122  
         $curRes = $mapIterator->next();          $curRes = $mapIterator->next();
     }      }
           
Line 699  sub real_handler { Line 688  sub real_handler {
   
     $navmap->untieHashes();      $navmap->untieHashes();
   
     $r->print("<h1>Course Map Untied</h1></body></html>");      $r->print("</body></html>");
   
     return OK;      return OK;
 }  }
Line 1010  sub new { Line 999  sub new {
         return undef;          return undef;
     }      }
   
       $self->{HASH_TIED} = 1;
     $self->{NAV_HASH} = \%navmaphash;      $self->{NAV_HASH} = \%navmaphash;
     $self->{PARM_HASH} = \%parmhash;      $self->{PARM_HASH} = \%parmhash;
   
     bless($self);      bless($self);
     $self->untieHashes();  
                   
     return $self;      return $self;
 }  }
Line 1490  sub new { Line 1479  sub new {
             if ($curRes == $iterator->END_MAP()) { $depth--; }              if ($curRes == $iterator->END_MAP()) { $depth--; }
                   
             if (ref($curRes)) {              if (ref($curRes)) {
 <<<<<<< lonnavmaps.pm  
                 # If there's only one resource, this will save it  
                 $resource = $curRes; $resourceCount++;  
 =======  
                 # If there's only one resource, this will save it                  # If there's only one resource, this will save it
                 # we have to filter empty resources from consideration here,                  # we have to filter empty resources from consideration here,
                 # or even "empty", redirecting maps have two (start & finish)                  # or even "empty", redirecting maps have two (start & finish)
Line 1501  sub new { Line 1486  sub new {
                 if($direction == FORWARD && $curRes->src()) {                   if($direction == FORWARD && $curRes->src()) { 
                     $resource = $curRes; $resourceCount++;                       $resource = $curRes; $resourceCount++; 
                 }                  }
 >>>>>>> 1.122  
                 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 1695  sub next { Line 1679  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      # 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.      #  that you can use; other things depend on this behavior.
     if (!$self->{HERE}->src()) {      if (!$self->{HERE}->src() || !$self->{HERE}->browsePriv()) {
         return $self->next();          return $self->next();
     }      }
   
Line 2634  sub getNext { Line 2618  sub getNext {
         my $next = $choice->goesto();          my $next = $choice->goesto();
         $next = $self->{NAV_MAP}->getById($next);          $next = $self->{NAV_MAP}->getById($next);
   
         # Don't remember it if the student doesn't have browse priviledges          push @branches, $next;
         # future note: this may properly belong in the client of the resource  
         my $browsePriv = $self->{BROWSE_PRIV};  
         if (!defined($browsePriv)) {  
             $browsePriv = &Apache::lonnet::allowed('bre', $self->src);  
             $self->{BROWSE_PRIV} = $browsePriv;  
         }  
         if (!($browsePriv ne '2' && $browsePriv ne 'F')) {  
             push @branches, $next;  
         }  
     }      }
     return \@branches;      return \@branches;
 }  }
Line 2657  sub getPrevious { Line 2632  sub getPrevious {
         my $prev = $choice->comesfrom();          my $prev = $choice->comesfrom();
         $prev = $self->{NAV_MAP}->getById($prev);          $prev = $self->{NAV_MAP}->getById($prev);
   
         # Don't remember it if the student doesn't have browse priviledges          push @branches, $prev;
         # future note: this may properly belong in the client of the resource  
         my $browsePriv = $self->{BROWSE_PRIV};  
         if (!defined($browsePriv)) {  
             $browsePriv = &Apache::lonnet::allowed('bre', $self->src);  
             $self->{BROWSE_PRIV} = $browsePriv;  
         }  
         if (!($browsePriv ne '2' && $browsePriv ne 'F')) {  
             push @branches, $prev;  
         }  
     }      }
     return \@branches;      return \@branches;
 }  }
   
   sub browsePriv {
       my $self = shift;
       if (defined($self->{BROWSE_PRIV})) {
           return $self->{BROWSE_PRIV};
       }
   
       $self->{BROWSE_PRIV} = &Apache::lonnet::allowed('bre', $self->src());
   }
   
 =pod  =pod
   
 =back  =back

Removed from v.1.126  
changed lines
  Added in v.1.129.2.1


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