Diff for /loncom/interface/lonnavmaps.pm between versions 1.123 and 1.124

version 1.123, 2003/01/10 17:46:46 version 1.124, 2003/01/10 18:45:30
Line 96  sub real_handler { Line 96  sub real_handler {
                                           ''));                                            ''));
     $r->print('<script>window.focus();</script>');      $r->print('<script>window.focus();</script>');
   
       $r->rflush();
   
       # Now that we've displayed some stuff to the user, init the navmap
       $navmap->init();
   
     $r->print('<table border="0" cellpadding="2" cellspacing="0">');      $r->print('<table border="0" cellpadding="2" cellspacing="0">');
     my $date=localtime;      my $date=localtime;
     $r->print('<tr><td align="right" valign="bottom">Key:&nbsp;&nbsp;</td>');      $r->print('<tr><td align="right" valign="bottom">Key:&nbsp;&nbsp;</td>');
Line 178  sub real_handler { Line 183  sub real_handler {
     $r->print('<br>&nbsp;');      $r->print('<br>&nbsp;');
     $r->rflush();      $r->rflush();
   
     # Now that we've displayed some stuff to the user, init the navmap  
     $navmap->init();  
   
     # Check that it's defined      # Check that it's defined
     if (!($navmap->courseMapDefined())) {      if (!($navmap->courseMapDefined())) {
         $r->print('<font size="+2" color="red">Coursemap undefined.</font>' .          $r->print('<font size="+2" color="red">Coursemap undefined.</font>' .
Line 600  sub real_handler { Line 602  sub real_handler {
                 $r->print("</td>\n");                  $r->print("</td>\n");
   
                 # SECOND COL: Is there text, feedback, errors??                  # SECOND COL: Is there text, feedback, errors??
                 my $discussionHTML = ""; my $feedbackHTML = "";                  my $discussionHTML = ""; my $feedbackHTML = ""; my $errorHTML = "";
   
                 if ($curRes->hasDiscussion()) {                  if ($curRes->hasDiscussion()) {
                     $discussionHTML = $linkopen .                      $discussionHTML = $linkopen .
Line 620  sub real_handler { Line 622  sub real_handler {
                     }                      }
                 }                  }
   
                 $r->print("<td width=\"75\" align=\"left\" valign=\"center\">$discussionHTML$feedbackHTML&nbsp;</td>");                  if ($curRes->getErrors()) {
                       my $errors = $curRes->getErrors();
                       foreach (split(/,/, $errors)) {
                           if ($_) {
                               $errorHTML .= '&nbsp;<a href="/adm/email?display='
                                   . &Apache::lonnet::escape($_) . '">'
                                   . '<img src="/adm/lonMisc/bomb.gif" '
                                   . 'border="0" /></a>';
                           }
                       }
                   }
   
                   $r->print("<td width=\"75\" align=\"left\" valign=\"center\">$discussionHTML$feedbackHTML$errorHTML&nbsp;</td>");
   
                 # Is this the first displayed part of a multi-part problem                  # Is this the first displayed part of a multi-part problem
                 # that has not been condensed, so we should suppress these two                  # that has not been condensed, so we should suppress these two
Line 1060  sub init { Line 1074  sub init {
         my %emailstatus = &Apache::lonnet::dump('email_status');          my %emailstatus = &Apache::lonnet::dump('email_status');
         my $logoutTime = $emailstatus{'logout'};          my $logoutTime = $emailstatus{'logout'};
         my $courseLeaveTime = $emailstatus{'logout_'.$ENV{'request.course.id'}};          my $courseLeaveTime = $emailstatus{'logout_'.$ENV{'request.course.id'}};
         $self->{LAST_CHECK} = ($courseLeaveTime > $logoutTime ?          $self->{LAST_CHECK} = ($courseLeaveTime < $logoutTime ?
                                $courseLeaveTime : $logoutTime);                                 $courseLeaveTime : $logoutTime);
         my %discussiontime = &Apache::lonnet::dump('discussiontimes',           my %discussiontime = &Apache::lonnet::dump('discussiontimes', 
                                                    $cdom, $cnum);                                                     $cdom, $cnum);
Line 1141  sub DESTROY { Line 1155  sub DESTROY {
     $self->untieHashes();      $self->untieHashes();
 }  }
   
 # Private function: Does the given resource (as a symb string) have  # Does the given resource (as a symb string) have
 # current discussion? Returns 0 if chat/mail data not extracted.  # current discussion? Returns 0 if chat/mail data not extracted.
 sub hasDiscussion {  sub hasDiscussion {
     my $self = shift;      my $self = shift;
     my $symb = shift;      my $symb = shift;
     if (!defined($self->{DISCUSSION_TIME})) { return 0; }      if (!defined($self->{DISCUSSION_TIME})) { return 0; }
   
       #return defined($self->{DISCUSSION_TIME}->{$symb});
     return $self->{DISCUSSION_TIME}->{$symb} >      return $self->{DISCUSSION_TIME}->{$symb} >
            $self->{LAST_CHECK};             $self->{LAST_CHECK};
 }  }
   
 # Private function: Does the given resource (as a symb string) have  # 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 getFeedback {   sub getFeedback { 
Line 1164  sub getFeedback { Line 1179  sub getFeedback {
     return $self->{FEEDBACK}->{$symb};      return $self->{FEEDBACK}->{$symb};
 }  }
   
   sub getErrors { 
       my $self = shift;
       my $src = shift;
       
       if (!defined($self->{ERROR_MSG})) { return ""; }
       return $self->{ERROR_MSG}->{$src};
   }
   
 =pod  =pod
   
 =item * B<getById>(id): Based on the ID of the resource (1.1, 3.2, etc.), get a resource object for that resource. This method, or other methods that use it (as in the resource object) is the only proper way to obtain a resource object.  =item * B<getById>(id): Based on the ID of the resource (1.1, 3.2, etc.), get a resource object for that resource. This method, or other methods that use it (as in the resource object) is the only proper way to obtain a resource object.
Line 2229  sub hasDiscussion { Line 2252  sub hasDiscussion {
   
 sub getFeedback {  sub getFeedback {
     my $self = shift;      my $self = shift;
     return $self->{NAV_MAP}->getFeedback($self->src());      my $source = $self->src();
       if ($source !~ /^\/res\//) { $source = substr $source, 5; }
       return $self->{NAV_MAP}->getFeedback($source);
   }
   
   sub getErrors {
       my $self = shift;
       my $source = $self->src();
       if ($source =~ /^\/res\//) { $source = substr $source, 5; }
       return $self->{NAV_MAP}->getErrors($source);
 }  }
   
 =pod  =pod

Removed from v.1.123  
changed lines
  Added in v.1.124


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