--- loncom/interface/loncommon.pm 2006/03/21 20:36:15 1.317
+++ loncom/interface/loncommon.pm 2006/04/13 19:01:25 1.332
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.317 2006/03/21 20:36:15 albertel Exp $
+# $Id: loncommon.pm,v 1.332 2006/04/13 19:01:25 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -58,7 +58,6 @@ use strict;
use Apache::lonnet;
use GDBM_File;
use POSIX qw(strftime mktime);
-use Apache::Constants qw(:common :http :methods);
use Apache::lonmenu();
use Apache::lonlocal;
use HTML::Entities;
@@ -721,8 +720,18 @@ sub help_open_menu {
"
$text";
}
my $nothing=&Apache::lonhtmlcommon::javascript_nothing();
- my $html=&Apache::lonxml::xmlbegin();
my $helpicon=&lonhttpdurl("/adm/lonIcons/helpgateway.gif");
+ my $start_page =
+ &Apache::loncommon::start_page('Help Menu', undef,
+ {'frameset' => 1,
+ 'js_ready' => 1,
+ 'add_entries' => {
+ 'border' => '0',
+ 'rows' => "105,*",},});
+ my $end_page =
+ &Apache::loncommon::end_page({'frameset' => 1,
+ 'js_ready' => 1,});
+
$template .= <<"ENDTEMPLATE";
}{}xmsg;
return $result;
}
@@ -3138,11 +3222,13 @@ sub validate_page {
if ( exists($env{'internal.start_page'})
&& $env{'internal.start_page'} > 1) {
&Apache::lonnet::logthis('start_page called multiple times '.
+ $env{'internal.start_page'}.' '.
$ENV{'request.filename'});
}
if ( exists($env{'internal.end_page'})
&& $env{'internal.end_page'} > 1) {
&Apache::lonnet::logthis('end_page called multiple times '.
+ $env{'internal.end_page'}.' '.
$env{'request.filename'});
}
if ( exists($env{'internal.start_page'})
@@ -3157,6 +3243,18 @@ sub validate_page {
}
}
+sub simple_error_page {
+ my ($r,$title,$msg) = @_;
+ my $page =
+ &Apache::loncommon::start_page($title).
+ &mt($msg).
+ &Apache::loncommon::end_page();
+ if (ref($r)) {
+ $r->print($page);
+ return;
+ }
+ return $page;
+}
###############################################
=pod
@@ -3641,8 +3739,22 @@ sub get_posted_cgi {
}
}
}
+#
+# Digested POSTed values
+#
+# Remember the way this was originally done (GET or POST)
+#
$env{'request.method'}=$ENV{'REQUEST_METHOD'};
- $r->method_number(M_GET);
+#
+# There may also be stuff in the query string
+# Tell subsequent handlers that this was GET, not POST, so they can access query string.
+# Also, unset POSTed content length to cover all tracks.
+#
+
+# This does not work, because M_GET is not defined (if it's defined, it is just 0).
+# Commenting out for now ... not sure if harm is done.
+# $r->method_number(M_GET);
+
$r->method('GET');
$r->headers_in->unset('Content-length');
}
|