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

version 1.532, 2017/07/10 13:01:39 version 1.533, 2017/08/21 21:29:56
Line 1007  sub render_resource { Line 1007  sub render_resource {
             # Don't allow users to manipulate folder              # Don't allow users to manipulate folder
             $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';              $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
             $icon = "<img class=\"LC_space\" src='$whitespace' alt='' />"."<img class=\"LC_contentImage\" src='$location/$icon' alt=\"".($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" />";              $icon = "<img class=\"LC_space\" src='$whitespace' alt='' />"."<img class=\"LC_contentImage\" src='$location/$icon' alt=\"".($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" />";
               if ($params->{'caller'} eq 'sequence') {
             $linkopen = "";                  $linkopen = "<a href=\"$link\">";
             $linkclose = "";              } else {
                   $linkopen = "";
                   $linkclose = "";
               }
         }          }
         if (((&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) ||          if (((&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) ||
               (&Apache::lonnet::allowed('cev',$env{'request.course.id'}))) &&                (&Apache::lonnet::allowed('cev',$env{'request.course.id'}))) &&
Line 1372  sub render { Line 1375  sub render {
             my $currenturl = $env{'form.postdata'};              my $currenturl = $env{'form.postdata'};
             #$currenturl=~s/^http\:\/\///;              #$currenturl=~s/^http\:\/\///;
             #$currenturl=~s/^[^\/]+//;              #$currenturl=~s/^[^\/]+//;
                           unless ($args->{'caller'} eq 'sequence') {
             $here = $jump = &Apache::lonnet::symbread($currenturl);                  $here = $jump = &Apache::lonnet::symbread($currenturl);
               }
  }   }
  if ($here eq '') {   if (($here eq '') && ($args->{'caller'} ne 'sequence')) {
     my $last;      my $last;
     if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',      if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',
                     &GDBM_READER(),0640)) {                      &GDBM_READER(),0640)) {
Line 1866  END Line 1870  END
                 }                  }
             }              }
     if (defined($anchor)) { $anchor='#'.$anchor; }      if (defined($anchor)) { $anchor='#'.$anchor; }
     $args->{"resourceLink"} = $src.      if (($args->{'caller'} eq 'sequence') && ($curRes->is_map())) {
  ($srcHasQuestion?'&amp;':'?') .          $args->{"resourceLink"} = $src.($srcHasQuestion?'&amp;':'?') .'navmap=1';
  'symb=' . &escape($symb).$anchor;      } else {
           $args->{"resourceLink"} = $src.
       ($srcHasQuestion?'&amp;':'?') .
       'symb=' . &escape($symb).$anchor;
       }
  }   }
         # Now, we've decided what parts to show. Loop through them and          # Now, we've decided what parts to show. Loop through them and
         # show them.          # show them.
Line 2873  sub recurseup_maps { Line 2881  sub recurseup_maps {
     return @recurseup;      return @recurseup;
 }  }
   
   sub recursed_crumbs {
       my ($self,$mapurl) = @_;
       my (@revmapinfo,@revmapres);
       my $mapres = $self->getResourceByUrl($mapurl);
       if (ref($mapres)) {
           @revmapres = map { $self->getByMapPc($_); } split(/,/,$mapres->map_hierarchy());
           shift(@revmapres);
           push(@revmapres,$mapres);
       }
       my %toplevel;
       foreach my $map (@revmapres) {
           my $pc = $map->map_pc();
           next if ((!$pc) || ($pc == 1));
           my $func = sub { return ($_[0]->src() ne $map->src); };
           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;
   }
   
   
 #  #
 #  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.

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


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