Diff for /loncom/interface/lonnavdisplay.pm between versions 1.22.4.9 and 1.36

version 1.22.4.9, 2019/02/03 22:19:06 version 1.36, 2018/04/14 02:29:44
Line 39  use Apache::lonnet; Line 39  use Apache::lonnet;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::londocs();  use Apache::londocs();
 use Apache::lonuserstate;  use Apache::lonuserstate;
   use LONCAPA::ltiutils;
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
Line 54  sub real_handler { Line 55  sub real_handler {
         return OK;          return OK;
     }      }
   
     # Check for critical messages and redirect if present.      # Check for critical messages and redirect if present.  
     my ($redirect,$url) = &Apache::loncommon::critical_redirect(300);      my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'contents');
     if ($redirect) {      if ($redirect) {
         &Apache::loncommon::content_type($r,'text/html');          &Apache::loncommon::content_type($r,'text/html');
         $r->header_out(Location => $url);          $r->header_out(Location => $url);
Line 111  ENDCLOSE Line 112  ENDCLOSE
         }          }
     }      }
   
       my $course_type = &Apache::loncommon::course_type();
       if (($course_type eq 'Placement') && (!$env{'request.role.adv'})) { 
           my $furl = &Apache::lonpageflip::first_accessible_resource();
           if ($result eq 'update') {
               &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
               $r->print($closure.&Apache::loncommon::end_page());
               return OK;
           } else {
               &Apache::loncommon::content_type($r,'text/html');
               $r->header_out(Location => $furl);
               return REDIRECT;
           }
       }
   
       if ($env{'request.lti.login'}) {
           if ($env{'request.lti.uri'} ne '') {
               my $cid = $env{'request.course.id'};
               my $cnum = $env{'course.'.$cid.'.num'};
               my $cdom = $env{'course.'.$cid.'.domain'};
               my ($scope,$url) = &LONCAPA::ltiutils::lti_provider_scope($env{'request.lti.uri'},$cdom,$cnum);
               if (($scope eq 'map') || ($scope eq 'resource')) {
                   &Apache::loncommon::content_type($r,'text/html');
                   $r->header_out(Location => $url);
                   return REDIRECT;
               }
           }
       }
   
     # Create the nav map      # Create the nav map
     my $navmap = Apache::lonnavmaps::navmap->new();      my $navmap = Apache::lonnavmaps::navmap->new();
   
Line 228  ENDCLOSE Line 257  ENDCLOSE
                      ."</span>");                       ."</span>");
         }          }
     } else {      } else {
         my $link = '/adm/navmaps?jumpToFirstHomework';          my $link = 'navmaps?jumpToFirstHomework';
         if ($env{'form.register'}) {          if ($env{'form.register'}) {
             $link .= '&amp;register='.$env{'form.register'};               $link .= '&amp;register='.$env{'form.register'}; 
         }          }
Line 251  ENDCLOSE Line 280  ENDCLOSE
         $filterFunc = sub { my $res = shift;           $filterFunc = sub { my $res = shift; 
                             return $res->completable() || $res->is_map();                              return $res->completable() || $res->is_map();
                         };                          };
         my $link = '/adm/navmaps?sort='.$env{'form.sort'};          my $link = 'navmaps?sort='.$env{'form.sort'};
         if ($env{'form.register'}) {          if ($env{'form.register'}) {
             $link .= '&amp;register='.$env{'form.register'};              $link .= '&amp;register='.$env{'form.register'};
         }          }
Line 263  ENDCLOSE Line 292  ENDCLOSE
         $env{'form.condition'} = 1;          $env{'form.condition'} = 1;
  $resource_no_folder_link = 1;   $resource_no_folder_link = 1;
     } else {      } else {
         my $link = '/adm/navmaps?sort='.$env{'form.sort'}.'&amp;showOnlyHomework=1';          my $link = 'navmaps?sort='.$env{'form.sort'}.'&amp;showOnlyHomework=1';
         if ($env{'form.register'}) {          if ($env{'form.register'}) {
             $link .= '&amp;register='.$env{'form.register'};              $link .= '&amp;register='.$env{'form.register'};
         }          }
Line 368  sub startContentScreen { Line 397  sub startContentScreen {
         $r->print('<li '.(($mode eq 'supplemental')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>');          $r->print('<li '.(($mode eq 'supplemental')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>');
     }      }
     $r->print('<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Search').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>'."\n");      $r->print('<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Search').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>'."\n");
       $r->print('<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Index').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>'."\n");
     $r->print("\n".'</ul>'."\n");      $r->print("\n".'</ul>'."\n");
     $r->print('<div class="LC_Box" style="clear:both;margin:0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">');      $r->print('<div class="LC_Box" style="clear:both;margin:0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">');
 }  }

Removed from v.1.22.4.9  
changed lines
  Added in v.1.36


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