Diff for /loncom/interface/lonnavmaps.pm between versions 1.320 and 1.321

version 1.320, 2005/04/07 06:56:23 version 1.321, 2005/04/11 12:20:22
Line 1588  END Line 1588  END
     my @allres=$navmap->retrieveResources();      my @allres=$navmap->retrieveResources();
     foreach my $resource (@allres) {      foreach my $resource (@allres) {
  if ($resource->hasDiscussion()) {   if ($resource->hasDiscussion()) {
     my $ressymb;      my $ressymb = $resource->symb();
     if ($resource->symb() =~ m-(___adm/\w+/\w+)/(\d+)/bulletinboard$-) {                      if ($ressymb =~ m-___adm/\w+/\w+/\d+/bulletinboard$-) {
  $ressymb = 'bulletin___'.$2.$1.'/'.$2.'/bulletinboard';                          $ressymb = $resource->wrap_symb();
     } else {  
  $ressymb = $resource->symb();  
     }      }
     $haveDisc .= $ressymb.':';      $haveDisc .= $ressymb.':';
     $totdisc ++;      $totdisc ++;
Line 2281  sub getIterator { Line 2279  sub getIterator {
 sub hasDiscussion {  sub hasDiscussion {
     my $self = shift;      my $self = shift;
     my $symb = shift;      my $symb = shift;
       
     $self->generate_email_discuss_status();      $self->generate_email_discuss_status();
   
     if (!defined($self->{DISCUSSION_TIME})) { return 0; }      if (!defined($self->{DISCUSSION_TIME})) { return 0; }
Line 2290  sub hasDiscussion { Line 2287  sub hasDiscussion {
   
 # backward compatibility (bulletin boards used to be 'wrapped')  # backward compatibility (bulletin boards used to be 'wrapped')
     my $ressymb = $symb;      my $ressymb = $symb;
     if ($ressymb =~ m|adm/(\w+)/(\w+)/(\d+)/bulletinboard$|) {      if ($ressymb =~ m-___adm/\w+/\w+/\d+/bulletinboard$-) {
         unless ($ressymb =~ m|adm/wrapper/adm|) {          $ressymb = $self->wrap_symb($ressymb);
             $ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard';  
         }  
     }      }
   
     if ( defined ( $self->{LAST_READ}->{$ressymb} ) ) {      if ( defined ( $self->{LAST_READ}->{$ressymb} ) ) {
         return $self->{DISCUSSION_TIME}->{$ressymb} > $self->{LAST_READ}->{$ressymb};          return $self->{DISCUSSION_TIME}->{$ressymb} > $self->{LAST_READ}->{$ressymb};
     } else {      } else {
Line 2307  sub hasDiscussion { Line 2301  sub hasDiscussion {
 # Private method: Does the given resource (as a symb string) have  # Private method: Does the given resource (as a symb string) have
 # current feedback? Returns the string in the feedback hash, which  # current feedback? Returns the string in the feedback hash, which
 # will be false if it does not exist.  # will be false if it does not exist.
   
   sub wrap_symb {
       my $self=shift;
       my $symb = shift;
       my $ressymb = $symb;
       if ($ressymb =~ m-___(adm/\w+/\w+/)(\d+)(/bulletinboard)$-) {
           unless ($ressymb =~ m|adm/wrapper/adm|) {
               $ressymb = 'bulletin___'.$2.'___adm/wrapper/'.$1.$2.$3;
           }
       }
       return $ressymb;
   }
   
 sub getFeedback {   sub getFeedback { 
     my $self = shift;      my $self = shift;
     my $symb = shift;      my $symb = shift;
Line 3531  sub symb { Line 3538  sub symb {
         . '___' . $second . '___' . $symbSrc;          . '___' . $second . '___' . $symbSrc;
     return &Apache::lonnet::symbclean($symb);      return &Apache::lonnet::symbclean($symb);
 }  }
   sub wrap_symb {
       my $self = shift;
       return $self->{NAV_MAP}->wrap_symb($self->symb());
   }
 sub title {   sub title { 
     my $self=shift;       my $self=shift; 
     if ($self->{ID} eq '0.0') {      if ($self->{ID} eq '0.0') {

Removed from v.1.320  
changed lines
  Added in v.1.321


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