Diff for /loncom/interface/lonnavmaps.pm between versions 1.73 and 1.74

version 1.73, 2002/10/11 18:39:55 version 1.74, 2002/10/11 21:29:18
Line 930  sub new_handle { Line 930  sub new_handle {
         $condition = 1;          $condition = 1;
     }      }
   
     my $mapIterator = $navmap->getIterator(undef, undef, \%filterHash, $condition);      # This needs to be updated to use symbs from the remote, 
       # instead of uris. The changes to this and the main rendering
       # loop should be obvious.
       # Here's a simple example of the iterator.
       # If there is a current resource
       if ($currenturl) {
           # Give me every resource...
           my $mapIterator = $navmap->getIterator(undef, undef, {}, 1);
           my $found != 0;
           my $depth = 1;
           $mapIterator->next(); # discard the first BEGIN_MAP
           my $curRes = $mapIterator->next();
           
           while ($depth > 0 && !$found) {
               if (ref($curRes) && $curRes->src() eq $currenturl) {
                   # If this is the correct resource, be sure to 
                   # show it by making sure the containing maps
                   # are open.
   
                   my $mapStack = $mapIterator->getStack();
                   for my $map (@{$mapStack}) {
                       if ($condition) {
                           undef $filterHash{$map->map_pc()};
                       } else {
                           $filterHash{$map->map_pc()} = 1;
                       }
                   }
                   $found = 1;
               }
               $curRes = $mapIterator->next();
           }
       }
   
     undef $res; # so we don't accidentally use it later      undef $res; # so we don't accidentally use it later
     my $indentLevel = 0;      my $indentLevel = 0;
     my $indentString = "<img src=\"/adm/lonIcons/whitespace1.gif\" width=\"25\" height=\"1\" alt=\"\" border=\"0\" />";      my $indentString = "<img src=\"/adm/lonIcons/whitespace1.gif\" width=\"25\" height=\"1\" alt=\"\" border=\"0\" />";
Line 942  sub new_handle { Line 974  sub new_handle {
   
     # We know the first thing is a BEGIN_MAP (see "$self->{STARTED}"      # We know the first thing is a BEGIN_MAP (see "$self->{STARTED}"
     # code in iterator->next), so ignore the first one      # code in iterator->next), so ignore the first one
       my $mapIterator = $navmap->getIterator(undef, undef, \%filterHash,
                                              $condition);
     $mapIterator->next();      $mapIterator->next();
     my $curRes = $mapIterator->next();      my $curRes = $mapIterator->next();
   
Line 1107  sub new_handle { Line 1141  sub new_handle {
                 if ($curRes->is_problem()) {                  if ($curRes->is_problem()) {
                     my $status = $curRes->status($part);                      my $status = $curRes->status($part);
                     my $color = $colormap{$status};                      my $color = $colormap{$status};
   
                       # Special case in the navmaps: If in less then
                       # 24 hours, give it a bit of urgency
                       if ($status == $curRes->OPEN() &&
                           $curRes->duedate() < time()+(24*60*60)) {
                           $color = $hurryUpColor;
                       }
                     if ($color ne "") {                      if ($color ne "") {
                         $colorizer = "bgcolor=\"$color\"";                          $colorizer = "bgcolor=\"$color\"";
                     }                      }
Line 1126  sub new_handle { Line 1167  sub new_handle {
   
                 $r->print("  ${newBranchText}${linkopen}$icon${linkclose}\n");                  $r->print("  ${newBranchText}${linkopen}$icon${linkclose}\n");
   
                   my $curMarkerBegin = "";
                   my $curMarkerEnd = "";
   
                   # Is this the current resource?
                   if ($curRes->src() eq $currenturl) {
                       $curMarkerBegin = '<a name="curloc" /><font color="red" size="+2">&gt; </font>';
                       $curMarkerEnd = '<font color="red" size="+2"> &lt;</font>';
                   }
   
                 if ($curRes->is_problem() && $part ne "0" && !$condensed) {                   if ($curRes->is_problem() && $part ne "0" && !$condensed) { 
                     $partLabel = " (Part $part)";                       $partLabel = " (Part $part)"; 
                     $title = "";                      $title = "";
Line 1134  sub new_handle { Line 1184  sub new_handle {
                     $nonLinkedText .= ' (' . $curRes->countParts() . ' parts)';                      $nonLinkedText .= ' (' . $curRes->countParts() . ' parts)';
                 }                  }
   
                 $r->print("  <a href=\"$link\">$title$partLabel</a> $nonLinkedText");                  $r->print("  $curMarkerBegin<a href=\"$link\">$title$partLabel</a> $curMarkerEnd $nonLinkedText");
   
                 if ($curRes->{RESOURCE_ERROR}) {                  if ($curRes->{RESOURCE_ERROR}) {
                     $r->print(&Apache::loncommon::help_open_topic ("Navmap_Host_Down",                      $r->print(&Apache::loncommon::help_open_topic ("Navmap_Host_Down",

Removed from v.1.73  
changed lines
  Added in v.1.74


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