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

www lon-capa-cvs@mail.lon-capa.org
Mon, 27 May 2002 12:04:36 -0000


www		Mon May 27 08:04:36 2002 EDT

  Modified files:              
    /rat	lonpage.pm 
  Log:
  Calls lonsequence for out-of-course-context viewing of maps.
  Bug #165
  
  
Index: rat/lonpage.pm
diff -u rat/lonpage.pm:1.38 rat/lonpage.pm:1.39
--- rat/lonpage.pm:1.38	Mon May 20 22:26:16 2002
+++ rat/lonpage.pm	Mon May 27 08:04:36 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Page Handler
 #
-# $Id: lonpage.pm,v 1.38 2002/05/21 02:26:16 albertel Exp $
+# $Id: lonpage.pm,v 1.39 2002/05/27 12:04:36 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -48,6 +48,7 @@
 use Apache::lonxml();
 use HTML::TokeParser;
 use GDBM_File;
+use Apache::lonsequence;
 
 # -------------------------------------------------------------- Module Globals
 my %hash;
@@ -151,11 +152,14 @@
        $r->send_http_header;
        return OK;
    }
+ 
+   &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+                                          ['forceselect','launch']);
 
   my $requrl=$r->uri;  
   my $target = $ENV{'form.grade_target'};
 # ----------------------------------------------------------------- Tie db file
-  if ($ENV{'request.course.fn'}) {
+  if (($ENV{'request.course.fn'}) && (!$ENV{'form.forceselect'})) {
       my $fn=$ENV{'request.course.fn'};
       if (-e "$fn.db") {
           if (tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER,0640)) {
@@ -467,7 +471,7 @@
               } else {
                   $r->content_type('text/html');
                   $r->send_http_header;
-		  $r->print('<html><body>Page undefined.</body></html>');
+                  &Apache::lonsequence::viewmap($r,$requrl);
               }
 # ------------------------------------------------------------------ Untie hash
               unless (untie(%hash)) {
@@ -480,8 +484,10 @@
           }
       } 
   }
-  $ENV{'user.error.msg'}="$requrl:bre:0:0:Course not initialized";
-  return HTTP_NOT_ACCEPTABLE; 
+  $r->content_type('text/html');
+  $r->send_http_header;
+  &Apache::lonsequence::viewmap($r,$requrl);
+  return OK; 
 }
 
 1;