Diff for /loncom/interface/lonnavmaps.pm between versions 1.265 and 1.266

version 1.265, 2004/07/03 20:45:23 version 1.266, 2004/07/09 23:05:51
Line 971  sub render_resource { Line 971  sub render_resource {
         $nonLinkedText .= ' (' . $resource->countParts() . ' parts)';          $nonLinkedText .= ' (' . $resource->countParts() . ' parts)';
     }      }
   
     if (!$params->{'resource_nolink'} && !$resource->is_sequence()) {      if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) {
         $result .= "  $curMarkerBegin<a href='$link'>$title$partLabel</a>$curMarkerEnd $nonLinkedText</td>";          $result .= "  $curMarkerBegin<a href='$link'>$title$partLabel</a>$curMarkerEnd $nonLinkedText</td>";
     } else {      } else {
         $result .= "  $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText</td>";          $result .= "  $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText</td>";
Line 1369  sub render { Line 1369  sub render {
                 "&here=" . Apache::lonnet::escape($here) .                   "&here=" . Apache::lonnet::escape($here) . 
                 "\">".&mt('Open All Folders')."</a>";                  "\">".&mt('Open All Folders')."</a>";
         }          }
         $result .= "<br /><br />\n";          $result .= "\n";
     }          }
   
       # Check for any unread discussions in all resources.
       my $totdisc = 0;
       my $haveDisc = '';
       my @allres=$navmap->retrieveResources();
       foreach my $resource (@allres) {
           if ($resource->hasDiscussion()) {
               my $ressymb;
               if ($resource->symb() =~ m-(___adm/\w+/\w+)/(\d+)/bulletinboard$-) {
                   $ressymb = 'bulletin___'.$2.$1.'/'.$2.'/bulletinboard';
               } else {
                   $ressymb = $resource->symb();
               }
               $haveDisc .= $ressymb.':';
               $totdisc ++;
           }
       }
       if ($totdisc > 0) {
           $haveDisc =~ s/:$//;
           my %lt = &Apache::lonlocal::texthash(
              'mapr' => 'Mark all posts read',
              );
           $result .= (<<END);
   &nbsp;&nbsp;&nbsp;<a href="javascript:document.clearbubbles.submit()">$lt{'mapr'}</a>&nbsp;<a href="javascript:void(open('/adm/help/NavMaps_MarkPosts_Read.hlp', 'Help_for_NavMaps_MarkPosts', 'menubar=0,toolbar=1,scrollbars=1,width=350,height=400,resizable=yes'))" title="Online Help"><image src="/adm/help/gif/smallHelp.gif" border="0" alt="(Help: NavMaps_MarkPostsLink)" /></a>
   <form name="clearbubbles" method="post" action="/adm/feedback">
   <input type="hidden" name="navurl" value="$ENV{'QUERY_STRING'}" />
   <input type="hidden" name="navmaps" value="$haveDisc" />
   </form>
   END
       } else {
           $result .= '<br />';
       }
       $result .= "<br />\n";
     if ($r) {      if ($r) {
         $r->print($result);          $r->print($result);
         $r->rflush();          $r->rflush();
Line 1942  sub hasDiscussion { Line 1974  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|bulletin___\d+___adm/wrapper|) {          unless ($ressymb =~ m|adm/wrapper/adm|) {
             $ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard';              $ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard';
         }          }
     }      }
Line 1950  sub hasDiscussion { Line 1982  sub hasDiscussion {
     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 {
         return $self->{DISCUSSION_TIME}->{$ressymb} >  $self->{LAST_CHECK};  #        return $self->{DISCUSSION_TIME}->{$ressymb} >  $self->{LAST_CHECK}; # v.1.1 behavior 
           return $self->{DISCUSSION_TIME}->{$ressymb} >  0; # in 1.2 will display speech bubble icons for all items with posts until marked as read (even if read in v 1.1).
     }      }
 }  }
   
Line 3254  sub is_survey { Line 3287  sub is_survey {
     return 0;      return 0;
 }  }
   
   sub is_empty_sequence {
       my $self=shift;
       my $src = $self->src();
       return !$self->is_page() && $self->navHash("is_map_", 1) && !$self->navHash("map_type_" . $self->map_pc());
   }
   
 # Private method: Shells out to the parmval in the nav map, handler parts.  # Private method: Shells out to the parmval in the nav map, handler parts.
 sub parmval {  sub parmval {
     my $self = shift;      my $self = shift;

Removed from v.1.265  
changed lines
  Added in v.1.266


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