--- loncom/interface/lonnavmaps.pm 2025/01/03 05:38:17 1.567 +++ loncom/interface/lonnavmaps.pm 2025/02/03 19:07:54 1.571 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.567 2025/01/03 05:38:17 raeburn Exp $ +# $Id: lonnavmaps.pm,v 1.571 2025/02/03 19:07:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -48,7 +48,8 @@ described at http://www.lon-capa.org. =head1 OVERVIEW -X When a user enters a course, LON-CAPA examines the +X +When a user enters a course, LON-CAPA examines the course structure and caches it in what is often referred to as the "big hash" X. You can see it if you are logged into LON-CAPA, in a course, by going to /adm/test. The content of @@ -1120,7 +1121,7 @@ sub render_resource { } # Decide what to display - $result .= "$newBranchText$linkopen$icon$linkclose"; + $result .= "$newBranchText$linkopen$icon"; my $curMarkerBegin = ''; my $curMarkerEnd = ''; @@ -1160,7 +1161,7 @@ sub render_resource { $linkopen = ""; } } - $result .= "$curMarkerBegin$linkopen$title$partLabel$linkclose$curMarkerEnd$editmapLink$nonLinkedText"; + $result .= "$curMarkerBegin$title$partLabel$curMarkerEnd$linkclose$editmapLink$nonLinkedText"; return $result; } @@ -1572,10 +1573,15 @@ sub render { my $curRes; my $foundJump = 0; my $counter = 0; - + while (($curRes = $mapIterator->next()) && !$foundJump) { 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()) { # This is why we have to use the main iterator instead of the @@ -1594,27 +1600,19 @@ sub render { my $printKey = $args->{'printKey'}; my $printCloseAll = $args->{'printCloseAll'}; if (!defined($printCloseAll)) { $printCloseAll = 1; } - + # Print key? if ($printKey) { - $result .= ''; - $result.=''; - my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc"); - if ($navmap->{LAST_CHECK}) { - $result .= - ' '.&mt('New discussion since').' '. - strftime("%A, %b %e at %I:%M %P", localtime($navmap->{LAST_CHECK})). - ''; - } else { - $result .= ''; - } - - $result .= '
Key:    '. - ' '.&mt('New message (click to open)').'

'. - '

  '. - ' '.&mt('Discussions').''. - '   '.&mt('New message (click to open)'). - '
'; + my $location = &Apache::loncommon::lonhttpdurl("/adm/lonMisc"); + $result .= '
'."\n". + ''.&mt('Key').':'. + '  '. + ' '.&mt('Unread Discussion'). + '  '. + ' '. + &mt('New message (click to open)'). + '
'. + '
'."\n"; } if ($printCloseAll && !$args->{'resource_no_folder_link'}) { @@ -1711,7 +1709,9 @@ END $result .= "
\n"; # Data - $result.=&Apache::loncommon::start_data_table("LC_tableOfContent"); + if ($counter) { + $result.=&Apache::loncommon::start_data_table("LC_tableOfContent"); + } my $res = "Apache::lonnavmaps::resource"; my %condenseStatuses = @@ -2109,7 +2109,9 @@ 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 # delay needed because the browser is processing the jump before @@ -2148,14 +2150,12 @@ sub show_linkitems_toolbar { if (ref($args->{'linkitems'}) eq 'HASH') { my $numlinks = scalar(keys(%{$args->{'linkitems'}})); if ($numlinks > 1) { - $result = ''. + $result = '
'. &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen', undef,'RAT'). - ''. - ' '. - ''.&mt('Tools:').''; + '
 '.&mt('Tools:').'
'; } - $result .= ''."\n". + $result .= '
'."\n". '
    '; my @linkorder = ('firsthomework','everything','uncompleted', 'changefolder','clearbubbles','printout','edittoplevel'); @@ -2183,19 +2183,21 @@ sub show_linkitems_toolbar { } } $result .= '
'. - ''; + '
'; if (($numlinks==1) && (exists($args->{'linkitems'}{'edittoplevel'}))) { - $result .= '
'. - &mt('Content Editor').''; + $result .= ''; } } if ($args->{'sort_html'}) { - $result .= '   '. - ''.$args->{'sort_html'}.''; + $result .= '
   '. + $args->{'sort_html'}.'
'; } } if ($result) { - $result = "$result
"; + $result = '
'.$result.'
'."\n". + '
'."\n"; } return $result; }