--- loncom/interface/lonindexer.pm 2006/03/16 22:42:58 1.141 +++ loncom/interface/lonindexer.pm 2007/06/28 21:42:49 1.164 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.141 2006/03/16 22:42:58 albertel Exp $ +# $Id: lonindexer.pm,v 1.164 2007/06/28 21:42:49 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -54,6 +54,7 @@ use Apache::File; use Apache::lonlocal; use Apache::lonsource(); use GDBM_File; +use LONCAPA qw(:match); # ---------------------------------------- variables used throughout the module my %hash; # global user-specific gdbm file @@ -119,11 +120,14 @@ sub handler { $extrafield=''; my $diropendb = - "/home/httpd/perl/tmp/$env{'user.domain'}_$env{'user.name'}_indexer.db"; + "/home/httpd/perl/tmp/$env{'user.domain'}_$env{'user.name'}_sel_res.db"; %hash = (); { my %dbfile; - if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_READER(),0640)) { + if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_WRITER(),0640)) { + if ($env{'form.launch'} eq '1') { + &start_fresh_session(\%dbfile); + } while(my($key,$value)=each(%dbfile)) { $hash{$key}=$value; } @@ -131,9 +135,6 @@ sub handler { } } { - if ($env{'form.launch'} eq '1') { - &start_fresh_session(); - } #Hijack lonindexer to verify a title and be close down. if ($env{'form.launch'} eq '2') { &Apache::loncommon::content_type($r,'text/html'); @@ -159,7 +160,8 @@ ENDSUBM $r->print(&Apache::loncommon::start_page(undef,$js, {'only_body' =>1, 'add_entries' => - 'onLoad="load();"',}). + {'onload' => "load();"},} + ). &Apache::loncommon::end_page()); return OK; } @@ -170,18 +172,18 @@ ENDSUBM # --------------------- define extra fields and buttons in case of special mode if ($env{'form.catalogmode'} eq 'interactive') { $extrafield='