version 1.317, 2006/03/21 20:36:15
|
version 1.319, 2006/03/21 21:49:30
|
Line 2976 Returns a uniform footer for LON-CAPA we
|
Line 2976 Returns a uniform footer for LON-CAPA we
|
Inputs: $title - optional title for the head |
Inputs: $title - optional title for the head |
$head_extra - optional extra HTML to put inside the <head> |
$head_extra - optional extra HTML to put inside the <head> |
$args - optional arguments |
$args - optional arguments |
|
force_register - if is true call registerurl so the remote is |
|
informed |
|
|
redirect - array ref of seconds before redirect occurs |
redirect - array ref of seconds before redirect occurs |
url to redirect to |
url to redirect to |
(side effect of setting |
(side effect of setting |
Line 2992 sub headtag {
|
Line 2995 sub headtag {
|
'<head>'. |
'<head>'. |
&Apache::lonxml::fontsettings(). |
&Apache::lonxml::fontsettings(). |
&Apache::lonhtmlcommon::htmlareaheaders(); |
&Apache::lonhtmlcommon::htmlareaheaders(); |
|
|
|
if ($args->{'force_register'}) { |
|
$result .= &Apache::lonmenu::registerurl(1); |
|
} |
|
|
if (ref($args->{'redirect'})) { |
if (ref($args->{'redirect'})) { |
my ($time,$url) = @{$args->{'redirect'}}; |
my ($time,$url) = @{$args->{'redirect'}}; |
$url = &Apache::lonenc::check_encrypt($url); |
$url = &Apache::lonenc::check_encrypt($url); |
Line 3080 Inputs: $title - optional title for the
|
Line 3087 Inputs: $title - optional title for the
|
|
|
sub start_page { |
sub start_page { |
my ($title,$head_extra,$args) = @_; |
my ($title,$head_extra,$args) = @_; |
|
#&Apache::lonnet::logthis("start_page ".join(':',caller(0))); |
my %head_args; |
my %head_args; |
if (defined($args->{'redirect'})) { |
foreach my $arg ('redirect','force_register') { |
$head_args{'redirect'} = $args->{'redirect'}; |
if (defined($args->{$arg})) { |
|
$head_args{$arg} = $args->{$args}; |
|
} |
} |
} |
|
|
$env{'internal.start_page'}++; |
$env{'internal.start_page'}++; |
my $result = |
my $result = |
&Apache::lonxml::xmlbegin(). |
&Apache::lonxml::xmlbegin(). |
Line 3116 Inputs: $args - additional optio
|
Line 3127 Inputs: $args - additional optio
|
|
|
sub end_page { |
sub end_page { |
my ($args) = @_; |
my ($args) = @_; |
|
#&Apache::lonnet::logthis("end_page ".join(':',caller(0))); |
$env{'internal.end_page'}++; |
$env{'internal.end_page'}++; |
my $result = &endbodytag()."\n</html>"; |
my $result = &endbodytag()."\n</html>"; |
if ($args->{'js_ready'}) { |
if ($args->{'js_ready'}) { |
Line 3138 sub validate_page {
|
Line 3150 sub validate_page {
|
if ( exists($env{'internal.start_page'}) |
if ( exists($env{'internal.start_page'}) |
&& $env{'internal.start_page'} > 1) { |
&& $env{'internal.start_page'} > 1) { |
&Apache::lonnet::logthis('start_page called multiple times '. |
&Apache::lonnet::logthis('start_page called multiple times '. |
|
$env{'internal.start_page'}.' '. |
$ENV{'request.filename'}); |
$ENV{'request.filename'}); |
} |
} |
if ( exists($env{'internal.end_page'}) |
if ( exists($env{'internal.end_page'}) |
&& $env{'internal.end_page'} > 1) { |
&& $env{'internal.end_page'} > 1) { |
&Apache::lonnet::logthis('end_page called multiple times '. |
&Apache::lonnet::logthis('end_page called multiple times '. |
|
$env{'internal.end_page'}.' '. |
$env{'request.filename'}); |
$env{'request.filename'}); |
} |
} |
if ( exists($env{'internal.start_page'}) |
if ( exists($env{'internal.start_page'}) |
Line 3157 sub validate_page {
|
Line 3171 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 OK; |
|
} |
|
return $page; |
|
} |
############################################### |
############################################### |
|
|
=pod |
=pod |