Diff for /loncom/interface/lonnavmaps.pm between versions 1.509.2.10 and 1.509.2.11

version 1.509.2.10, 2019/02/07 00:49:53 version 1.509.2.11, 2019/07/27 16:44:31
Line 1726  END Line 1726  END
  undef($args->{'sort'});   undef($args->{'sort'});
     }      }
   
       # Determine if page will be served with https in case
       # it contains a syllabus which uses an external URL
       # which points at an http site.
   
       my ($is_ssl,$cdom,$cnum,$hostname);
       if ($ENV{'SERVER_PORT'} == 443) {
           $is_ssl = 1;
           if ($r) {
               $hostname = $r->hostname();
           } else {
               $hostname = $ENV{'SERVER_NAME'};
           }
       }
       if ($env{'request.course.id'}) {
           $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
           $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
       }
   
     my $inhibitmenu;      my $inhibitmenu;
     if ($args->{'modalLink'}) {      if ($args->{'modalLink'}) {
Line 1864  END Line 1881  END
  $stack=$it->getStack();   $stack=$it->getStack();
     }      }
     ($src,$symb,$anchor)=getLinkForResource($stack);      ($src,$symb,$anchor)=getLinkForResource($stack);
     my $srcHasQuestion = $src =~ /\?/;              my $srcHasQuestion = $src =~ /\?/;
               if ($env{'request.course.id'}) {
                   if (($is_ssl) && ($src =~ m{^\Q/public/$cdom/$cnum/syllabus\E($|\?)}) &&
                       ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                       unless (&Apache::lonnet::uses_sts()) {
                           if ($hostname ne '') {
                               $src = 'http://'.$hostname.$src;
                           }
                           $src .= ($srcHasQuestion? '&' : '?') . 'usehttp=1';
                           $srcHasQuestion = 1;
                       }
                   } elsif (($is_ssl) && ($src =~ m{^\Q/adm/wrapper/ext/\E(?!https:)})) {
                       unless (&Apache::lonnet::uses_sts()) {
                           if ($hostname ne '') {
                               $src = 'http://'.$hostname.$src;
                           }
                           $src .= ($srcHasQuestion? '&' : '?') . 'usehttp=1';
                           $srcHasQuestion = 1;
                       }
                   }
               }
     if (defined($anchor)) { $anchor='#'.$anchor; }      if (defined($anchor)) { $anchor='#'.$anchor; }
             if (($args->{'caller'} eq 'sequence') && ($curRes->is_map())) {              if (($args->{'caller'} eq 'sequence') && ($curRes->is_map())) {
                 $args->{"resourceLink"} = $src.($srcHasQuestion?'&':'?') .'navmap=1';                  $args->{"resourceLink"} = $src.($srcHasQuestion?'&':'?') .'navmap=1';
Line 2825  sub recursed_crumbs { Line 2862  sub recursed_crumbs {
         my $pc = $map->map_pc();          my $pc = $map->map_pc();
         next if ((!$pc) || ($pc == 1));          next if ((!$pc) || ($pc == 1));
         push(@links,$map);          push(@links,$map);
         push(@revmapinfo,{'href' => $map->link().'?navmap=1','text' => $map->title(),'no_mt' => 1,});          push(@revmapinfo,{'href' => $env{'request.use_absolute'}.$map->link().'?navmap=1','text' => $map->title(),'no_mt' => 1,});
         $totallength += length($map->title());          $totallength += length($map->title());
     }      }
     my $numlinks = scalar(@links);      my $numlinks = scalar(@links);
Line 2840  sub recursed_crumbs { Line 2877  sub recursed_crumbs {
             foreach my $map (@links) {              foreach my $map (@links) {
                 my $showntitle = &truncate_crumb_text($map->title(),$avg);                  my $showntitle = &truncate_crumb_text($map->title(),$avg);
                 if ($showntitle ne '') {                  if ($showntitle ne '') {
                     push(@revmapinfo,{'href' => $map->link().'?navmap=1','text' => $showntitle,'no_mt' => 1,});                      push(@revmapinfo,{'href' => $env{'request.use_absolute'}.$map->link().'?navmap=1','text' => $showntitle,'no_mt' => 1,});
                 }                  }
             }              }
         }          }

Removed from v.1.509.2.10  
changed lines
  Added in v.1.509.2.11


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