Diff for /loncom/interface/lonindexer.pm between versions 1.27 and 1.30

version 1.27, 2001/12/11 03:50:09 version 1.30, 2001/12/13 13:59:22
Line 40 Line 40
 # 8/14 H. K. Ng  # 8/14 H. K. Ng
 # 8/28,10/15,11/28,11/29 Scott Harrison  # 8/28,10/15,11/28,11/29 Scott Harrison
 # 11/30 Matthew Hall  # 11/30 Matthew Hall
   # 12/11,12/13 Scott Harrison
 #  #
 ###  ###
   
Line 61  package Apache::lonindexer; Line 62  package Apache::lonindexer;
 # ------------------------------------------------- modules used by this module  # ------------------------------------------------- modules used by this module
 use strict;  use strict;
 use Apache::lonnet();  use Apache::lonnet();
   use Apache::loncommon();
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::File;  use Apache::File;
 use GDBM_File;  use GDBM_File;
Line 78  my $dnum; # directory counter Line 80  my $dnum; # directory counter
   
 # ---------------------------------------------------------------------- BEGIN  # ---------------------------------------------------------------------- BEGIN
 sub BEGIN {  sub BEGIN {
     my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.  
      '/language.tab');  
     while(<$fh>) {  
  $_=~/(\w+)\s+([\w\s\-]+)/;  
  $language{$1}=$2;  
     }  
 }  }
   
 # ----------------------------- Handling routine called via Apache and mod_perl  # ----------------------------- Handling routine called via Apache and mod_perl
Line 489  sub match_ext { Line 485  sub match_ext {
  my $fext = pop(@filecom);   my $fext = pop(@filecom);
  my $fnptr = $unpackline[3]&$dirptr;   my $fnptr = $unpackline[3]&$dirptr;
   if ($fnptr == 0 and $unpackline[3] ne "") {    if ($fnptr == 0 and $unpackline[3] ne "") {
     my $embstyle = &Apache::lonnet::fileembstyle($fext);      my $embstyle = &Apache::loncommon::fileembstyle($fext);
             push @trimlist,$line if (defined($embstyle) &&               push @trimlist,$line if (defined($embstyle) && 
      $embstyle ne 'hdn' );       $embstyle ne 'hdn' );
  } else {   } else {
Line 594  sub display_line { Line 590  sub display_line {
  my $curfext = $file_ext[-1];   my $curfext = $file_ext[-1];
  # Set the icon for the file   # Set the icon for the file
  my $iconname = "unknown.gif";   my $iconname = "unknown.gif";
  my $embstyle = &Apache::lonnet::fileembstyle($curfext);   my $embstyle = &Apache::loncommon::fileembstyle($curfext);
  # The unless conditional that follows is a bit of overkill   # The unless conditional that follows is a bit of overkill
  $iconname = $curfext.".gif" unless   $iconname = $curfext.".gif" unless
     (!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn');      (!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn');
Line 689  sub display_line { Line 685  sub display_line {
  if ($hash{'display_attrs_5'} == 1) {   if ($hash{'display_attrs_5'} == 1) {
     my $lang = &Apache::lonnet::metadata($filelink,'language')      my $lang = &Apache::lonnet::metadata($filelink,'language')
  if ($metafile == 1);   if ($metafile == 1);
     $lang = $language{$lang};      $lang = &Apache::loncommon::languagedescription($lang);
     $lang = '&nbsp;' if (!$lang);      $lang = '&nbsp;' if (!$lang);
     $r->print("<td bgcolor=$fileclr valign=bottom> ".$lang.      $r->print("<td bgcolor=$fileclr valign=bottom> ".$lang.
       " </td>\n");        " </td>\n");

Removed from v.1.27  
changed lines
  Added in v.1.30


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