Diff for /loncom/interface/lonindexer.pm between versions 1.80 and 1.86

version 1.80, 2003/11/08 10:33:27 version 1.86, 2004/01/05 15:02:43
Line 25 Line 25
 #  #
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
 # YEAR=1999  
 # 5/21/99, 5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14 Gerd Kortemeyer)  
 # 11/23 Gerd Kortemeyer  
 # YEAR=2000  
 # 07/20-08/04 H.K. Ng  
 # YEAR=2001  
 # 05/9-05/19/2001 H. K. Ng  
 # 05/21/2001 H. K. Ng  
 # 05/23/2001 H. K. Ng  
 # 6/26,7/8 H. K. Ng  
 # 8/14 H. K. Ng  
 # 11/30 Matthew Hall  
 # YEAR=2002  
 # 6/29/2002 H. K. Ng  
 #  
 ###  ###
   
 ###############################################################################  ###############################################################################
Line 61  package Apache::lonindexer; Line 46  package Apache::lonindexer;
 use strict;  use strict;
 use Apache::lonnet();  use Apache::lonnet();
 use Apache::loncommon();  use Apache::loncommon();
   use Apache::lonhtmlcommon();
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::lonmeta;  use Apache::lonmeta;
 use Apache::File;  use Apache::File;
Line 432  $r->print(&Apache::loncommon::bodytag('B Line 418  $r->print(&Apache::loncommon::bodytag('B
    'av' => 'All versions',     'av' => 'All versions',
    'ud' => 'Update Display'     'ud' => 'Update Display'
    );     );
           my $Displayfileattributes=&mt('Display file attributes');
  $r->print(<<END);   $r->print(<<END);
 <form method="post" name="fileattr" action="$uri"  <form method="post" name="fileattr" action="$uri"
  enctype="application/x-www-form-urlencoded">   enctype="application/x-www-form-urlencoded">
 <b><font color="#666666">Display file attributes</font></b><br />  <b><font color="#666666">$Displayfileattributes</font></b><br />
 <table border=0><tr>  <table border=0><tr>
 <td><input type="checkbox" name="attr0" value="1" $attrchk[0] /> $lt{'ti'}</td>  <td><input type="checkbox" name="attr0" value="1" $attrchk[0] /> $lt{'ti'}</td>
 <td><input type="checkbox" name="attr1" value="1" $attrchk[1] /> $lt{'si'}</td>  <td><input type="checkbox" name="attr1" value="1" $attrchk[1] /> $lt{'si'}</td>
Line 457  $closebutton Line 444  $closebutton
 $groupimportbutton  $groupimportbutton
 </form>  </form>
 END  END
   # ---------------------------------------------------------------- Bread crumbs
           $r->print(&Apache::lonhtmlcommon::crumbs($uri));
   # ------------------------------------------------------ Remember where we were
    &Apache::loncommon::storeresurl($uri);
 # ----------------- output starting row to the indexed file/directory hierarchy  # ----------------- output starting row to the indexed file/directory hierarchy
         my $titleclr="#ddffff";          my $titleclr="#ddffff";
 #        $r->print(&initdebug());  #        $r->print(&initdebug());
Line 805  sub display_line { Line 795  sub display_line {
             return OK if ($skip > 0);              return OK if ($skip > 0);
         }          }
  # Set the icon for the file   # Set the icon for the file
  my $iconname = "unknown.gif";   my $iconname = &Apache::loncommon::icon($listname);
  my $embstyle = &Apache::loncommon::fileembstyle($curfext);  
  # The unless conditional that follows is a bit of overkill  
  $iconname = $curfext.".gif" unless  
     (!defined($embstyle) || $embstyle eq 'unk' || $embstyle eq 'hdn');  
  #  
  $r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap>");   $r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap>");
  my $metafile = grep /^\Q$filecom[0]\E\.meta\&/, @list;   my $metafile = grep /^\Q$filecom[0]\E\.meta\&/, @list;
  my $title;   my $title;
