--- loncom/interface/lonindexer.pm 2004/05/04 20:43:21 1.100 +++ loncom/interface/lonindexer.pm 2004/05/11 05:19:30 1.104 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.100 2004/05/04 20:43:21 www Exp $ +# $Id: lonindexer.pm,v 1.104 2004/05/11 05:19:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -841,7 +841,14 @@ sub display_line { # Set the icon for the file my $iconname = &Apache::loncommon::icon($listname); $r->print(""); - my $metafile = grep /^\Q$filecom[0]\E\.meta\&/, @list; + + my $metafile = $Apache::lonnet::perlvar{'lonDocRoot'}.$pathprefix. + $filecom[0].'.meta'; + if (-e $metafile) { + $metafile=1; + } else { + $metafile=0; + } my $title; if ($ENV{'form.catalogmode'} eq 'interactive') { $title=$listname; @@ -857,8 +864,8 @@ sub display_line { $r->print(""); } elsif ($ENV{'form.catalogmode'} eq 'groupimport') { $title=$listname; - #$title = &Apache::lonnet::metadata($filelink,'title') - #if ($metafile == 1); + $title = &Apache::lonnet::metadata($filelink,'title') + if ($metafile == 1); $title=$listname unless $title; my $titleesc=&HTML::Entities::encode($title,'<>&"'); $r->print("
\n"); @@ -924,12 +931,10 @@ sub display_line { $r->print (" (metadata) ") if ($metafile == 1); - + "TARGET=_self>metadata) "); $r->print("\n"); if ($hash{'display_attrs_0'} == 1) { - my $title = &Apache::lonnet::gettitle($filelink,'title') - if ($metafile == 1); + my $title = &Apache::lonnet::gettitle($filelink,'title'); $r->print(' '.($title eq '' ? ' ' : $title). ' '."\n"); } @@ -944,21 +949,18 @@ sub display_line { if $hash{'display_attrs_3'} == 1; if ($hash{'display_attrs_4'} == 1) { - my $author = &Apache::lonnet::metadata($filelink,'author') - if ($metafile == 1); + my $author = &Apache::lonnet::metadata($filelink,'author'); $r->print(' '.($author eq '' ? ' ' : $author). " \n"); } if ($hash{'display_attrs_5'} == 1) { - my $keywords = &Apache::lonnet::metadata($filelink,'keywords') - if ($metafile == 1); + my $keywords = &Apache::lonnet::metadata($filelink,'keywords'); # $keywords = ' ' if (!$keywords); $r->print(' '.($keywords eq '' ? ' ' : $keywords). " \n"); } if ($hash{'display_attrs_6'} == 1) { - my $lang = &Apache::lonnet::metadata($filelink,'language') - if ($metafile == 1); + my $lang = &Apache::lonnet::metadata($filelink,'language'); $lang = &Apache::loncommon::languagedescription($lang); $r->print(' '.($lang eq '' ? ' ' : $lang). " \n"); @@ -992,7 +994,7 @@ sub display_line { " \n"); } if ($hash{'display_attrs_8'} == 1) { - my (%stat) = &Apache::lonmeta::dynamicmeta($filelink) if ($metafile == 1); + my (%stat) = &Apache::lonmeta::dynamicmeta($filelink); my $stat = (exists($stat{'course'}) ? $stat{'course'} : ''). ((exists($stat{'course'}) || exists($stat{'count'})) ? '/' : ''). (exists($stat{'count'}) ? $stat{'count'} : '');