--- rat/lonpageflip.pm 2002/07/08 20:10:40 1.27 +++ rat/lonpageflip.pm 2002/08/18 21:45:41 1.29 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.27 2002/07/08 20:10:40 www Exp $ +# $Id: lonpageflip.pm,v 1.29 2002/08/18 21:45:41 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -66,7 +66,7 @@ sub addrid { sub fullmove { my ($rid,$mapurl,$direction)=@_; if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', - &GDBM_READER,0640)) { + &GDBM_READER(),0640)) { ($rid,$mapurl)=&move($rid,$mapurl,$direction); untie(%hash); } @@ -84,7 +84,7 @@ sub move { if ($direction eq 'forward') { # --------------------------------------------------------------------- Forward if ($hash{'type_'.$rid} eq 'finish') { - $rid=$hash{'ids_/res/'.$mapurl}; + $rid=$hash{'ids_'.&Apache::lonnet::clutter($mapurl)}; } map { my $thiscond= @@ -120,7 +120,7 @@ sub move { } elsif ($direction eq 'back') { # ------------------------------------------------------------------- Backwards if ($hash{'type_'.$rid} eq 'start') { - $rid=$hash{'ids_/res/'.$mapurl}; + $rid=$hash{'ids_'.&Apache::lonnet::clutter($mapurl)}; } map { my $thiscond= @@ -184,13 +184,13 @@ sub handler { # -------------------------------------------------------- Return to last known my $last; if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', - &GDBM_READER,0640)) { + &GDBM_READER(),0640)) { $last=$hash{'last_known'}; untie(%hash); } my $newloc; if ($last) { - $newloc='/res/'.(split(/\_\_\_/,$last))[1]; + $newloc=&Apache::lonnet::clutter((split(/\_\_\_/,$last))[1]); } else { $newloc='/adm/noidea.html'; } @@ -206,12 +206,12 @@ sub handler { ($currenturl=~/^\/adm\/wrapper\//)) { my $last; if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', - &GDBM_READER,0640)) { + &GDBM_READER(),0640)) { $last=$hash{'last_known'}; untie(%hash); } if ($last) { - $currenturl='/res/'.(split(/\_\_\_/,$last))[1]; + $currenturl=&Apache::lonnet::clutter((split(/\_\_\_/,$last))[1]); } else { $r->content_type('text/html'); $r->header_out(Location => @@ -230,8 +230,9 @@ sub handler { # ============================================================ Tie the big hash if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', - &GDBM_READER,0640)) { - my $rid=$hash{'map_pc_/res/'.$startoutmap}.'.'.$mapnum; + &GDBM_READER(),0640)) { + my $rid=$hash{'map_pc_'.&Apache::lonnet::clutter($startoutmap)}. + '.'.$mapnum; # ------------------------------------------------- Move forward, backward, etc my $endupmap;