--- loncom/interface/lonindexer.pm 2004/03/30 17:55:26 1.98
+++ 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.98 2004/03/30 17:55:26 www Exp $
+# $Id: lonindexer.pm,v 1.104 2004/05/11 05:19:30 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -452,8 +452,19 @@ END
(($ENV{'form.catalogmode'} eq 'groupimport')?
'document.forms.fileattr':'')).
&Apache::lonhtmlcommon::select_recent('residx','resrecent',
-'this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();').
- '');
+'this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();'));
+# -------------------------------------------------------- Resource Home Button
+ my $reshome=$ENV{'course.'.$ENV{'request.course.id'}.'.reshome'};
+ if ($reshome) {
+ $r->print("print('javascript:document.forms.fileattr.action="'.$reshome.'";document.forms.fileattr.submit();');
+ } else {
+ $r->print($reshome);
+ }
+ $r->print("'>".&mt('Home').'');
+ }
+ $r->print('');
# ------------------------------------------------------ Remember where we were
&Apache::loncommon::storeresurl($storeuri);
&Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri);
@@ -830,14 +841,21 @@ 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;
$title = &Apache::lonnet::metadata($filelink,'title')
if ($metafile == 1);
$title=$listname unless $title;
- my $titleesc=HTML::Entities::encode($title);
+ my $titleesc=HTML::Entities::encode($title,'<>&"');
$titleesc=~s/\'/\\'/; #' (clean up this spare quote)
$r->print("");
@@ -846,10 +864,10 @@ 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);
+ 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");
}
@@ -933,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");
@@ -981,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'} : '');