Diff for /loncom/interface/lonnavmaps.pm between versions 1.80 and 1.83

version 1.80, 2002/10/14 18:41:02 version 1.83, 2002/10/15 20:05:35
Line 1080  sub new_handle { Line 1080  sub new_handle {
                   # with only one part without loss                    # with only one part without loss
             }              }
   
               # Is it a multipart problem with a single part, now in 
               # @parts with "0" filtered out? If so, forget it's a multi-part
               # problem and treat it like a single-part problem.
               if ( scalar(@parts) == 1 ) {
                   $multipart = 0;
               }
   
             # Display one part, in event of network error.              # Display one part, in event of network error.
             # If this is a single part, we can at least show the correct              # If this is a single part, we can at least show the correct
             # status, but if it's multipart, we're lost.              # status, but if it's multipart, we're lost.
Line 1104  sub new_handle { Line 1111  sub new_handle {
                     'symb='.&Apache::lonnet::escape($curRes->symb()).                      'symb='.&Apache::lonnet::escape($curRes->symb()).
                     '"';                      '"';
                 my $title = $curRes->title();                  my $title = $curRes->title();
                   if (!$title) {
                       $title = $curRes->src();
                       $title = substr ($title, rindex($title, "/") + 1);
                   }
                 my $partLabel = "";                  my $partLabel = "";
                 my $newBranchText = "";                  my $newBranchText = "";
   
Line 1131  sub new_handle { Line 1142  sub new_handle {
                 # Display the correct icon, link to open or shut map                  # Display the correct icon, link to open or shut map
                 if ($curRes->is_map()) {                   if ($curRes->is_map()) { 
                     my $mapId = $curRes->map_pc();                      my $mapId = $curRes->map_pc();
                     my $nowOpen = !defined($filterHash{$mapId});                      my $nowOpen = (!defined($filterHash{$mapId}));
                       if ($condition) {$nowOpen = !$nowOpen;}
                     $icon = $nowOpen ?                      $icon = $nowOpen ?
                         "navmap.folder.closed.gif" : "navmap.folder.open.gif";                          "navmap.folder.closed.gif" : "navmap.folder.open.gif";
                     $icon = "<img src=\"/adm/lonIcons/$icon\" alt=\"\" border=\"0\" />";                      $icon = "<img src=\"/adm/lonIcons/$icon\" alt=\"\" border=\"0\" />";
Line 2577  sub extractParts { Line 2589  sub extractParts {
   
     $self->{PARTS} = [];      $self->{PARTS} = [];
   
     # Retrieve part count      # Retrieve part count, if this is a problem
     my $metadata = &Apache::lonnet::metadata($self->src(), 'allpossiblekeys');      if ($self->is_problem()) {
     if (!$metadata) {          my $metadata = &Apache::lonnet::metadata($self->src(), 'allpossiblekeys');
         $self->{RESOURCE_ERROR} = 1;          if (!$metadata) {
         $self->{PARTS} = [];              $self->{RESOURCE_ERROR} = 1;
         return;              $self->{PARTS} = [];
     }              return;
           }
     foreach (split(/\,/,$metadata)) {          
         if ($_ =~ /^parameter\_(.*)\_opendate$/) {          foreach (split(/\,/,$metadata)) {
             push @{$self->{PARTS}}, $1;              if ($_ =~ /^parameter\_(.*)\_opendate$/) {
                   push @{$self->{PARTS}}, $1;
               }
         }          }
           
           
           # Is this possible to do in one line? - Jeremy
           my @sortedParts = sort @{$self->{PARTS}};
           $self->{PARTS} = \@sortedParts;
     }      }
   
       
     # Is this possible to do in one line? - Jeremy  
     my @sortedParts = sort @{$self->{PARTS}};  
     $self->{PARTS} = \@sortedParts;  
   
     return;      return;
 }  }
   

Removed from v.1.80  
changed lines
  Added in v.1.83


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