\n");
$r->print("\n");
$r->print("Name | \n");
- $r->print("Size (bytes) | \n") if ($ENV{'form.attr0'} == 1);
- $r->print("Last accessed | \n") if ($ENV{'form.attr1'} == 1);
- $r->print("Last modified | \n") if ($ENV{'form.attr2'} == 1);
- $r->print("Author(s) | \n") if ($ENV{'form.attr3'} == 1);
- $r->print("Keywords | \n") if ($ENV{'form.attr4'} == 1);
- $r->print("Language | \n") if ($ENV{'form.attr5'} == 1);
+ $r->print("Size (bytes) | \n") if ($hash{'display_attrs_0'} == 1);
+ $r->print("Last accessed | \n") if ($hash{'display_attrs_1'} == 1);
+ $r->print("Last modified | \n") if ($hash{'display_attrs_2'} == 1);
+ $r->print("Author(s) | \n") if ($hash{'display_attrs_3'} == 1);
+ $r->print("Keywords | \n") if ($hash{'display_attrs_4'} == 1);
+ $r->print("Language | \n") if ($hash{'display_attrs_5'} == 1);
$r->print(" ");
- my $diropen = "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db";
-
- if (tie(%hash,'GDBM_File',$diropen,&GDBM_WRCREAT,0640)) {
map {
if ($_ =~ /^diropen_status_/) {
my $key = $_;
@@ -143,6 +155,7 @@ END
return OK;
}
+
# --------------------recursive scan of a directory
sub scanDir {
my ($r,$startdir,$indent)=@_;
@@ -184,7 +197,7 @@ sub get_list {
my $luri = $uri;
$luri =~ s/\//_/g;
- if ($ENV{'form.dirlistattr'} eq "Refresh") {
+ if ($ENV{'form.attrs'} eq "Refresh") {
map {
delete $hash{$_} if ($_ =~ /^dirlist_files_/);
} keys %hash;
@@ -257,8 +270,9 @@ sub display_line{
my $i=0;
while ($i<=5) {
- my $key="form.attr".$i;
- $tabtag=join('',$tabtag," | ") if $ENV{$key} == 1;
+# my $key="form.attr".$i;
+# $tabtag=join('',$tabtag," | ") if $ENV{$key} == 1;
+ $tabtag=join('',$tabtag," | ") if $hash{'display_attrs_'.$i} == 1;
$i++;
}
if ($filecom[1] eq "domain") {
@@ -316,21 +330,22 @@ sub display_line{
$r->print (" (metadata) ") if ($metafile == 1);
$r=>print("\n");
- $r->print(" ",$filecom[8]," | \n") if $ENV{'form.attr0'} == 1;
- $r->print(" ".(localtime($filecom[9]))." | \n") if $ENV{'form.attr1'} == 1;
- $r->print(" ".(localtime($filecom[10]))." | \n") if $ENV{'form.attr2'} == 1;
+# $r->print(" ",$filecom[8]," | \n") if $ENV{'form.attr0'} == 1;
+ $r->print(" ",$filecom[8]," | \n") if $hash{'display_attrs_0'} == 1;
+ $r->print(" ".(localtime($filecom[9]))." | \n") if $hash{'display_attrs_1'} == 1;
+ $r->print(" ".(localtime($filecom[10]))." | \n") if $hash{'display_attrs_2'} == 1;
- if ($ENV{'form.attr3'} == 1) {
+ if ($hash{'display_attrs_3'} == 1) {
my $author = &Apache::lonnet::metadata($filelink,'author') if ($metafile == 1);
$author = ' ' if (!$author);
$r->print(" ".$author." | \n");
}
- if ($ENV{'form.attr4'} == 1) {
+ if ($hash{'display_attrs_4'} == 1) {
my $keywords = &Apache::lonnet::metadata($filelink,'keywords') if ($metafile == 1);
$keywords = ' ' if (!$keywords);
$r->print(" ".$keywords." | \n");
}
- if ($ENV{'form.attr5'} == 1) {
+ if ($hash{'display_attrs_5'} == 1) {
my $lang = &Apache::lonnet::metadata($filelink,'language') if ($metafile == 1);
$lang = $language{$lang};
$lang = ' ' if (!$lang);
@@ -379,9 +394,9 @@ sub begin_form {
$r->print ("
|