--- loncom/interface/lonindexer.pm 2004/05/10 08:34:50 1.103
+++ 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.103 2004/05/10 08:34:50 taceyjo1 Exp $
+# $Id: lonindexer.pm,v 1.104 2004/05/11 05:19:30 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -841,8 +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=1;
+
+ 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;
@@ -860,7 +866,7 @@ sub display_line {
$title=$listname;
$title = &Apache::lonnet::metadata($filelink,'title')
if ($metafile == 1);
- $title=$listname unless $title;
+ $title=$listname unless $title;
my $titleesc=&HTML::Entities::encode($title,'<>&"');
$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");
}
@@ -945,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");
@@ -993,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'} : '');