Line 866  sub display_line { Line 851  sub display_line {
       ".gif border='0' />\n") if $rem > 0;        ".gif border='0' />\n") if $rem > 0;
  }   }
   
  $r->print("<img src=$iconpath$iconname border='0' />\n");   $r->print("<img src='$iconname' border='0' />\n");
  $r->print (" <a href=\"javascript:openWindow('".$filelink.   $r->print (" <a href=\"javascript:openWindow('".$filelink.
    "', 'previewfile', '450', '500', 'no', 'yes','yes')\";".     "', 'previewfile', '450', '500', 'no', 'yes','yes')\";".
    " TARGET=_self>$listname</a> ");     " TARGET=_self>$listname</a> ");
Line 942  sub display_line { Line 927  sub display_line {
   
 # -- display directory  # -- display directory
     if ($fnptr == $dirptr) {      if ($fnptr == $dirptr) {
  my @file_ext = split (/\./,$listname);  
  my $curfext = $file_ext[scalar(@file_ext)-1];  
  my $curdir = $startdir.$filecom[0].'/';   my $curdir = $startdir.$filecom[0].'/';
  my $anchor = $curdir;   my $anchor = $curdir;
  $anchor =~ s/\///g;   $anchor =~ s/\///g;
Line 973  sub display_line { Line 956  sub display_line {
  $r->print ('<a href="javascript:gothere(\''.$curdir.'\')"><img src="'.   $r->print ('<a href="javascript:gothere(\''.$curdir.'\')"><img src="'.
    $iconpath.'folder_'.$diropen.'.gif" border="0" /></a>'.     $iconpath.'folder_'.$diropen.'.gif" border="0" /></a>'.
    "\n");     "\n");
  $r->print ("$listname$tabtag</tr></form>\n");   $r->print ("$listname</td>\n");
   # Attributes
    my $filelink = $startdir.$filecom[0].'/default';
   
    if ($hash{'display_attrs_0'} == 1) {
       my $title = &Apache::lonnet::gettitle($filelink,'title');
       $r->print('<td> '.($title eq '' ? '&nbsp;' : $title).
         ' </td>'."\n");
    }
    $r->print('<td align=right> ',
     $filecom[8]," </td>\n") 
       if $hash{'display_attrs_1'} == 1;
    $r->print('<td> '.
     (localtime($filecom[9]))." </td>\n") 
       if $hash{'display_attrs_2'} == 1;
    $r->print('<td> '.
     (localtime($filecom[10]))." </td>\n") 
       if $hash{'display_attrs_3'} == 1;
   
    if ($hash{'display_attrs_4'} == 1) {
       my $author = &Apache::lonnet::metadata($filelink,'author');
       $r->print('<td> '.($author eq '' ? '&nbsp;' : $author).
         " </td>\n");
    }
    if ($hash{'display_attrs_5'} == 1) {
       my $keywords = &Apache::lonnet::metadata($filelink,'keywords');
       # $keywords = '&nbsp;' if (!$keywords);
       $r->print('<td> '.($keywords eq '' ? '&nbsp;' : $keywords).
         " </td>\n");
    }
    if ($hash{'display_attrs_6'} == 1) {
       my $lang = &Apache::lonnet::metadata($filelink,'language');
       $lang = &Apache::loncommon::languagedescription($lang);
       $r->print('<td> '.($lang eq '' ? '&nbsp;' : $lang).
         " </td>\n");
    }
           if ($hash{'display_attrs_7'} == 1) {
      $r->print('<td>&nbsp;</td>');
           }
    if ($hash{'display_attrs_8'} == 1) {
      $r->print('<td>&nbsp;</td>');
    }
    $r->print('</form></tr>');
     }      }
   
 }  }

Removed from v.1.80  
changed lines
  Added in v.1.86


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