--- rat/lonpageflip.pm 2003/03/03 20:24:25 1.36 +++ rat/lonpageflip.pm 2003/08/15 14:49:26 1.40 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.36 2003/03/03 20:24:25 www Exp $ +# $Id: lonpageflip.pm,v 1.40 2003/08/15 14:49:26 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -185,6 +185,7 @@ sub handler { my $redirecturl=''; 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+)\:(.*)/; my $direction=$1; @@ -200,10 +201,12 @@ sub handler { my $newloc; if (($last) && (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', &GDBM_READER(),0640))) { - my ($murl,$mid,$fn)=split(/\_\_\_/,$last); - $newloc=$hash{'src_'. - $hash{'map_pc_'.&Apache::lonnet::clutter($murl)}. - '.'.$mid}; + my ($murl,$fn)=split(/\_\_\_/,$last); + my $id; + ($murl,$id,$fn)=split(/\_\_\_/,&Apache::lonnet::symbread($fn)); + $newloc=$hash{'src_'. + $hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id}; + unless ($newloc) { $newloc='/adm/noidea.html'; } untie %hash; } else { $newloc='/adm/noidea.html'; @@ -308,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 @@ -331,11 +340,12 @@ sub handler { $r->content_type('text/html'); $r->send_http_header; if ($#possibilities>0) { + my $bodytag= + &Apache::loncommon::bodytag('Multiple Resources'); $r->print(<Choose Next Location - -

LON-CAPA

-There are several possibilities of where to go next. +$bodytag +

There are several possibilities of where to go next

Please click on the the resource you intend to access:

@@ -354,13 +364,17 @@ ENDSTART $r->print(''); return OK; } else { + my $bodytag=&Apache::loncommon::bodytag('No Resource'); $r->print(<Choose Next Location - - -

Sorry!

-

Next resource could not be identified.

-

You probably are at the beginning or the end of the course.

+No Resource +$bodytag +

Next resource could not be identified.

+

You probably are at the beginning or the end of the +course.

+ ENDNONE