Diff for /loncom/interface/lonnavmaps.pm between versions 1.533 and 1.534

version 1.533, 2017/08/21 21:29:56 version 1.534, 2017/09/03 18:52:27
Line 2886  sub recursed_crumbs { Line 2886  sub recursed_crumbs {
     my (@revmapinfo,@revmapres);      my (@revmapinfo,@revmapres);
     my $mapres = $self->getResourceByUrl($mapurl);      my $mapres = $self->getResourceByUrl($mapurl);
     if (ref($mapres)) {      if (ref($mapres)) {
         @revmapres = map { $self->getByMapPc($_); } split(/,/,$mapres->map_hierarchy());          @revmapres = map { $self->getByMapPc($_); } split(/,/,$mapres->map_breadcrumbs());
         shift(@revmapres);          shift(@revmapres);
         push(@revmapres,$mapres);  
     }      }
     my %toplevel;  
     foreach my $map (@revmapres) {      foreach my $map (@revmapres) {
         my $pc = $map->map_pc();          my $pc = $map->map_pc();
         next if ((!$pc) || ($pc == 1));          next if ((!$pc) || ($pc == 1));
         my $func = sub { return ($_[0]->src() ne $map->src); };          push(@revmapinfo,{'href' => $map->link().'?navmap=1','text' => $map->title(),'no_mt' => 1,});
         my @resources = $self->retrieveResources($map->src,$func,0);  
         my $count = 0;  
         my $notmap = 0;  
         foreach my $res (@resources) {  
             next unless (ref($res));  
             my $symb = $res->symb();  
             unless ($toplevel{$symb}) {  
                 $toplevel{$symb} = $res->src;  
                 $count ++;  
                 unless ($res->is_map()) {  
                     $notmap ++;  
                 }  
             }  
         }  
         if (($count > 1) || ($count && $notmap)) {  
              push(@revmapinfo,{'href' => $map->link().'?navmap=1','text' => $map->title(),'no_mt' => 1,});  
         }  
     }      }
     return @revmapinfo;      return @revmapinfo;
 }  }
   
   
 #  #
 #  Determines the open/close dates for printing a map that  #  Determines the open/close dates for printing a map that
 #  encloses a resource.  #  encloses a resource.
Line 4564  Returns a string with a comma-separated Line 4544  Returns a string with a comma-separated
 for the hierarchy of maps containing a map, with the top level  for the hierarchy of maps containing a map, with the top level
 map first, then descending to deeper levels, with the enclosing map last.  map first, then descending to deeper levels, with the enclosing map last.
   
   =item * B<map_breadcrumbs>:
   
   Same as map_hierarchy, except maps containing only a single itemm if
   it's a map, or containing no items are omitted, unless it's the top
   level map (map_pc = 1), which is always included.
   
 =back  =back
   
 =cut  =cut
Line 4599  sub map_hierarchy { Line 4585  sub map_hierarchy {
     my $pc = $self->map_pc();      my $pc = $self->map_pc();
     return $self->navHash("map_hierarchy_$pc", 0);      return $self->navHash("map_hierarchy_$pc", 0);
 }  }
   sub map_breadcrumbs {
       my $self = shift;
       my $pc = $self->map_pc();
       return $self->navHash("map_breadcrumbs_$pc", 0);
   }
   
 #####  #####
 # Property queries  # Property queries

Removed from v.1.533  
changed lines
  Added in v.1.534


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