--- rat/lonpageflip.pm 2003/09/17 17:50:49 1.44 +++ rat/lonpageflip.pm 2004/10/18 22:24:00 1.48 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.44 2003/09/17 17:50:49 albertel Exp $ +# $Id: lonpageflip.pm,v 1.48 2004/10/18 22:24:00 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -120,6 +120,10 @@ sub move { $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'sequence') { $mapurl=$hash{'src_'.$next}; $next=$hash{'map_start_'.$hash{'src_'.$next}}; + } elsif ( +# This jumps back up from an empty sequence, to a page up one level + $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'page') { + $mapurl=$hash{'map_id_'.(split(/\./,$next))[0]}; } } elsif ((split(/\./,$startoutrid))[0]!=(split(/\./,$next))[0]) { @@ -156,7 +160,11 @@ sub move { $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'sequence') { $mapurl=$hash{'src_'.$next}; $next=$hash{'map_finish_'.$hash{'src_'.$next}}; - } + } elsif ( + $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'page') { +# This jumps back up from an empty sequence, to a page up one level + $mapurl=$hash{'map_id_'.(split(/\./,$next))[0]}; + } } elsif ((split(/\./,$startoutrid))[0]!=(split(/\./,$next))[0]) { # This comes back up from a map (going up one level); @@ -190,6 +198,7 @@ sub handler { $ENV{'form.postdata'}=~/(\w+)\:(.*)/; my $direction=$1; my $currenturl=$2; + $currenturl=~s/\.\d+\.(\w+)$/\.$1/; if ($direction eq 'return') { # -------------------------------------------------------- Return to last known my $last; @@ -259,7 +268,8 @@ sub handler { # -------------------------------------- Do we have one and only one empty URL? my $safecount=0; while (($next) && ($next!~/\,/) && - ((!$hash{'src_'.$next}) || ($hash{'randomout_'.$next})) + ((!$hash{'src_'.$next}) || + ($ENV{'request.role.adv'}) && $hash{'randomout_'.$next})) && ($safecount<10000)) { ($next,$endupmap)=&move($next,$endupmap,$direction); $safecount++; @@ -388,7 +398,7 @@ ENDNONE } } else { # ---------------------------------------- No, could not determine where we are - if ( $Apache::lonnet::mod_perl_version() == 2 ) { + if ( &Apache::lonnet::mod_perl_version() == 2 ) { &Apache::lonnet::cleanenv(); } $r->internal_redirect('/adm/ambiguous');