Diff for /loncom/interface/lonnavmaps.pm between versions 1.571 and 1.575

version 1.571, 2025/02/03 19:07:54 version 1.575, 2025/05/27 23:31:49
Line 1380  sub cmp_title { Line 1380  sub cmp_title {
 sub render {  sub render {
     my $args = shift;      my $args = shift;
     &Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING});      &Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING});
     my $result = '';  
     # Configure the renderer.      # Configure the renderer.
     my $cols = $args->{'cols'};      my $cols = $args->{'cols'};
     if (!defined($cols)) {      if (!defined($cols)) {
         # no columns, no nav maps.          # no columns, no nav maps.
         return '';          return '';
     }      }
       my $legend = '';
       my $tools = '';
       my $result = '';
       my $tools_printed = 0;
       my $tablestarted = 0;
     my $navmap;      my $navmap;
     if (defined($args->{'navmap'})) {      if (defined($args->{'navmap'})) {
         $navmap = $args->{'navmap'};          $navmap = $args->{'navmap'};
Line 1604  sub render { Line 1608  sub render {
     # Print key?      # Print key?
     if ($printKey) {      if ($printKey) {
         my $location = &Apache::loncommon::lonhttpdurl("/adm/lonMisc");          my $location = &Apache::loncommon::lonhttpdurl("/adm/lonMisc");
         $result .= '<div class="LC_navtools">'."\n".          $legend = '<div class="LC_navtools">'."\n".
                    '<span class="LC_middle LC_right">'.&mt('Key').':</span>'.                    '<span class="LC_middle LC_right">'.&mt('Key').':</span>'.
                    '<span class="LC_middle LC_center">&nbsp;&nbsp;'.                    '<span class="LC_middle LC_center">&nbsp;&nbsp;'.
                    '<img src="'.$location.'/chat.gif" alt="" /> '.&mt('Unread Discussion').                    '<img src="'.$location.'/chat.gif" alt="" /> '.&mt('Unread Discussion').
                    '&nbsp;&nbsp;'.                    '&nbsp;&nbsp;'.
                    '<img src="'.$location.'/feedback.gif" alt="" /> '.                    '<img src="'.$location.'/feedback.gif" alt="" /> '.
                    &mt('New message (click to open)').                    &mt('New message (click to open)').
                    '</span></div>'.                    '</span></div>'.
                    '<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n";                    '<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n";
     }      }
   
     if ($printCloseAll && !$args->{'resource_no_folder_link'}) {      if ($printCloseAll && !$args->{'resource_no_folder_link'}) {
Line 1632  sub render { Line 1636  sub render {
                               "location.href='$link'",$text);                                "location.href='$link'",$text);
             }              }
  } else {   } else {
     $result.= '<a href="'.$link.'">'.&mt($text).'</a>';      $tools = '<a href="'.$link.'">'.&mt($text).'</a>';
  }   }
         $result .= "\n";          $tools .= "\n";
     }      }
   
     # Check for any unread discussions in all resources.      # Check for any unread discussions in all resources.
Line 1646  sub render { Line 1650  sub render {
  my $time=time;   my $time=time;
         my $submit = &mt($markread);          my $submit = &mt($markread);
         my $querystr = &HTML::Entities::encode($ENV{'QUERY_STRING'},'<>&"');          my $querystr = &HTML::Entities::encode($ENV{'QUERY_STRING'},'<>&"');
  $result .= (<<END);   $tools .= (<<END);
     <form name="clearbubbles" method="post" action="/adm/feedback" aria-hidden="true">      <form name="clearbubbles" method="post" action="/adm/feedback" aria-hidden="true">
  <input type="hidden" name="navurl" value="$querystr" />   <input type="hidden" name="navurl" value="$querystr" />
  <input type="hidden" name="navtime" value="$time" />   <input type="hidden" name="navtime" value="$time" />
Line 1663  END Line 1667  END
     }      }
     if ($totdisc > 0) {      if ($totdisc > 0) {
  $haveDisc =~ s/:$//;   $haveDisc =~ s/:$//;
  $result .= (<<END);   $tools .= (<<END);
  <input type="hidden" name="navmaps" value="$haveDisc" />   <input type="hidden" name="navmaps" value="$haveDisc" />
 END  END
             }              }
  }   }
  $result .= <<END;   $tools .= <<END;
         <input type="submit" value="$submit" class="LC_visually_hidden" tabindex="-1" disabled="disabled" />          <input type="submit" value="$submit" class="LC_visually_hidden" tabindex="-1" disabled="disabled" />
     </form>      </form>
 END  END
Line 1693  END Line 1697  END
     }      }
   
     if ($args->{'caller'} eq 'navmapsdisplay') {      if ($args->{'caller'} eq 'navmapsdisplay') {
         $result .= &show_linkitems_toolbar($args,$condition);          $tools .= &show_linkitems_toolbar($args,$condition);
     } elsif ($args->{'sort_html'}) {       } elsif ($args->{'sort_html'}) { 
         $result.=$args->{'sort_html'};           $tools .= $args->{'sort_html'}; 
     }      }
   
     #$result .= "<br />\n";      #$tools .= "<br />\n";
     if ($r) {  
         $r->print($result);  
         $r->rflush();  
         $result = "";  
     }  
     # End parameter setting      # End parameter setting
       
     $result .= "<br />\n";  
   
     # Data      # Data
     if ($counter) {  
         $result.=&Apache::loncommon::start_data_table("LC_tableOfContent");  
     }  
   
     my $res = "Apache::lonnavmaps::resource";      my $res = "Apache::lonnavmaps::resource";
     my %condenseStatuses =      my %condenseStatuses =
