--- loncom/interface/lonindexer.pm 2003/06/14 00:15:01 1.66 +++ loncom/interface/lonindexer.pm 2003/09/26 00:23:09 1.77 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.66 2003/06/14 00:15:01 albertel Exp $ +# $Id: lonindexer.pm,v 1.77 2003/09/26 00:23:09 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -62,7 +62,9 @@ use strict; use Apache::lonnet(); use Apache::loncommon(); use Apache::Constants qw(:common); +use Apache::lonmeta; use Apache::File; +use Apache::lonlocal; use GDBM_File; # ---------------------------------------- variables used throughout the module @@ -84,13 +86,13 @@ my @Omit = (); # ----------------------------- Handling routine called via Apache and mod_perl sub handler { my $r = shift; - $r->content_type('text/html'); + my $c = $r->connection(); + &Apache::loncommon::content_type($r,'text/html'); &Apache::loncommon::no_cache($r); $r->send_http_header; return OK if $r->header_only; $fnum=0; $dnum=0; - untie %hash; # Deal with stupid global variables (is there a way around making # these global to this package? It is just so wrong....) @@ -125,8 +127,17 @@ sub handler { $extrafield=''; my $diropendb = "/home/httpd/perl/tmp/$ENV{'user.domain'}_$ENV{'user.name'}_indexer.db"; - - if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { + %hash = (); + { + my %dbfile; + if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { + while(my($key,$value)=each(%dbfile)) { + $hash{$key}=$value; + } + untie(%dbfile); + } + } + { if ($ENV{'form.launch'} eq '1') { &start_fresh_session(); } @@ -139,8 +150,9 @@ sub handler { ''; $colspan=" colspan='2' "; + my $cl=&mt('Close'); $closebutton=< + END } elsif ($ENV{'form.catalogmode'} eq 'groupimport') { @@ -148,11 +160,13 @@ END ''; $colspan=" colspan='2' "; + my $cl=&mt('Close'); + my $gi=&mt('Group Import'); $closebutton=< + END $groupimportbutton=< END } @@ -309,10 +323,14 @@ END