Diff for /loncom/interface/lonnavmaps.pm between versions 1.509.2.14.2.6 and 1.509.2.14.2.7

version 1.509.2.14.2.6, 2023/01/20 22:45:51 version 1.509.2.14.2.7, 2023/01/20 22:51:11
Line 1705  END Line 1705  END
     # mark as hidden for users who have $userCanSeeHidden.      # mark as hidden for users who have $userCanSeeHidden.
     # Use DFS for speed, since structure actually doesn't matter,      # Use DFS for speed, since structure actually doesn't matter,
     # except what map has what resources.      # except what map has what resources.
       #
       # To ensure the "Selected Resources from selected folder in course"
       # printout generation option will work in sessions launched via a
       # deep link, the value of $args->{'filterFunc'} included in the
       # call to lonnavmaps::render() is omitted from the filter function
       # used with the DFS Iterator when $args->{'caller'} is 'printout'.
       #
       # As a result $sequence->{DATA}->{HAS_VISIBLE_CHILDREN} can be
       # set to 1 for folder(s) which include resources only accessible
       # for sessions launched via a deep link, when the current session
       # is of that type.
   
     my $dfsit = Apache::lonnavmaps::DFSiterator->new($navmap,      my $dfsit = Apache::lonnavmaps::DFSiterator->new($navmap,
                                                      $it->{FIRST_RESOURCE},                                                       $it->{FIRST_RESOURCE},
                                                      $it->{FINISH_RESOURCE},                                                       $it->{FINISH_RESOURCE},
                                                      {}, undef, 1);                                                       {}, undef, 1);
   
       my $dfsFilterFunc;
       if ($args->{'caller'} eq 'printout') {
           $dfsFilterFunc = sub { my $res = shift; return !$res->randomout() &&
                                 ($res->deeplink($args->{'caller'}) ne 'absent') &&
                                 ($res->deeplink($args->{'caller'}) ne 'grades') &&
                                 !$res->deeplinkout();};
       } else {
           $dfsFilterFunc = $filterFunc;
       }
     my $depth = 0;      my $depth = 0;
     $dfsit->next();      $dfsit->next();
     my $curRes = $dfsit->next();      my $curRes = $dfsit->next();
Line 1729  END Line 1749  END
             } elsif ($curRes->src()) {              } elsif ($curRes->src()) {
                 # Not a sequence: if it's filtered, ignore it, otherwise                  # Not a sequence: if it's filtered, ignore it, otherwise
                 # rise up the stack and mark the sequences as having children                  # rise up the stack and mark the sequences as having children
                 if (&$filterFunc($curRes)) {                  if (&$dfsFilterFunc($curRes)) {
                     for my $sequence (@{$dfsit->getStack()}) {                      for my $sequence (@{$dfsit->getStack()}) {
                           next unless ($sequence->is_map());
                         $sequence->{DATA}->{HAS_VISIBLE_CHILDREN} = 1;                          $sequence->{DATA}->{HAS_VISIBLE_CHILDREN} = 1;
                     }                      }
                 }                  }

Removed from v.1.509.2.14.2.6  
changed lines
  Added in v.1.509.2.14.2.7


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