Diff for /rat/lonpageflip.pm between versions 1.91 and 1.92

version 1.91, 2016/05/30 02:52:42 version 1.92, 2017/02/18 23:39:24
Line 245  sub first_accessible_resource { Line 245  sub first_accessible_resource {
     my ($newmapid,$newresid)=split(/\./,$newrid);      my ($newmapid,$newresid)=split(/\./,$newrid);
     my $symb=&Apache::lonnet::encode_symb($newmap,$newresid,$hash{'src_'.$newrid});      my $symb=&Apache::lonnet::encode_symb($newmap,$newresid,$hash{'src_'.$newrid});
     $furl=&add_get_param($hash{'src_'.$newrid},{ 'symb' => $symb });      $furl=&add_get_param($hash{'src_'.$newrid},{ 'symb' => $symb });
               &check_for_syllabus(\$furl);
     if ($hash{'encrypted_'.$newrid}) {      if ($hash{'encrypted_'.$newrid}) {
  $furl=&Apache::lonenc::encrypted($furl);   $furl=&Apache::lonenc::encrypted($furl);
     }      }
Line 279  sub first_answerable_ressymb { Line 280  sub first_answerable_ressymb {
     }      }
 }  }
   
   sub check_for_syllabus {
       my ($srcref) = @_;
       return unless (ref($srcref) eq 'SCALAR');
       if ($env{'request.course.id'}) {
           my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
           my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
           if (($$srcref =~ m{^\Q/public/$cdom/$cnum/syllabus\E($|\?)}) &&
               ($ENV{'SERVER_PORT'} == 443) &&
               ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
               $$srcref .= (($$srcref =~/\?/)? '&':'?') . 'usehttp=1';
           }
       }
   }
   
 # ================================================================ Main Handler  # ================================================================ Main Handler
   
 sub handler {  sub handler {
Line 379  sub handler { Line 394  sub handler {
     $id=$hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id;      $id=$hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id;
     $newloc=$hash{'src_'.$id};      $newloc=$hash{'src_'.$id};
     if ($newloc) {      if ($newloc) {
  if ($hash{'encrypted_'.$id}) { $newloc=&Apache::lonenc::encrypted($newloc); }                  &check_for_syllabus(\$newloc);
    if ($hash{'encrypted_'.$id}) { 
                       $newloc=&Apache::lonenc::encrypted($newloc);
                   } elsif ($newloc =~ m{^(/adm/wrapper/ext/[^\#]+)\#([^\#]+)$}) {
                       $newloc = $1.&escape('#').$2;
                   }
     } else {      } else {
  $newloc='/adm/navmaps';   $newloc='/adm/navmaps';
     }      }
Line 494  sub handler { Line 514  sub handler {
 # ------------------------------------- Check for and display critical messages  # ------------------------------------- Check for and display critical messages
                   my ($redirect, $url) = &Apache::loncommon::critical_redirect(300);                    my ($redirect, $url) = &Apache::loncommon::critical_redirect(300);
                   unless ($redirect) {                    unless ($redirect) {
                         &check_for_syllabus(\$redirecturl);
                       $url=&Apache::lonnet::absolute_url().$redirecturl;                        $url=&Apache::lonnet::absolute_url().$redirecturl;
                       my $addanchor;                        my $addanchor;
                       if (($anchor ne '') && (!$enc || $env{'request.role.adv'})) {                        if (($anchor ne '') && (!$enc || $env{'request.role.adv'})) {
Line 543  $lt{'pick'}: Line 564  $lt{'pick'}:
 <tr><th>$lt{'titleheader'}</th><th>$lt{'type'}</th></tr>  <tr><th>$lt{'titleheader'}</th><th>$lt{'type'}</th></tr>
 ENDSTART  ENDSTART
                      foreach my $id (@possibilities) {                       foreach my $id (@possibilities) {
                           my $src = $multichoicehash{'src_'.$id};
                           &check_for_syllabus(\$src);
                         $r->print(                          $r->print(
                               '<tr><td><a href="'.                                '<tr><td><a href="'.
   &add_get_param($multichoicehash{'src_'.$id},    &add_get_param($src,
  {'symb' =>   {'symb' =>
       $multichoicehash{'symb_'.$id},        $multichoicehash{'symb_'.$id},
   }).'">'.    }).'">'.

Removed from v.1.91  
changed lines
  Added in v.1.92


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