[LON-CAPA-cvs] cvs: rat / lonpageflip.pm

www lon-capa-cvs@mail.lon-capa.org
Sat, 08 Mar 2003 01:39:29 -0000


www		Fri Mar  7 20:39:29 2003 EDT

  Modified files:              
    /rat	lonpageflip.pm 
  Log:
  More informative message when reaching the beginning and the end of the course.
  Also, make error messages text-based.
  
  
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.36 rat/lonpageflip.pm:1.37
--- rat/lonpageflip.pm:1.36	Mon Mar  3 15:24:25 2003
+++ rat/lonpageflip.pm	Fri Mar  7 20:39:29 2003
@@ -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.37 2003/03/08 01:39:29 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -185,6 +185,7 @@
   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 @@
          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';
@@ -331,11 +334,12 @@
                   $r->content_type('text/html');
                   $r->send_http_header;
                   if ($#possibilities>0) {
+		      my $bodytag=
+                             &Apache::loncommon::bodytag('Multiple Resources');
                      $r->print(<<ENDSTART);
 <head><title>Choose Next Location</title></head>
-<body bgcolor="#FFFFFF">
-<h1>LON-CAPA</h1>
-There are several possibilities of where to go next.
+$bodytag
+<h3>There are several possibilities of where to go next</h3>
 <p>
 Please click on the the resource you intend to access:
 <p>
@@ -354,13 +358,17 @@
                      $r->print('</table></body></html>');
 		     return OK;
                   } else {
+		      my $bodytag=&Apache::loncommon::bodytag('No Resource');
                      $r->print(<<ENDNONE);
-<head><title>Choose Next Location</title></head>
-<body bgcolor="#FFFFFF">
-<img src="/adm/lonIcons/lonlogos.gif" align=right>
-<h1>Sorry!</h1>
-<h2>Next resource could not be identified.</h2>
-<h3>You probably are at the beginning or the end of the course.</h3>
+<head><title>No Resource</title></head>
+$bodytag
+<h3>Next resource could not be identified.</h3>
+<p>You probably are at the <b>beginning</b> or the <b>end</b> of the 
+course.</p>
+<ul>
+<li><a href="/adm/flip?postdata=return:">Go Back</a></li>
+<li><a href="/adm/navmaps">Navigate Course Content</a></li>
+</ul>
 </body>
 </html>
 ENDNONE