--- loncom/interface/lonindexer.pm 2004/02/17 02:43:40 1.92
+++ loncom/interface/lonindexer.pm 2004/03/28 21:01:06 1.95
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.92 2004/02/17 02:43:40 taceyjo1 Exp $
+# $Id: lonindexer.pm,v 1.95 2004/03/28 21:01:06 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -47,6 +47,7 @@ use strict;
use Apache::lonnet();
use Apache::loncommon();
use Apache::lonhtmlcommon();
+use Apache::lonsequence();
use Apache::Constants qw(:common);
use Apache::lonmeta;
use Apache::File;
@@ -572,6 +573,7 @@ sub scanDir {
next if($strip =~ /.*\.meta$/ | $obs eq '1');
my (@fileparts) = split(/\./,$strip);
if ($hash{'display_attrs_9'} != 1) {
+# if not all versions to be shown
if (scalar(@fileparts) >= 3) {
my $fext = pop @fileparts;
my $ov = pop @fileparts;
@@ -590,7 +592,7 @@ sub scanDir {
$curdir = $startdir;
}
my $diropen = 'closed';
- if (($dirptr&$testdir) or ($dom =~ /^(domain|user)$/)) {
+ if (($dirptr&$testdir) or ($dom =~ /^(domain|user)$/) || ($compuri=~/\.(sequence|page)$/)) {
while (my ($key,$val)= each %dupdirs) {
if ($key eq $compuri and $val eq "open") {
$diropen = "opened";
@@ -618,7 +620,12 @@ sub get_list {
if ($hash{'dirlist_files_'.$luri}) {
@list = split(/\n/,$hash{'dirlist_files_'.$luri});
+ } elsif ($uri=~/\.(page|sequence)$/) {
+# is a page or a sequence
+ @list= &Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$uri));
+ $hash{'dirlist_files_'.$luri} = join("\n",@list);
} else {
+# is really a directory
@list = &Apache::lonnet::dirlist($uri);
$hash{'dirlist_files_'.$luri} = join("\n",@list);
}
@@ -722,7 +729,7 @@ sub display_line {
return OK;
}
# Do we have permission to look at this?
- if($filecom[15] ne '1') { return OK if (!&Apache::lonnet::allowed('bre',$startdir.$filecom[0])); }
+ if($filecom[15] ne '1') { return OK if (!&Apache::lonnet::allowed('bre',$startdir.$filecom[0])); }
# display domain
if ($filecom[1] eq 'domain') {
@@ -807,8 +814,7 @@ sub display_line {
$r->print("".
"\n");
$r->print("