Line 1723  END Line 1717  END
     $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;
       $args->{'deeplinknolist'} = 0;
   
     my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif");      my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif");
     $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' alt='' />");      $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' alt='' />");
Line 1898  END Line 1893  END
   
         # If this has been filtered out, continue on          # If this has been filtered out, continue on
         if (!(&$filterFunc($curRes))) {          if (!(&$filterFunc($curRes))) {
               if (!$userCanSeeHidden && !$curRes->randomout && $curRes->deeplinkout) {
                   $args->{'deeplinknolist'} ++;
               }
             $args->{'isNewBranch'} = 0; # Don't falsely remember this              $args->{'isNewBranch'} = 0; # Don't falsely remember this
             next;              next;
         }           } 
Line 1922  END Line 1920  END
                     if ($userCanSeeHidden) {                      if ($userCanSeeHidden) {
                         $args->{'mapHiddenDeepLink'} = 1;                          $args->{'mapHiddenDeepLink'} = 1;
                     } else {                      } else {
                           $args->{'deeplinknolist'} ++;
                         next;                          next;
                     }                      }
                 } else {                  } else {
Line 1931  END Line 1930  END
                         if ($userCanSeeHidden) {                          if ($userCanSeeHidden) {
                             $args->{'mapUnlisted'} = 1;                              $args->{'mapUnlisted'} = 1;
                         } else {                          } else {
                               $args->{'deeplinknolist'} ++;
                             next;                              next;
                         }                          }
                     }                      }
Line 1944  END Line 1944  END
         }          }
   
         $args->{'counter'}++;          $args->{'counter'}++;
           unless ($tablestarted) {
               $result.=&Apache::loncommon::start_data_table("LC_tableOfContent").
                        &Apache::loncommon::start_data_table_header_row('LC_visually_hidden').
                        '<th>'.&mt('Resource or Folder').'</th>'.
                        '<th>'.&mt('Alerts').'</th>'.
                        '<th>'.&mt('Status Icon').'</th>'.
                        '<th>'.&mt('Date/Completion Status').'</th>'.
                        &Apache::loncommon::end_data_table_row()."\n";
                        $tablestarted = 1;
           }
   
         # Does it have multiple parts?          # Does it have multiple parts?
         $args->{'multipart'} = 0;          $args->{'multipart'} = 0;
Line 2094  END Line 2104  END
         }          }
   
         if ($r && $rownum % 20 == 0) {          if ($r && $rownum % 20 == 0) {
               unless ($tools_printed) {
                   $r->print($legend.$tools);
                   $legend = "";
                   $tools = "";
                   $tools_printed = 1;
               }
             $r->print($result);              $r->print($result);
             $result = "";              $result = "";
             $r->rflush();              $r->rflush();
Line 2109  END Line 2125  END
  }   }
     }      }
   
     if ($counter) {      if ($tablestarted) {
         $result.=&Apache::loncommon::end_data_table();          $result .= &Apache::loncommon::end_data_table();
     }      }
           
     # Print out the part that jumps to #curloc if it exists      # Print out the part that jumps to #curloc if it exists
Line 2129  if (location.href.indexOf('#curloc')==-1 Line 2145  if (location.href.indexOf('#curloc')==-1
     }      }
   
     if ($r) {      if ($r) {
           unless ($tools_printed) {
               if (($args->{'counter'}) || ($userCanSeeHidden) ||
                   (($args->{'caller'} eq 'navmapsdisplay') &&
                    ($env{'form.showOnlyHomework'} ||
                     $ENV{QUERY_STRING} =~ /^jumpToFirstHomework/))) {
                   $r->print($legend.$tools);
               }
               $legend = "";
               $tools = "";
               $tools_printed = 1;
           }
         $r->print($result);          $r->print($result);
         $result = "";          $result = "";
         $r->rflush();          $r->rflush();
     }      }
                   
     return $result;      return $legend.$tools.$result;
 }  }
   
 sub add_linkitem {  sub add_linkitem {
Line 3061  sub parmval_real { Line 3088  sub parmval_real {
 }  }
   
 sub recurseup_maps {  sub recurseup_maps {
     my ($self,$mapname,$getsymb) = @_;      my ($self,$mapname,$getsymb,$inclusive) = @_;
     my @recurseup;      my @recurseup;
     if ($mapname) {      if ($mapname) {
         my $res = $self->getResourceByUrl($mapname);          my $res = $self->getResourceByUrl($mapname);
Line 3075  sub recurseup_maps { Line 3102  sub recurseup_maps {
                     @recurseup = map { &Apache::lonnet::declutter($self->getByMapPc($_)->src()); } reverse(@pcs);                      @recurseup = map { &Apache::lonnet::declutter($self->getByMapPc($_)->src()); } reverse(@pcs);
                 }                  }
             }              }
               if ($inclusive) {
                   if ($getsymb) {
                       unshift(@recurseup,$res->symb());
                   } else {
                       unshift(@recurseup,$mapname);
                   }
               }
         }          }
     }      }
     return @recurseup;      return @recurseup;

Removed from v.1.571  
changed lines
  Added in v.1.575


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