Diff for /loncom/interface/lonnavmaps.pm between versions 1.400 and 1.401

version 1.400, 2007/08/29 00:55:37 version 1.401, 2007/09/01 00:41:42
Line 170  sub getLinkForResource { Line 170  sub getLinkForResource {
         if (defined($item)) { $res = $item; }          if (defined($item)) { $res = $item; }
     }      }
   
     return ($res->link(),$res->shown_symb());      if ($res) {
    return ($res->link(),$res->shown_symb());
       }
       return;
 }  }
   
 # Convenience function: This separates the logic of how to create  # Convenience function: This separates the logic of how to create
Line 604  instruct the renderer to render only a p Line 607  instruct the renderer to render only a p
 the source of the map you want to process, like  the source of the map you want to process, like
 '/res/103/jerf/navmap.course.sequence'.  '/res/103/jerf/navmap.course.sequence'.
   
   =item * B<include_top_level_map>: default: false
   
   If you need to include the top level map (meaning the course) in the
   rendered output set this to true
   
 =item * B<navmap>: default: constructs one from %env  =item * B<navmap>: default: constructs one from %env
   
 A reference to a navmap, used only if an iterator is not passed in. If  A reference to a navmap, used only if an iterator is not passed in. If
Line 1236  sub render { Line 1244  sub render {
   
             $args->{'iterator'} = $it = $navmap->getIterator($firstResource, $finishResource, $filterHash, $condition);              $args->{'iterator'} = $it = $navmap->getIterator($firstResource, $finishResource, $filterHash, $condition);
         } else {          } else {
             $args->{'iterator'} = $it = $navmap->getIterator(undef, undef, $filterHash, $condition);              $args->{'iterator'} = $it = $navmap->getIterator(undef, undef, $filterHash, $condition,undef,$args->{'include_top_level_map'});
         }          }
     }      }
   
Line 2858  sub next { Line 2866  sub next {
         $self->{HAVE_RETURNED_0} = 1;          $self->{HAVE_RETURNED_0} = 1;
         return $self->{NAV_MAP}->getById('0.0');          return $self->{NAV_MAP}->getById('0.0');
     }      }
       if ($self->{RETURN_0} && !$self->{HAVE_RETURNED_0_BEGIN_MAP}) {
    $self->{HAVE_RETURNED_0_BEGIN_MAP} = 1;
    return $self->BEGIN_MAP();
       }
   
     if ($self->{RECURSIVE_ITERATOR_FLAG}) {      if ($self->{RECURSIVE_ITERATOR_FLAG}) {
         # grab the next from the recursive iterator           # grab the next from the recursive iterator 
Line 3576  sub contains_problem { Line 3588  sub contains_problem {
     }      }
     return 0;      return 0;
 }  }
   sub map_contains_problem {
       my $self=shift;
       if ($self->is_map()) {
    my $has_problem=
       $self->hasResource($self,sub { $_[0]->is_problem() },1);
    return $has_problem;
       }
       return 0;
   }
 sub is_sequence {  sub is_sequence {
     my $self=shift;      my $self=shift;
     return $self->navHash("is_map_", 1) &&       return $self->navHash("is_map_", 1) && 

Removed from v.1.400  
changed lines
  Added in v.1.401


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