--- loncom/interface/lonindexer.pm 2001/12/13 13:59:22 1.30 +++ loncom/interface/lonindexer.pm 2003/01/20 16:41:13 1.57 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.30 2001/12/13 13:59:22 harris41 Exp $ +# $Id: lonindexer.pm,v 1.57 2003/01/20 16:41:13 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,6 +41,9 @@ # 8/28,10/15,11/28,11/29 Scott Harrison # 11/30 Matthew Hall # 12/11,12/13 Scott Harrison +# YEAR=2002 +# 1/17 Scott Harrison +# 6/29/2002 H. K. Ng # ### @@ -78,20 +81,27 @@ my $extrafield; # default extra table ce my $fnum; # file counter my $dnum; # directory counter -# ---------------------------------------------------------------------- BEGIN -sub BEGIN { -} +# ----- Used to include or exclude files with certain extensions. +my @Only = (); +my @Omit = (); + # ----------------------------- Handling routine called via Apache and mod_perl sub handler { my $r = shift; $r->content_type('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....) + undef (@Only); + undef (@Omit); + # ------------------------------------- read in machine configuration variables my $iconpath= $r->dir_config('lonIconsURL') . "/"; my $domain = $r->dir_config('lonDefDomain'); @@ -108,8 +118,11 @@ sub handler { my $uri=$r->uri; # -------------------------------------- see if called from an interactive mode - &get_unprocessed_cgi(); - + # Get the parameters from the query string + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['catalogmode','launch','acts','mode','form','element', + 'only','omit']); + #------------------------------------------------------------------- my $closebutton=''; my $groupimportbutton=''; my $colspan=''; @@ -118,22 +131,15 @@ sub handler { my $diropendb = "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; - if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { + if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { if ($ENV{'form.launch'} eq '1') { &start_fresh_session(); - } - + } # -------------------- refresh environment with user database values (in %hash) - if ($hash{'mode_catalog'} eq 'interactive') { - $ENV{'form.catalogmode'}='interactive'; - } - if ($hash{'mode_catalog'} eq 'groupimport') { - $ENV{'form.catalogmode'}='groupimport'; - } + &setvalues(\%hash,'form.catalogmode',\%ENV,'form.catalogmode' ); # --------------------- define extra fields and buttons in case of special mode if ($ENV{'form.catalogmode'} eq 'interactive') { - $hash{'mode_catalog'}='interactive'; $extrafield='