Diff for /loncom/interface/lonnavmaps.pm between versions 1.554 and 1.559

version 1.554, 2021/08/04 19:59:10 version 1.559, 2022/06/23 19:31:39
Line 357  user into thinking that if the sequence Line 357  user into thinking that if the sequence
 under it; for example, see the "Show Uncompleted Homework" view on the  under it; for example, see the "Show Uncompleted Homework" view on the
 B<NAV> screen.  B<NAV> screen.
   
 =item * B<suppressNavmaps>: default: false  =item * B<suppressNavmap>: default: false
   
 If true, will not display Navigate Content resources.   If true, will not display Navigate Content resources. 
   
Line 1423  sub render { Line 1423  sub render {
     my $condition = 0;      my $condition = 0;
     if ($env{'form.condition'}) {      if ($env{'form.condition'}) {
         $condition = 1;          $condition = 1;
       } elsif (($env{'request.deeplink.login'}) && ($env{'request.course.id'}) && (!$userCanSeeHidden)) {
           if (!defined($navmap)) {
               $navmap = Apache::lonnavmaps::navmap->new();
           }
           if (defined($navmap)) {
               my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
               my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
               my $symb = &Apache::loncommon::symb_from_tinyurl($env{'request.deeplink.login'},$cnum,$cdom);
               if ($symb) {
                   my $deeplink;
                   my $res = $navmap->getBySymb($symb);
                   if ($res->is_map()) {
                       my $mapname = &Apache::lonnet::declutter($res->src());
                       $mapname = &Apache::lonnet::deversion($mapname);
                       $deeplink = $navmap->get_mapparam(undef,$mapname,"0.deeplink");
                   } else {
                       $deeplink = $res->deeplink();
                   }
                   if ($deeplink ne '') {
                       if ((split(/,/,$deeplink))[1] eq 'hide') {
                           if ($res->is_map()) {
                               map { $filterHash->{$_} = 1 if $_ } split(/,/,$res->map_hierarchy());
                           } else {
                               my $mapurl = (&Apache::lonnet::decode_symb($symb))[0];
                               my $map = $navmap->getResourceByUrl($mapurl);
                               map { $filterHash->{$_} = 1 if $_ } split(/,/,$map->map_hierarchy());
                           }
                       }
                   }
               }
           }
     }      }
   
     if (!$env{'form.folderManip'} && !defined($args->{'iterator'})) {      if (!$env{'form.folderManip'} && !defined($args->{'iterator'}) && !$args->{'nocurrloc'}) {
         # Step 1: Check to see if we have a navmap          # Step 1: Check to see if we have a navmap
         if (!defined($navmap)) {          if (!defined($navmap)) {
             $navmap = Apache::lonnavmaps::navmap->new();              $navmap = Apache::lonnavmaps::navmap->new();
Line 1464  sub render { Line 1495  sub render {
         my $mapIterator = $navmap->getIterator(undef, undef, undef, 1);          my $mapIterator = $navmap->getIterator(undef, undef, undef, 1);
         my $curRes;          my $curRes;
         my $found = 0;          my $found = 0;
           my $here_is_navmaps = 0; 
           if ($here =~ m{___\d+___adm/navmaps$}) {
               $here_is_navmaps = 1;
           }
                   
         # We only need to do this if we need to open the maps to show the          # We only need to do this if we need to open the maps to show the
         # current position. This will change the counter so we can't count          # current position. This will change the counter so we can't count
         # for the jump marker with this loop.          # for the jump marker with this loop.
         while ($here && ($curRes = $mapIterator->next()) && !$found) {          while ($here && ($curRes = $mapIterator->next()) && !$found && !$here_is_navmaps) {
             if (ref($curRes) && $curRes->symb() eq $here) {              if (ref($curRes) && $curRes->symb() eq $here) {
                 my $mapStack = $mapIterator->getStack();                  my $mapStack = $mapIterator->getStack();
                                   
Line 1585  sub render { Line 1620  sub render {
  '&amp;here='.&escape($here);   '&amp;here='.&escape($here);
     $text='Open all folders';      $text='Open all folders';
         }          }
         if ($env{'form.register'}) {  
             $link .= '&amp;register='.$env{'form.register'};  
         }  
  if ($args->{'caller'} eq 'navmapsdisplay') {   if ($args->{'caller'} eq 'navmapsdisplay') {
             unless ($args->{'notools'}) {              unless ($args->{'notools'}) {
                 &add_linkitem($args->{'linkitems'},'changefolder',                  &add_linkitem($args->{'linkitems'},'changefolder',
Line 1611  sub render { Line 1643  sub render {
  <input type="hidden" name="navurl" value="$querystr" />   <input type="hidden" name="navurl" value="$querystr" />
  <input type="hidden" name="navtime" value="$time" />   <input type="hidden" name="navtime" value="$time" />
 END  END
         if ($env{'form.register'}) {  
             $result .= '<input type="hidden" name="register" value="'.$env{'form.register'}.'" />';  
         }  
         if ($args->{'sort'} eq 'discussion') {           if ($args->{'sort'} eq 'discussion') { 
     my $totdisc = 0;      my $totdisc = 0;
     my $haveDisc = '';      my $haveDisc = '';
Line 1634  END Line 1663  END
  }   }
  $result.='</form>';   $result.='</form>';
     }      }
     if (($args->{'caller'} eq 'navmapsdisplay') &&      if (($args->{'caller'} eq 'navmapsdisplay') && ($env{'request.course.id'})) {
         ((&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) ||  
          (&Apache::lonnet::allowed('cev',$env{'request.course.id'})))) {  
         my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};          my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
         my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};          my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
         if ($env{'course.'.$env{'request.course.id'}.'.url'} eq           if ($env{'course.'.$env{'request.course.id'}.'.url'} eq
             "uploaded/$cdom/$cnum/default.sequence") {              "uploaded/$cdom/$cnum/default.sequence") {
             &add_linkitem($args->{'linkitems'},'edittoplevel',              if ((&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) ||
                           "javascript:gocmd('/adm/coursedocs','editdocs');",                  (&Apache::lonnet::allowed('cev',$env{'request.course.id'}))) {
                           'Content Editor');                  &add_linkitem($args->{'linkitems'},'edittoplevel',
                                 "javascript:gocmd('/adm/coursedocs','editdocs');",
                                 'Content Editor');
               }
               if ($counter) {
                   &add_linkitem($args->{'linkitems'},'printout',
                                 "javascript:gopost('/adm/printout','/adm/navmaps');",
                                 'Prepare a printable document');
               }
         }          }
     }      }
   
Line 2090  sub show_linkitems_toolbar { Line 2125  sub show_linkitems_toolbar {
             $result .= '<td align="left">'."\n".              $result .= '<td align="left">'."\n".
                        '<ul id="LC_toolbar">';                         '<ul id="LC_toolbar">';
             my @linkorder = ('firsthomework','everything','uncompleted',              my @linkorder = ('firsthomework','everything','uncompleted',
                              'changefolder','clearbubbles','edittoplevel');                               'changefolder','clearbubbles','printout','edittoplevel');
             foreach my $link (@linkorder) {              foreach my $link (@linkorder) {
                 if (ref($args->{'linkitems'}{$link}) eq 'HASH') {                  if (ref($args->{'linkitems'}{$link}) eq 'HASH') {
                     if ($args->{'linkitems'}{$link}{'text'} ne '') {                      if ($args->{'linkitems'}{$link}{'text'} ne '') {

Removed from v.1.554  
changed lines
  Added in v.1.559


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