version 1.6, 2008/01/22 22:37:18
|
version 1.8, 2011/10/17 12:41:30
|
Line 47 sub innercrsdirlist {
|
Line 47 sub innercrsdirlist {
|
unless ($which) { $which=''; } else { $which.='/'; } |
unless ($which) { $which=''; } else { $which.='/'; } |
unless ($path) { $path=''; } else { $path.='/'; } |
unless ($path) { $path=''; } else { $path.='/'; } |
my %crsdata=&Apache::lonnet::coursedescription($courseid); |
my %crsdata=&Apache::lonnet::coursedescription($courseid); |
my @listing=&Apache::lonnet::dirlist |
my $getpropath = 1; |
($which,$crsdata{'domain'},$crsdata{'num'}, |
my ($dirlistref,$listerror) = |
&propath($crsdata{'domain'},$crsdata{'num'})); |
&Apache::lonnet::dirlist($which,$crsdata{'domain'}, |
foreach (@listing) { |
$crsdata{'num'},$getpropath); |
unless ($_=~/^\./) { |
if (ref($dirlistref) eq 'ARRAY') { |
my @unpackline = split (/\&/,$_); |
foreach (@{$dirlistref}) { |
if ($unpackline[3]&$dirptr) { |
unless ($_=~/^\./) { |
|
my @unpackline = split (/\&/,$_); |
|
if ($unpackline[3]&$dirptr) { |
# is a directory, recurse |
# is a directory, recurse |
&innercrsdirlist($courseid,$which.$unpackline[0], |
&innercrsdirlist($courseid,$which.$unpackline[0], |
$path.$unpackline[0]); |
$path.$unpackline[0]); |
} else { |
} else { |
# is a file, put into output |
# is a file, put into output |
push (@output,$path.$unpackline[0]); |
push (@output,$path.$unpackline[0]); |
|
} |
} |
} |
} |
} |
} |
} |
return @output; |
return @output; |
} |
} |