--- rat/lonpageflip.pm 2005/08/02 20:51:18 1.54 +++ rat/lonpageflip.pm 2005/11/15 18:39:45 1.60 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.54 2005/08/02 20:51:18 albertel Exp $ +# $Id: lonpageflip.pm,v 1.60 2005/11/15 18:39:45 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,10 +73,14 @@ sub fullmove { sub hash_src { my ($id)=@_; + my ($mapid,$resid)=split(/\./,$id); + my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid}, + $resid,$hash{'src_'.$id}); if ($hash{'encrypted_'.$id}) { - return &Apache::lonenc::encrypted($hash{'src_'.$id}); + return (&Apache::lonenc::encrypted($hash{'src_'.$id}), + &Apache::lonenc::encrypted($symb)); } - return $hash{'src_'.$id}; + return ($hash{'src_'.$id},$symb); } sub move { @@ -189,7 +193,7 @@ sub navlaunch { this.document.location='/adm/navmaps?turningOffExternal'; } -

Collapse External Navigation Window

+

Collapse external navigation window

ENDNAV $r->print(&Apache::loncommon::endbodytag().''); } @@ -209,7 +213,7 @@ sub handler { my %cachehash=(); my $multichoice=0; my %multichoicehash=(); - my $redirecturl=''; + my ($redirecturl,$redirectsymb); my $next=''; my @possibilities=(); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['postdata']); @@ -252,13 +256,13 @@ sub handler { if ($hash{'encrypted_'.$id}) { $newloc=&Apache::lonenc::encrypted($newloc); } } else { - $newloc='/adm/noidea.html'; + $newloc='/adm/navmaps'; } untie %hash; } else { - $newloc='/adm/noidea.html'; + $newloc='/adm/navmaps'; } - if ($newloc eq '/adm/noidea.html' && $direction eq 'navlaunch') { + if ($newloc eq '/adm/navmaps' && $direction eq 'navlaunch') { &navlaunch($r); return OK; } else { @@ -328,7 +332,7 @@ sub handler { @possibilities=split(/\,/,$next); if ($#possibilities==0) { # ---------------------------------------------- Only one possibility, redirect - $redirecturl=&hash_src($next); + ($redirecturl,$redirectsymb)=&hash_src($next); $cachehash{$endupmap}{$redirecturl}= [$redirecturl,(split(/\./,$next))[1]]; } else { @@ -382,31 +386,44 @@ sub handler { if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) { $redirecturl='/adm/email?critical=display'; + $redirectsymb=''; } } &Apache::lonnet::appenv('user.criticalcheck.time'=>time); } &Apache::loncommon::content_type($r,'text/html'); - $r->header_out(Location => - 'http://'.$ENV{'HTTP_HOST'}.$redirecturl); + my $url='http://'.$ENV{'HTTP_HOST'}.$redirecturl; + if ($redirectsymb ne '') { $url.='?symb='.&Apache::lonnet::escape($redirectsymb); } + $r->header_out(Location => $url); return REDIRECT; } else { # --------------------------------------------------------- There was a problem &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; + my %lt=&Apache::lonlocal::texthash('title' => 'End of Sequence', + 'explain' => + 'You have reached the end of the sequence of materials.', + 'back' => 'Go Back', + 'nav' => 'Navigate Course Content', + 'wherenext' => + 'There are several possibilities of where to go next', + 'pick' => + 'Please click on the the resource you intend to access', + 'titleheader' => 'Title', + 'type' => 'Type'); if ($#possibilities>0) { my $bodytag= &Apache::loncommon::bodytag('Multiple Resources'); $r->print(<Choose Next Location $bodytag -

There are several possibilities of where to go next

+

$lt{'wherenext'}

-Please click on the the resource you intend to access: +$lt{'pick'}:

- + ENDSTART foreach (@possibilities) { $r->print( @@ -417,26 +434,24 @@ ENDSTART ''); } - $r->print('
TitleType
$lt{'titleheader'}$lt{'type'}
'.$multichoicehash{'type_'.$_}. '
'); - return OK; + $r->print(''); } else { my $bodytag=&Apache::loncommon::bodytag('No Resource'); - $r->print(<print(<No Resource $bodytag -

Next resource could not be identified.

-

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

- - - +

$lt{'title'}

+

$lt{'explain'}

ENDNONE - return OK; - } - } + } + $r->print(< +
  • $lt{'back'}
  • +
  • $lt{'nav'}
  • + +ENDMENU + return OK; + } } else { # ------------------------------------------------- Problem, could not tie hash $env{'user.error.msg'}="/adm/flip:bre:0:1:Course Data Missing"; @@ -444,9 +459,6 @@ ENDNONE } } else { # ---------------------------------------- No, could not determine where we are - if ( &Apache::lonnet::mod_perl_version() == 2 ) { - &Apache::lonnet::cleanenv(); - } $r->internal_redirect('/adm/ambiguous'); } } else {