--- rat/lonpageflip.pm 2003/03/08 01:39:29 1.37 +++ rat/lonpageflip.pm 2003/09/17 18:16:39 1.45 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.37 2003/03/08 01:39:29 www Exp $ +# $Id: lonpageflip.pm,v 1.45 2003/09/17 18:16:39 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -201,9 +201,9 @@ sub handler { my $newloc; if (($last) && (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', &GDBM_READER(),0640))) { - my ($murl,$fn)=split(/\_\_\_/,$last); + my ($murl,$fn)=&Apache::lonnet::decode_symb($last); my $id; - ($murl,$id,$fn)=split(/\_\_\_/,&Apache::lonnet::symbread($fn)); + ($murl,$id,$fn)=&Apache::lonnet::decode_symb(&Apache::lonnet::symbread($fn)); $newloc=$hash{'src_'. $hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id}; unless ($newloc) { $newloc='/adm/noidea.html'; } @@ -230,7 +230,7 @@ sub handler { untie(%hash); } if ($last) { - $currenturl=&Apache::lonnet::clutter((split(/\_\_\_/,$last))[1]); + $currenturl=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($last))[1]); } else { $r->content_type('text/html'); $r->header_out(Location => @@ -242,7 +242,7 @@ sub handler { my $position; if ($position=Apache::lonnet::symbread($currenturl)) { # ------------------------------------------------------------------------- Yes - my ($startoutmap,$mapnum,$thisurl)=split(/\_\_\_/,$position); + my ($startoutmap,$mapnum,$thisurl)=&Apache::lonnet::decode_symb($position); $cachehash{$startoutmap}{$thisurl}=$mapnum; $cachehash{$startoutmap}{'last_known'}= &Apache::lonnet::declutter($currenturl); @@ -311,6 +311,12 @@ sub handler { # ============================================== Do not return before this line if ($redirecturl) { # ----------------------------------------------------- There is a URL to go to + if ($direction eq 'forward') { + &Apache::lonnet::linklog($currenturl,$redirecturl); + } + if ($direction eq 'back') { + &Apache::lonnet::linklog($redirecturl,$currenturl); + } # ------------------------------------------------- Check for critical messages if ((time-$ENV{'user.criticalcheck.time'})>300) { my @what=&Apache::lonnet::dump @@ -382,7 +388,10 @@ ENDNONE } } else { # ---------------------------------------- No, could not determine where we are - $r->internal_redirect('/adm/ambiguous'); + if ( &Apache::lonnet::mod_perl_version() == 2 ) { + &Apache::lonnet::cleanenv(); + } + $r->internal_redirect('/adm/ambiguous'); } } else { # -------------------------- Class was not initialized or page fliped strangely