--- loncom/interface/lonindexer.pm 2002/01/17 13:53:45 1.32 +++ loncom/interface/lonindexer.pm 2002/08/08 13:07:17 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.32 2002/01/17 13:53:45 harris41 Exp $ +# $Id: lonindexer.pm,v 1.48 2002/08/08 13:07:17 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,6 +43,7 @@ # 12/11,12/13 Scott Harrison # YEAR=2002 # 1/17 Scott Harrison +# 6/29/2002 H. K. Ng # ### @@ -80,6 +81,11 @@ my $extrafield; # default extra table ce my $fnum; # file counter my $dnum; # directory counter +# ----- 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; @@ -90,6 +96,11 @@ sub handler { $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'); @@ -106,8 +117,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=''; @@ -119,19 +133,12 @@ sub handler { 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='