version 1.209, 2011/07/04 09:24:58
|
version 1.212, 2011/10/17 13:12:30
|
Line 755 sub scanDir {
|
Line 755 sub scanDir {
|
sub get_list { |
sub get_list { |
my ($r,$uri)=@_; |
my ($r,$uri)=@_; |
my @list=(); |
my @list=(); |
|
my $listerror; |
|
|
(my $luri = $uri) =~ s/\//_/g; |
(my $luri = $uri) =~ s/\//_/g; |
if ($env{'form.updatedisplay'}) { |
if ($env{'form.updatedisplay'}) { |
foreach (keys %hash) { |
foreach (keys %hash) { |
Line 778 sub get_list {
|
Line 780 sub get_list {
|
$hash{'dirlist_files_'.$luri} = join("\n",@list); |
$hash{'dirlist_files_'.$luri} = join("\n",@list); |
} else { |
} else { |
# is really a directory |
# is really a directory |
@list = &Apache::lonnet::dirlist($uri); |
(my $listref,$listerror) = &Apache::lonnet::dirlist($uri); |
|
if (ref($listref) eq 'ARRAY') { |
|
@list = @{$listref}; |
|
} |
$hash{'dirlist_files_'.$luri} = join("\n",@list); |
$hash{'dirlist_files_'.$luri} = join("\n",@list); |
$hash{'dirlist_timestamp_files_'.$luri} = time; |
$hash{'dirlist_timestamp_files_'.$luri} = time; |
} |
} |
|
#Checking for error messages associated with empty directories or inaccessible servers (See Bug 4984) |
|
if (($listerror eq 'no_such_dir') || ($listerror eq 'no_such_host') || ($listerror eq 'no_host')) { |
|
$r->print("<p class='LC_info'>" . &mt("Directory does not exist."). "</p>"); |
|
} elsif ($listerror eq 'con_lost') { |
|
$r->print("<p class='LC_info'>" . &mt("Directory temporarily not accessible."). "</p>"); |
|
} |
|
|
return @list=&match_ext($r,@list); |
return @list=&match_ext($r,@list); |
} |
} |
|
|