Diff for /loncom/interface/lonnavmaps.pm between versions 1.569 and 1.574

version 1.569, 2025/02/03 00:08:31 version 1.574, 2025/05/26 19:55:09
Line 48  described at http://www.lon-capa.org. Line 48  described at http://www.lon-capa.org.
   
 =head1 OVERVIEW  =head1 OVERVIEW
   
 X<lonnavmaps, overview> When a user enters a course, LON-CAPA examines the  X<lonnavmaps, overview>
   When a user enters a course, LON-CAPA examines the
 course structure and caches it in what is often referred to as the  course structure and caches it in what is often referred to as the
 "big hash" X<big hash>. You can see it if you are logged into  "big hash" X<big hash>. You can see it if you are logged into
 LON-CAPA, in a course, by going to /adm/test. The content of   LON-CAPA, in a course, by going to /adm/test. The content of 
Line 1572  sub render { Line 1573  sub render {
     my $curRes;      my $curRes;
     my $foundJump = 0;      my $foundJump = 0;
     my $counter = 0;      my $counter = 0;
       
     while (($curRes = $mapIterator->next()) && !$foundJump) {      while (($curRes = $mapIterator->next()) && !$foundJump) {
         if (ref($curRes)) { $counter++; }          if (ref($curRes)) { $counter++; }
                   # Speed up display after course initialization
           # when $jump is empty. Note: we still need
           # $counter to be 1 in that case if there is at
           # least one resource.
           last if (($jump eq '') && ($counter));
   
         if (ref($curRes) && $jump eq $curRes->symb()) {          if (ref($curRes) && $jump eq $curRes->symb()) {
                           
             # This is why we have to use the main iterator instead of the              # This is why we have to use the main iterator instead of the
Line 1598  sub render { Line 1604  sub render {
     # Print key?      # Print key?
     if ($printKey) {      if ($printKey) {
         my $location = &Apache::loncommon::lonhttpdurl("/adm/lonMisc");          my $location = &Apache::loncommon::lonhttpdurl("/adm/lonMisc");
         $result .= '<table border="0" cellpadding="2" cellspacing="0">'.          $result .= '<div class="LC_navtools">'."\n".
                    '<tr><td align="right" valign="bottom">Key:&nbsp;&nbsp;</td>'.                     '<span class="LC_middle LC_right">'.&mt('Key').':</span>'.
                    '<td align="center" valign="bottom">&nbsp;&nbsp;'.                     '<span class="LC_middle LC_center">&nbsp;&nbsp;'.
                    '<img src="'.$location.'/chat.gif" alt="" /> '.&mt('Unread Discussion').                     '<img src="'.$location.'/chat.gif" alt="" /> '.&mt('Unread Discussion').
                    '</td><td align="center" valign="bottom">'.                     '&nbsp;&nbsp;'.
                    '&nbsp;&nbsp;<img src="'.$location.'/feedback.gif" alt="" /> '.                     '<img src="'.$location.'/feedback.gif" alt="" /> '.
                    &mt('New message (click to open)').                     &mt('New message (click to open)').
                    '</td></tr></table>'."\n";                     '</span></div>'.
                      '<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n";
     }      }
   
     if ($printCloseAll && !$args->{'resource_no_folder_link'}) {      if ($printCloseAll && !$args->{'resource_no_folder_link'}) {
Line 1702  END Line 1709  END
     $result .= "<br />\n";      $result .= "<br />\n";
   
     # Data      # Data
     $result.=&Apache::loncommon::start_data_table("LC_tableOfContent");          if ($counter) {
           $result.=&Apache::loncommon::start_data_table("LC_tableOfContent").
                    &Apache::loncommon::start_data_table_header_row('LC_visually_hidden').
                    '<th>'.&mt('Resource or Folder').'</th>'.
                    '<th>'.&mt('Alerts').'</th>'.
                    '<th>'.&mt('Status Icon').'</th>'.
                    '<th>'.&mt('Date/Completion Status').'</th>'.
                    &Apache::loncommon::end_data_table_row()."\n";
       }
   
     my $res = "Apache::lonnavmaps::resource";      my $res = "Apache::lonnavmaps::resource";
     my %condenseStatuses =      my %condenseStatuses =
Line 1714  END Line 1729  END
     $args->{'counter'} = 0; # counts the rows      $args->{'counter'} = 0; # counts the rows
     $args->{'indentLevel'} = 0;      $args->{'indentLevel'} = 0;
     $args->{'isNewBranch'} = 0;      $args->{'isNewBranch'} = 0;
     $args->{'condensed'} = 0;         $args->{'condensed'} = 0;
       $args->{'deeplinknolist'} = 0;
   
     my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif");      my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif");
     $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' alt='' />");      $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' alt='' />");
Line 1889  END Line 1905  END
   
         # If this has been filtered out, continue on          # If this has been filtered out, continue on
         if (!(&$filterFunc($curRes))) {          if (!(&$filterFunc($curRes))) {
               if (!$userCanSeeHidden && !$curRes->randomout && $curRes->deeplinkout) {
                   $args->{'deeplinknolist'} ++;
               }
             $args->{'isNewBranch'} = 0; # Don't falsely remember this              $args->{'isNewBranch'} = 0; # Don't falsely remember this
             next;              next;
         }           } 
Line 1913  END Line 1932  END
                     if ($userCanSeeHidden) {                      if ($userCanSeeHidden) {
                         $args->{'mapHiddenDeepLink'} = 1;                          $args->{'mapHiddenDeepLink'} = 1;
                     } else {                      } else {
                           $args->{'deeplinknolist'} ++;
                         next;                          next;
                     }                      }
                 } else {                  } else {
Line 1922  END Line 1942  END
                         if ($userCanSeeHidden) {                          if ($userCanSeeHidden) {
                             $args->{'mapUnlisted'} = 1;                              $args->{'mapUnlisted'} = 1;
                         } else {                          } else {
                               $args->{'deeplinknolist'} ++;
                             next;                              next;
                         }                          }
                     }                      }
Line 2100  END Line 2121  END
  }   }
     }      }
   
     $result.=&Apache::loncommon::end_data_table();      if ($counter) {
           $result.=&Apache::loncommon::end_data_table();
       }
           
     # Print out the part that jumps to #curloc if it exists      # Print out the part that jumps to #curloc if it exists
     # delay needed because the browser is processing the jump before      # delay needed because the browser is processing the jump before
Line 2139  sub show_linkitems_toolbar { Line 2162  sub show_linkitems_toolbar {
         if (ref($args->{'linkitems'}) eq 'HASH') {          if (ref($args->{'linkitems'}) eq 'HASH') {
             my $numlinks = scalar(keys(%{$args->{'linkitems'}}));              my $numlinks = scalar(keys(%{$args->{'linkitems'}}));
             if ($numlinks > 1) {              if ($numlinks > 1) {
                 $result = '<td>'.                  $result = '<div class="LC_navtools">'.
                           &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',                            &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',
                                                              undef,'RAT').                                                               undef,'RAT').
                           '</td>'.                            '</div><div class="LC_navtools">&nbsp;'.&mt('Tools:').'</div>';
                           '<td>&nbsp;</td>'.  
                           '<td class="LC_middle">'.&mt('Tools:').'</td>';  
             }              }
             $result .= '<td align="left">'."\n".              $result .= '<div class="LC_navtools">'."\n".
                        '<ul id="LC_toolbar">';                         '<ul id="LC_toolbar">';
             my @linkorder = ('firsthomework','everything','uncompleted',              my @linkorder = ('firsthomework','everything','uncompleted',
                              'changefolder','clearbubbles','printout','edittoplevel');                               'changefolder','clearbubbles','printout','edittoplevel');
Line 2174  sub show_linkitems_toolbar { Line 2195  sub show_linkitems_toolbar {
                 }                  }
             }              }
             $result .= '</ul>'.              $result .= '</ul>'.
                        '</td>';                         '</div>';
             if (($numlinks==1) && (exists($args->{'linkitems'}{'edittoplevel'}))) {              if (($numlinks==1) && (exists($args->{'linkitems'}{'edittoplevel'}))) {
                 $result .= '<td><a href="'.$args->{'linkitems'}{'edittoplevel'}{'cmd'}.'">'.                  $result .= '<div class="LC_navtools">'.
                            &mt('Content Editor').'</a></td>';                             '&nbsp;<a href="'.$args->{'linkitems'}{'edittoplevel'}{'cmd'}.'">'.
                              &mt('Content Editor').'</a></div>';
             }              }
         }          }
         if ($args->{'sort_html'}) {          if ($args->{'sort_html'}) {
             $result .= '<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.              $result .= '<div class="LC_navtools">&nbsp;&nbsp;&nbsp;'.
                        '<td align="right">'.$args->{'sort_html'}.'</td>';                         $args->{'sort_html'}.'</div>';
         }          }
     }      }
     if ($result) {      if ($result) {
         $result = "<table><tr>$result</tr></table>";          $result = '<div class="LC_navtools">'.$result.'</div>'."\n".
                     '<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n";
     }      }
     return $result;      return $result;
 }  }
Line 3050  sub parmval_real { Line 3073  sub parmval_real {
 }  }
   
 sub recurseup_maps {  sub recurseup_maps {
     my ($self,$mapname,$getsymb) = @_;      my ($self,$mapname,$getsymb,$inclusive) = @_;
     my @recurseup;      my @recurseup;
     if ($mapname) {      if ($mapname) {
         my $res = $self->getResourceByUrl($mapname);          my $res = $self->getResourceByUrl($mapname);
Line 3064  sub recurseup_maps { Line 3087  sub recurseup_maps {
                     @recurseup = map { &Apache::lonnet::declutter($self->getByMapPc($_)->src()); } reverse(@pcs);                      @recurseup = map { &Apache::lonnet::declutter($self->getByMapPc($_)->src()); } reverse(@pcs);
                 }                  }
             }              }
               if ($inclusive) {
                   if ($getsymb) {
                       unshift(@recurseup,$res->symb());
                   } else {
                       unshift(@recurseup,$mapname);
                   }
               }
         }          }
     }      }
     return @recurseup;      return @recurseup;

Removed from v.1.569  
changed lines
  Added in v.1.574


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