--- rat/lonpageflip.pm 2005/03/01 00:22:57 1.52 +++ rat/lonpageflip.pm 2005/04/07 06:56:27 1.53 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.52 2005/03/01 00:22:57 albertel Exp $ +# $Id: lonpageflip.pm,v 1.53 2005/04/07 06:56:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,7 @@ package Apache::lonpageflip; use strict; use Apache::Constants qw(:common :http REDIRECT); -use Apache::lonnet(); +use Apache::lonnet; use HTML::TokeParser; use GDBM_File; @@ -63,7 +63,7 @@ sub addrid { sub fullmove { my ($rid,$mapurl,$direction)=@_; - if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', + if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'.db', &GDBM_READER(),0640)) { ($rid,$mapurl)=&move($rid,$mapurl,$direction); untie(%hash); @@ -191,8 +191,8 @@ sub handler { my $next=''; my @possibilities=(); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['postdata']); - if (($ENV{'form.postdata'})&&($ENV{'request.course.fn'})) { - $ENV{'form.postdata'}=~/(\w+)\:(.*)/; + if (($env{'form.postdata'})&&($env{'request.course.fn'})) { + $env{'form.postdata'}=~/(\w+)\:(.*)/; my $direction=$1; my $currenturl=$2; if ($currenturl=~m|^/enc/|) { @@ -202,13 +202,13 @@ sub handler { if ($direction eq 'return') { # -------------------------------------------------------- Return to last known 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_known'}; untie(%hash); } my $newloc; - if (($last) && (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', + if (($last) && (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'.db', &GDBM_READER(),0640))) { my ($murl,$id,$fn)=&Apache::lonnet::decode_symb($last); $id=$hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id; @@ -236,7 +236,7 @@ sub handler { # unless (&Apache::lonnet::is_on_map($currenturl)) { 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_known'}; untie(%hash); @@ -260,7 +260,7 @@ sub handler { [&Apache::lonnet::declutter($currenturl),$mapnum]; # ============================================================ Tie the big hash - if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', + if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'.db', &GDBM_READER(),0640)) { my $rid=$hash{'map_pc_'.&Apache::lonnet::clutter($startoutmap)}. '.'.$mapnum; @@ -272,7 +272,7 @@ sub handler { my $safecount=0; while (($next) && ($next!~/\,/) && ((!$hash{'src_'.$next}) || - ((!$ENV{'request.role.adv'}) && $hash{'randomout_'.$next})) + ((!$env{'request.role.adv'}) && $hash{'randomout_'.$next})) && ($safecount<10000)) { ($next,$endupmap)=&move($next,$endupmap,$direction); $safecount++; @@ -329,10 +329,10 @@ sub handler { &Apache::lonnet::linklog($redirecturl,$currenturl); } # ------------------------------------------------- Check for critical messages - if ((time-$ENV{'user.criticalcheck.time'})>300) { + if ((time-$env{'user.criticalcheck.time'})>300) { my @what=&Apache::lonnet::dump - ('critical',$ENV{'user.domain'}, - $ENV{'user.name'}); + ('critical',$env{'user.domain'}, + $env{'user.name'}); if ($what[0]) { if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) { @@ -394,7 +394,7 @@ ENDNONE } } else { # ------------------------------------------------- Problem, could not tie hash - $ENV{'user.error.msg'}="/adm/flip:bre:0:1:Course Data Missing"; + $env{'user.error.msg'}="/adm/flip:bre:0:1:Course Data Missing"; return HTTP_NOT_ACCEPTABLE; } } else { @@ -406,7 +406,7 @@ ENDNONE } } else { # -------------------------- Class was not initialized or page fliped strangely - $ENV{'user.error.msg'}="/adm/flip:bre:0:0:Choose Course"; + $env{'user.error.msg'}="/adm/flip:bre:0:0:Choose Course"; return HTTP_NOT_ACCEPTABLE; } }