--- loncom/interface/lonindexer.pm 2003/10/24 21:09:24 1.79 +++ loncom/interface/lonindexer.pm 2004/01/05 15:02:43 1.86 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.79 2003/10/24 21:09:24 albertel Exp $ +# $Id: lonindexer.pm,v 1.86 2004/01/05 15:02:43 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,21 +25,6 @@ # # 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 -# ### ############################################################################### @@ -61,6 +46,7 @@ package Apache::lonindexer; use strict; use Apache::lonnet(); use Apache::loncommon(); +use Apache::lonhtmlcommon(); use Apache::Constants qw(:common); use Apache::lonmeta; use Apache::File; @@ -432,10 +418,11 @@ $r->print(&Apache::loncommon::bodytag('B 'av' => 'All versions', 'ud' => 'Update Display' ); + my $Displayfileattributes=&mt('Display file attributes'); $r->print(< -Display file attributes
+$Displayfileattributes
@@ -457,7 +444,10 @@ $closebutton $groupimportbutton 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 my $titleclr="#ddffff"; # $r->print(&initdebug()); @@ -684,7 +674,7 @@ sub match_ext { push @trimlist,$line; } } - @trimlist = sort (@trimlist); + @trimlist = sort {uc($a) cmp uc($b)} (@trimlist); return @trimlist; } @@ -805,12 +795,7 @@ sub display_line { return OK if ($skip > 0); } # Set the icon for the file - my $iconname = "unknown.gif"; - 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'); - # + my $iconname = &Apache::loncommon::icon($listname); $r->print("\n"); + $r->print ("$listname\n"); +# Attributes + my $filelink = $startdir.$filecom[0].'/default'; + + if ($hash{'display_attrs_0'} == 1) { + my $title = &Apache::lonnet::gettitle($filelink,'title'); + $r->print(''."\n"); + } + $r->print('\n") + if $hash{'display_attrs_1'} == 1; + $r->print('\n") + if $hash{'display_attrs_2'} == 1; + $r->print('\n") + if $hash{'display_attrs_3'} == 1; + + if ($hash{'display_attrs_4'} == 1) { + my $author = &Apache::lonnet::metadata($filelink,'author'); + $r->print('\n"); + } + if ($hash{'display_attrs_5'} == 1) { + my $keywords = &Apache::lonnet::metadata($filelink,'keywords'); + # $keywords = ' ' if (!$keywords); + $r->print('\n"); + } + if ($hash{'display_attrs_6'} == 1) { + my $lang = &Apache::lonnet::metadata($filelink,'language'); + $lang = &Apache::loncommon::languagedescription($lang); + $r->print('\n"); + } + if ($hash{'display_attrs_7'} == 1) { + $r->print(''); + } + if ($hash{'display_attrs_8'} == 1) { + $r->print(''); + } + $r->print(''); } }
$lt{'ti'} $lt{'si'}
"); my $metafile = grep /^\Q$filecom[0]\E\.meta\&/, @list; my $title; @@ -866,7 +851,7 @@ sub display_line { ".gif border='0' />\n") if $rem > 0; } - $r->print("\n"); + $r->print("\n"); $r->print (" $listname "); @@ -942,8 +927,6 @@ sub display_line { # -- display directory if ($fnptr == $dirptr) { - my @file_ext = split (/\./,$listname); - my $curfext = $file_ext[scalar(@file_ext)-1]; my $curdir = $startdir.$filecom[0].'/'; my $anchor = $curdir; $anchor =~ s/\///g; @@ -973,7 +956,49 @@ sub display_line { $r->print (''. "\n"); - $r->print ("$listname$tabtag
'.($title eq '' ? ' ' : $title). + ' ', + $filecom[8]," '. + (localtime($filecom[9]))." '. + (localtime($filecom[10]))." '.($author eq '' ? ' ' : $author). + " '.($keywords eq '' ? ' ' : $keywords). + " '.($lang eq '' ? ' ' : $lang). + "