Diff for /loncom/interface/lonnavmaps.pm between versions 1.425 and 1.426

version 1.425, 2009/02/14 14:39:31 version 1.426, 2009/02/24 20:10:30
Line 865  sub render_resource { Line 865  sub render_resource {
     my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");      my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
     # If this is a new branch, label it so      # If this is a new branch, label it so
     if ($params->{'isNewBranch'}) {      if ($params->{'isNewBranch'}) {
         $newBranchText = "<img src='$location/branch.gif' border='0' alt='Branch' />";          $newBranchText = "<img src='$location/branch.gif' alt='Branch' />";
     }      }
   
     # links to open and close the folder      # links to open and close the folder
   
           my $whitespaceLocation = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21_21.gif");
     my $linkopen = "<a href=\"$link\">";      my $linkopen = "<img src='$whitespaceLocation' alt='' />"."<a href=\"$link\">";
   
   
     my $linkclose = "</a>";      my $linkclose = "</a>";
   
     # Default icon: unknown page      # Default icon: unknown page
     my $icon = "<img src='$location/unknown.gif' alt='' border='0' alt='&nbsp;&nbsp;' ' />";      my $icon = "<img class=\"LC_contentImage\" src='$location/unknown.gif' alt='' />";
           
     if ($resource->is_problem()) {      if ($resource->is_problem()) {
         if ($part eq '0' || $params->{'condensed'}) {          if ($part eq '0' || $params->{'condensed'}) {
     $icon = '<img src="'.$location.'/';      $icon = '<img class="LC_contentImage" src="'.$location.'/';
     if ($resource->is_task()) {      if ($resource->is_task()) {
  $icon .= 'task.gif" alt="'.&mt('Task');   $icon .= 'task.gif" alt="'.&mt('Task');
     } else {      } else {
  $icon .= 'problem.gif" alt="'.&mt('Problem');   $icon .= 'problem.gif" alt="'.&mt('Problem');
     }      }
     $icon .='" border="0" />';      $icon .='" />';
         } else {          } else {
             $icon = $params->{'indentString'};              $icon = $params->{'indentString'};
         }          }
     } else {      } else {
  $icon = "<img src='".&Apache::loncommon::icon($resource->src)."' alt='&nbsp;&nbsp;' border='0' />";   $icon = "<img class=\"LC_contentImage\" src='".&Apache::loncommon::icon($resource->src)."' alt='' />";
     }      }
   
     # Display the correct map icon to open or shut map      # Display the correct map icon to open or shut map
Line 902  sub render_resource { Line 900  sub render_resource {
         if ($it->{CONDITION}) {          if ($it->{CONDITION}) {
             $nowOpen = !$nowOpen;              $nowOpen = !$nowOpen;
         }          }
   
  my $folderType = $resource->is_sequence() ? 'folder' : 'page';   my $folderType = $resource->is_sequence() ? 'folder' : 'page';
         my $title=$resource->title;          my $title=$resource->title;
         $title=~s/\"/\&quot;/g;   $title=~s/\"/\&qout;/g;
         if (!$params->{'resource_no_folder_link'}) {          if (!$params->{'resource_no_folder_link'}) {
             $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';              $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
     $icon = "<img src='$location/$icon' alt=\"".              $icon = "<img src='$location/arrow." . ($nowOpen ? 'closed' : 'open') . ".gif' alt='' />"
  ($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" border='0' />";                      ."<img class=\"LC_contentImage\" src='$location/$icon' alt=\""
                       .($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" />";
             $linkopen = "<a href=\"" . $params->{'url'} . '?' .               $linkopen = "<a href=\"" . $params->{'url'} . '?' . 
                 $params->{'queryString'} . '&amp;filter=';                  $params->{'queryString'} . '&amp;filter=';
             $linkopen .= ($nowOpen xor $it->{CONDITION}) ?              $linkopen .= ($nowOpen xor $it->{CONDITION}) ?
Line 925  sub render_resource { Line 923  sub render_resource {
   
         } else {          } else {
             # Don't allow users to manipulate folder              # Don't allow users to manipulate folder
             $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') .              $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
                 '.nomanip.gif';              $icon = "<img class=\"LC_space\" src='$whitespaceLocation' alt='' />"."<img class=\"LC_contentImage\" src='$location/$icon' alt=\"".($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" />";
             $icon = "<img src='$location/$icon' alt=\"".  
  ($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" border='0' />";  
   
             $linkopen = "";              $linkopen = "";
             $linkclose = "";              $linkclose = "";
Line 944  sub render_resource { Line 940  sub render_resource {
     if (($resource->is_practice()) && ($resource->is_raw_problem())) {      if (($resource->is_practice()) && ($resource->is_raw_problem())) {
         $nonLinkedText .=' <font color="green"><b>'.&mt('not graded').'</b></font>';          $nonLinkedText .=' <font color="green"><b>'.&mt('not graded').'</b></font>';
     }      }
    
     # We're done preparing and finally ready to start the rendering  
     my $result = "<td align='left' valign='middle'>";  
   
       # We're done preparing and finally ready to start the rendering
       my $result = '<td class="LC_middle">';
       my $newfolderType = $resource->is_sequence() ? 'folder' : 'page';
   
     my $indentLevel = $params->{'indentLevel'};      my $indentLevel = $params->{'indentLevel'};
     if ($newBranchText) { $indentLevel--; }      if ($newBranchText) { $indentLevel--; }
   
Line 957  sub render_resource { Line 954  sub render_resource {
     }      }
   
     # Decide what to display      # Decide what to display
   
     $result .= "$newBranchText$linkopen$icon$linkclose";      $result .= "$newBranchText$linkopen$icon$linkclose";
           
     my $curMarkerBegin = '';      my $curMarkerBegin = '';
Line 988  sub render_resource { Line 984  sub render_resource {
  $target=' target="loncapaclient" ';   $target=' target="loncapaclient" ';
     }      }
     if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) {      if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) {
         $result .= "  $curMarkerBegin<a $target href=\"$link\">$title$partLabel</a>$curMarkerEnd $nonLinkedText</td>";          $result .= "$curMarkerBegin<a $target href=\"$link\">$title$partLabel</a>$curMarkerEnd$nonLinkedText</td>";
     } else {      } else {
         $result .= "  $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText</td>";          $result .= "$curMarkerBegin$linkopen$title$partLabel</a>$curMarkerEnd$nonLinkedText</td>";
     }      }
   
     return $result;      return $result;
Line 1010  sub render_communication_status { Line 1006  sub render_communication_status {
     my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");      my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
     if ($resource->hasDiscussion()) {      if ($resource->hasDiscussion()) {
         $discussionHTML = $linkopen .          $discussionHTML = $linkopen .
             '<img alt="'.&mt('New Discussion').'" border="0" src="'.$location.'/chat.gif" />' .              '<img alt="'.&mt('New Discussion').'" src="'.$location.'/chat.gif" />' .
             $linkclose;              $linkclose;
     }      }
           
Line 1020  sub render_communication_status { Line 1016  sub render_communication_status {
             if ($msgid) {              if ($msgid) {
                 $feedbackHTML .= '&nbsp;<a '.$target.' href="/adm/email?display='                  $feedbackHTML .= '&nbsp;<a '.$target.' href="/adm/email?display='
                     . &escape($msgid) . '">'                      . &escape($msgid) . '">'
                     . '<img alt="'.&mt('New E-mail').'" src="'.$location.'/feedback.gif" '                      . '<img alt="'.&mt('New E-mail').'" src="'.$location.'/feedback.gif" /></a>';
                     . 'border="0" /></a>';  
             }              }
         }          }
     }      }
Line 1035  sub render_communication_status { Line 1030  sub render_communication_status {
                 $errorcount++;                  $errorcount++;
                 $errorHTML .= '&nbsp;<a '.$target.' href="/adm/email?display='                  $errorHTML .= '&nbsp;<a '.$target.' href="/adm/email?display='
                     . &escape($msgid) . '">'                      . &escape($msgid) . '">'
                     . '<img alt="'.&mt('New Error').'" src="'.$location.'/bomb.gif" '                      . '<img alt="'.&mt('New Error').'" src="'.$location.'/bomb.gif" /></a>';
                     . 'border="0" /></a>';  
             }              }
         }          }
     }      }
Line 1044  sub render_communication_status { Line 1038  sub render_communication_status {
     if ($params->{'multipart'} && $part != '0') {      if ($params->{'multipart'} && $part != '0') {
  $discussionHTML = $feedbackHTML = $errorHTML = '';   $discussionHTML = $feedbackHTML = $errorHTML = '';
     }      }
       return "<td class=\"LC_middle\">$discussionHTML$feedbackHTML$errorHTML&nbsp;</td>";
     return "<td width=\"75\" align=\"left\" valign=\"middle\">$discussionHTML$feedbackHTML$errorHTML&nbsp;</td>";  
   
 }  }
 sub render_quick_status {  sub render_quick_status {
Line 1061  sub render_quick_status { Line 1054  sub render_quick_status {
     }      }
     my $linkopen = "<a $target href=\"$link\">";      my $linkopen = "<a $target href=\"$link\">";
     my $linkclose = "</a>";      my $linkclose = "</a>";
   
    $result .= '<td class="LC_middle">';
     if ($resource->is_problem() &&      if ($resource->is_problem() &&
         !$firstDisplayed) {          !$firstDisplayed) {
   
         my $icon = $statusIconMap{$resource->simpleStatus($part)};          my $icon = $statusIconMap{$resource->simpleStatus($part)};
         my $alt = $iconAltTags{$icon};          my $alt = $iconAltTags{$icon};
         if ($icon) {          if ($icon) {
     my $location=      my $location=
  &Apache::loncommon::lonhttpdurl("/adm/lonIcons/$icon");   &Apache::loncommon::lonhttpdurl("/adm/lonIcons/$icon");
             $result .= "<td valign='middle' width='50' align='right'>$linkopen<img width='25' height='25' src='$location' border='0' alt='$alt' />$linkclose</td>\n";              $result .= "$linkopen<img src='$location' alt='$alt' />$linkclose";
         } else {          } else {
             $result .= "<td width='30'>&nbsp;</td>\n";              $result .= "&nbsp;";
         }          }
     } else { # not problem, no icon      } else { # not problem, no icon
         $result .= "<td width='30'>&nbsp;</td>\n";          $result .= "&nbsp;";
     }      }
    $result .= "</td>\n";
     return $result;      return $result;
 }  }
 sub render_long_status {  sub render_long_status {
     my ($resource, $part, $params) = @_;      my ($resource, $part, $params) = @_;
     my $result = "<td align='right' valign='middle'>\n";      my $result = '<td class="LC_middle LC_right">';
     my $firstDisplayed = !$params->{'condensed'} &&       my $firstDisplayed = !$params->{'condensed'} && 
         $params->{'multipart'} && $part eq "0";          $params->{'multipart'} && $part eq "0";
                                   
Line 1497  END Line 1490  END
     $result .= "<br />\n";      $result .= "<br />\n";
   
     # Data      # Data
     $result .= '<table cellspacing="0" cellpadding="3" border="0" bgcolor="#FFFFFF">' ."\n";      $result .= '<table id="LC_tableOfContent">' ."\n";
   
     my $res = "Apache::lonnavmaps::resource";      my $res = "Apache::lonnavmaps::resource";
     my %condenseStatuses =      my %condenseStatuses =
         ( $res->NETWORK_FAILURE    => 1,          ( $res->NETWORK_FAILURE    => 1,
           $res->NOTHING_SET        => 1,            $res->NOTHING_SET        => 1,
           $res->CORRECT            => 1 );            $res->CORRECT            => 1 );
     my @backgroundColors = ("#FFFFFF", "#F6F6F6");      my @backgroundColors = ("LC_trEven", "LC_trOdd");
   
     # Shared variables      # Shared variables
     $args->{'counter'} = 0; # counts the rows      $args->{'counter'} = 0; # counts the rows
     $args->{'indentLevel'} = 0;      $args->{'indentLevel'} = 0;
     $args->{'isNewBranch'} = 0;      $args->{'isNewBranch'} = 0;
     $args->{'condensed'} = 0;          $args->{'condensed'} = 0;   
     my $location=  
  &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace1.gif");      my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21_21.gif");
     $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' width='25' height='1' alt='&nbsp;&nbsp;' border='0' />");      $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' alt='' />");
     $args->{'displayedHereMarker'} = 0;      $args->{'displayedHereMarker'} = 0;
   
     # If we're suppressing empty sequences, look for them here. Use DFS for speed,      # If we're suppressing empty sequences, look for them here. Use DFS for speed,
Line 1740  END Line 1734  END
             $rownum ++;              $rownum ++;
             my $backgroundColor = $backgroundColors[$rownum % scalar(@backgroundColors)];              my $backgroundColor = $backgroundColors[$rownum % scalar(@backgroundColors)];
                           
             $result .= "  <tr bgcolor='$backgroundColor'>\n";              $result .= "  <tr class='$backgroundColor'>\n";
   
             # Set up some data about the parts that the cols might want              # Set up some data about the parts that the cols might want
             my $filter = $it->{FILTER};              my $filter = $it->{FILTER};
Line 3746  sub map_contains_problem { Line 3740  sub map_contains_problem {
 sub is_sequence {  sub is_sequence {
     my $self=shift;      my $self=shift;
     return $self->navHash("is_map_", 1) &&       return $self->navHash("is_map_", 1) && 
  $self->navHash("map_type_" . $self->map_pc()) eq 'sequence';      $self->navHash("map_type_" . $self->map_pc()) eq 'sequence';
 }  }
 sub is_survey {  sub is_survey {
     my $self = shift();      my $self = shift();

Removed from v.1.425  
changed lines
  Added in v.1.426


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