--- rat/lonsequence.pm 2004/09/10 06:38:24 1.20 +++ rat/lonsequence.pm 2005/04/07 06:56:27 1.24 @@ -2,7 +2,7 @@ # # Sequence Handler # -# $Id: lonsequence.pm,v 1.20 2004/09/10 06:38:24 www Exp $ +# $Id: lonsequence.pm,v 1.24 2005/04/07 06:56:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -28,13 +28,6 @@ # # (Handler to resolve ambiguous file locations # -# (TeX Content Handler -# -# 05/29/00,05/30,10/11 Gerd Kortemeyer) -# -# 10/11,10/12 Gerd Kortemeyer) -# -# 10/16 Gerd Kortemeyer package Apache::lonsequence; @@ -78,7 +71,7 @@ sub mapread { sub viewmap { my ($r,$url)=@_; $r->print(''); - if ($ENV{'form.forceselect'}) { $r->print(<print(< function select_group() { @@ -103,7 +96,7 @@ ENDSCRIPT } $r->print(&Apache::loncommon::bodytag('Map Contents').'

'.$url.'

'); # ------------------ This is trying to select. Provide buttons and tie %selhash - if ($ENV{'form.forceselect'}) { $r->print(<print(< ENDSELECT my $diropendb = - "/home/httpd/perl/tmp/$ENV{'user.domain'}\_$ENV{'user.name'}_groupsec.db"; + "/home/httpd/perl/tmp/$env{'user.domain'}\_$env{'user.name'}_groupsec.db"; if (tie(%selhash,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { - if ($ENV{'form.launch'} eq '1') { + if ($env{'form.launch'} eq '1') { &start_fresh_session(); } $successtied=1; # - Evaluate actions from previous page (both cumulatively and chronologically) - if ($ENV{'form.catalogmode'} eq 'groupimport') { - my $acts=$ENV{'form.acts'}; + if ($env{'form.catalogmode'} eq 'groupimport') { + my $acts=$env{'form.acts'}; my @Acts=split(/b/,$acts); my %ahash; my %achash; @@ -249,9 +242,9 @@ sub handler { my $exitdisid = ''; my $arrow_dir = ''; - if (($ENV{'request.course.fn'}) && (!$ENV{'form.forceselect'})) { + if (($env{'request.course.fn'}) && (!$env{'form.forceselect'})) { my $last; - if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', + if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db', &GDBM_READER(),0640)) { $last=$hash{'last_direction'}; untie(%hash); @@ -259,10 +252,10 @@ sub handler { my $direction=''; my $prevmap=''; if ($last) { - ($prevmap,$direction)=(split(/\_\_\_/,$last)); + ($prevmap,undef,$direction)=&Apache::lonnet::decode_symb($last); } # ------------------------------------------------------------- Tie big db file - if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db', + if (tie(%bighash,'GDBM_File',$env{'request.course.fn'}.'.db', &GDBM_READER(),0640)) { my $disid=''; my $randomout =''; @@ -276,7 +269,7 @@ sub handler { $disurl=$bighash{'src_'.$disid}; $dismapid=(split(/\./,$disid))[1]; $randomout = $bighash{'randomout_'.$disid}; - } elsif (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', + } elsif (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db', &GDBM_READER(),0640)) { $last=$hash{'last_known'}; untie(%hash); @@ -306,15 +299,15 @@ sub handler { # now either disurl is set (going to first page), or we need another display if ($disurl) { # -------------------------------------------------- Has first or last resource - &Apache::lonnet::symblist($requrl,$disurl => $dismapid, - 'last_known' => &Apache::lonnet::declutter($disurl)); + &Apache::lonnet::symblist($requrl,$disurl => [$disurl,$dismapid], + 'last_known' => [$disurl,$dismapid]); &Apache::loncommon::content_type($r,'text/html'); $r->header_out(Location => 'http://'.$ENV{'HTTP_HOST'}.$disurl); return REDIRECT; } else { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - if ($exitdisid eq '') { + if ($exitdisid eq '' && $arrow_dir ne '') { my %lt =&Apache::lonlocal::texthash( 'back' => 'beginning', 'forward' => 'end',