--- loncom/interface/lonindexer.pm 2004/06/22 13:27:51 1.117
+++ loncom/interface/lonindexer.pm 2004/08/01 19:36:33 1.122
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.117 2004/06/22 13:27:51 www Exp $
+# $Id: lonindexer.pm,v 1.122 2004/08/01 19:36:33 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -136,7 +136,8 @@ sub handler {
if ($ENV{'form.launch'} eq '2') {
$r->content_type('text/html');
my $extra='';
- if (defined($ENV{'form.titleelement'})) {
+ if (defined($ENV{'form.titleelement'}) &&
+ $ENV{'form.titleelement'} ne '') {
my $verify_title = &Apache::lonnet::gettitle($ENV{'form.acts'});
# &Apache::lonnet::logthis("Hrrm $ENV{'form.acts'} -- $verify_title");
$verify_title=~s/'/\\'/g;
@@ -518,7 +519,7 @@ END
$r->print("
".&mt("Language")." | \n")
if ($hash{'display_attrs_6'} == 1);
$r->print("".&mt("Usage Statistics")." (".
- &mt("Courses/Network Hits").") | \n")
+ &mt("Courses/Network Hits").") ".&mt('updated periodically')."\n")
if ($hash{'display_attrs_8'} == 1);
$r->print("".&mt("Source Available")." | \n")
if ($hash{'display_attrs_10'} == 1);
@@ -661,10 +662,12 @@ sub get_list {
if ($ENV{'form.updatedisplay'}) {
foreach (keys %hash) {
delete $hash{$_} if ($_ =~ /^dirlist_files_/);
+ delete $hash{$_} if ($_ =~ /^dirlist_timestamp_files_/);
}
}
- if ($hash{'dirlist_files_'.$luri}) {
+ if (defined($hash{'dirlist_files_'.$luri}) &&
+ $hash{'dirlist_timestamp_files_'.$luri}+600 > (time)) {
@list = split(/\n/,$hash{'dirlist_files_'.$luri});
} elsif ($uri=~/\.(page|sequence)\/$/) {
# is a page or a sequence
@@ -680,6 +683,7 @@ sub get_list {
# is really a directory
@list = &Apache::lonnet::dirlist($uri);
$hash{'dirlist_files_'.$luri} = join("\n",@list);
+ $hash{'dirlist_timestamp_files_'.$luri} = time;
}
return @list=&match_ext($r,@list);
}
@@ -1017,7 +1021,7 @@ sub display_line {
if ($hash{'display_attrs_10'} == 1) {
my $source = &Apache::lonnet::metadata($filelink,'sourceavail');
if($source eq 'open') {
- my $sourcelink = &Apache::lonsource::make_link($filelink);
+ my $sourcelink = &Apache::lonsource::make_link($filelink,$listname);
$r->print(''."Yes "." | \n");