--- loncom/interface/lonindexer.pm 2003/12/30 20:47:23 1.84
+++ loncom/interface/lonindexer.pm 2004/05/10 08:34:50 1.103
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.84 2003/12/30 20:47:23 albertel Exp $
+# $Id: lonindexer.pm,v 1.103 2004/05/10 08:34:50 taceyjo1 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;
@@ -54,7 +55,7 @@ use Apache::lonlocal;
use GDBM_File;
# ---------------------------------------- variables used throughout the module
-my %hash; # tied to a user-specific gdbm file
+my %hash; # global user-specific gdbm file
my %dirs; # keys are directories, values are the open/close status
my %language; # has the reference information present in language.tab
@@ -116,7 +117,7 @@ sub handler {
%hash = ();
{
my %dbfile;
- if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) {
+ if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_READER(),0640)) {
while(my($key,$value)=each(%dbfile)) {
$hash{$key}=$value;
}
@@ -164,7 +165,7 @@ END
# selection is made.
# $element is the name of the element in $formname which receives
# the URL.
- # &Apache::lonxml::debug('Checking mode, form, element');
+ #&Apache::lonxml::debug('Checking mode, form, element');
&setvalues(\%hash,'form.mode' ,\%ENV,'form.mode' );
&setvalues(\%hash,'form.form' ,\%ENV,'form.form' );
&setvalues(\%hash,'form.element' ,\%ENV,'form.element');
@@ -187,8 +188,7 @@ END
$element = $ENV{'form.element'};
$titleelement = $ENV{'form.titleelement'};
}
- &Apache::lonxml::debug("mode=$mode form=$form element=$element
- titleelement=$titleelement");
+ #&Apache::lonxml::debug("mode=$mode form=$form element=$element titleelement=$titleelement");
# ------ set catalogmodefunctions to have extra needed javascript functionality
my $catalogmodefunctions='';
if ($ENV{'form.catalogmode'} eq 'interactive' or
@@ -360,7 +360,7 @@ $r->print(&Apache::loncommon::bodytag('B
$achash{$ref}=$ac;
$ac++;
}
- # sorting through the actions and changing the tied database hash
+ # sorting through the actions and changing the global database hash
foreach (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) {
my $key=$_;
if ($ahash{$key} eq '1') {
@@ -389,7 +389,7 @@ $r->print(&Apache::loncommon::bodytag('B
}
# ---------------------------------- get state of file attributes to be showing
- if ($ENV{'form.attrs'} ne '') {
+ if ($ENV{'form.attrs'}) {
for (my $i=0; $i<=9; $i++) {
delete $hash{'display_attrs_'.$i};
if ($ENV{'form.attr'.$i} == 1) {
@@ -402,6 +402,7 @@ $r->print(&Apache::loncommon::bodytag('B
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
}
}
+
# ------------------------------- output state of file attributes to be showing
# All versions has to the last item
# since it does not take an extra col
@@ -424,28 +425,49 @@ $r->print(&Apache::loncommon::bodytag('B
enctype="application/x-www-form-urlencoded">
$Displayfileattributes
$lt{'ti'} | -$lt{'si'} | -$lt{'la'} | -$lt{'lm'} | -$lt{'st'} | +$lt{'ti'} | +$lt{'si'} | +$lt{'la'} | +$lt{'lm'} | +$lt{'st'} | |
$lt{'au'} | -$lt{'kw'} | -$lt{'ln'} | -$lt{'sr'} | -$lt{'av'} | +$lt{'au'} | +$lt{'kw'} | +$lt{'ln'} | +$lt{'sr'} | +$lt{'av'} |