version 1.320, 2006/03/23 23:43:13
|
version 1.327, 2006/04/07 21:56:00
|
Line 58 use strict;
|
Line 58 use strict;
|
use Apache::lonnet; |
use Apache::lonnet; |
use GDBM_File; |
use GDBM_File; |
use POSIX qw(strftime mktime); |
use POSIX qw(strftime mktime); |
use Apache::Constants qw(:common :http :methods); |
|
use Apache::lonmenu(); |
use Apache::lonmenu(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use HTML::Entities; |
use HTML::Entities; |
Line 2737 Inputs:
|
Line 2736 Inputs:
|
=item * $forcereg, if page should register as content page (relevant for |
=item * $forcereg, if page should register as content page (relevant for |
text interface only) |
text interface only) |
|
|
=item * $customtitle, overrides the $title in some way ???? |
=item * $customtitle, alternate text to use instead of $title |
|
in the title box that appears, this text |
|
is not auto translated like the $title is |
|
|
=item * $notopbar, if true, keep the 'what is this' info but remove the |
=item * $notopbar, if true, keep the 'what is this' info but remove the |
navigational links |
navigational links |
Line 2801 form, .inline { display: inline; }
|
Line 2802 form, .inline { display: inline; }
|
style="margin-top: 0px;$addstyle" $addentries> |
style="margin-top: 0px;$addstyle" $addentries> |
END |
END |
&Apache::lontexconvert::jsMath_reset(); |
&Apache::lontexconvert::jsMath_reset(); |
if ($env{'environment.texengine'} eq 'jsMath') { |
if ($env{'environment.texengine'} eq 'jsMath' || |
|
$env{'form.texengine'} eq 'jsMath' ) { |
$bodytag.=&Apache::lontexconvert::jsMath_header(); |
$bodytag.=&Apache::lontexconvert::jsMath_header(); |
} |
} |
|
|
Line 3006 sub headtag {
|
Line 3008 sub headtag {
|
$env{'internal.head.redirect'} = $url; |
$env{'internal.head.redirect'} = $url; |
$result.=<<ADDMETA |
$result.=<<ADDMETA |
<meta http-equiv="pragma" content="no-cache" /> |
<meta http-equiv="pragma" content="no-cache" /> |
<meta HTTP-EQUIV="Refresh" CONTENT="2; url=$url" /> |
<meta HTTP-EQUIV="Refresh" CONTENT="$time; url=$url" /> |
ADDMETA |
ADDMETA |
} |
} |
if (!defined($title)) { |
if (!defined($title)) { |
Line 3014 ADDMETA
|
Line 3016 ADDMETA
|
} |
} |
|
|
$result .= '<title> LON-CAPA '.&mt($title).'</title>'.$head_extra; |
$result .= '<title> LON-CAPA '.&mt($title).'</title>'.$head_extra; |
|
|
return $result; |
return $result; |
} |
} |
|
|
Line 3051 Inputs: $title - optional title for the
|
Line 3052 Inputs: $title - optional title for the
|
=cut |
=cut |
|
|
sub head { |
sub head { |
my ($title,$head_extra) = @_; |
my ($title,$head_extra,$args) = @_; |
return &headtag($title,$head_extra).&endheadtag(); |
return &headtag($title,$head_extra,$args).&endheadtag(); |
} |
} |
|
|
=pod |
=pod |
Line 3082 Inputs: $title - optional title for the
|
Line 3083 Inputs: $title - optional title for the
|
a html attribute |
a html attribute |
force_register -> if is true will turn on the &bodytag() |
force_register -> if is true will turn on the &bodytag() |
$forcereg arg |
$forcereg arg |
|
body_title -> alternate text to use instead of $title |
|
in the title box that appears, this text |
|
is not auto translated like the $title is |
|
|
=back |
=back |
|
|
Line 3093 sub start_page {
|
Line 3097 sub start_page {
|
my %head_args; |
my %head_args; |
foreach my $arg ('redirect','force_register') { |
foreach my $arg ('redirect','force_register') { |
if (defined($args->{$arg})) { |
if (defined($args->{$arg})) { |
$head_args{$arg} = $args->{$args}; |
$head_args{$arg} = $args->{$arg}; |
} |
} |
} |
} |
|
|
Line 3104 sub start_page {
|
Line 3108 sub start_page {
|
&bodytag($title, |
&bodytag($title, |
$args->{'function'}, $args->{'add_entries'}, |
$args->{'function'}, $args->{'add_entries'}, |
$args->{'only_body'}, $args->{'domain'}, |
$args->{'only_body'}, $args->{'domain'}, |
$args->{'force_register'}, undef, |
$args->{'force_register'}, $args->{'body_title'}, |
$args->{'no_nav_bar'}, $args->{'bgcolor'}); |
$args->{'no_nav_bar'}, $args->{'bgcolor'}); |
if ($args->{'js_ready'}) { |
if ($args->{'js_ready'}) { |
$result = &js_ready($result); |
$result = &js_ready($result); |
Line 3149 sub end_page {
|
Line 3153 sub end_page {
|
sub html_encode { |
sub html_encode { |
my ($result) = @_; |
my ($result) = @_; |
|
|
$result = &HTML::Entities::encode($result,'"'); |
$result = &HTML::Entities::encode($result,'<>&"'); |
|
|
return $result; |
return $result; |
} |
} |
sub js_ready { |
sub js_ready { |
my ($result) = @_; |
my ($result) = @_; |
|
|
$result =~ s/[\n\r]/ /g; |
$result =~ s/[\n\r]/ /xmsg; |
$result =~ s/'/\\'/g; |
$result =~ s/\\/\\\\/xmsg; |
|
$result =~ s/'/\\'/xmsg; |
|
$result =~ s{</script>}{</scrip'+'t>}xmsg; |
|
|
return $result; |
return $result; |
} |
} |
Line 3195 sub simple_error_page {
|
Line 3201 sub simple_error_page {
|
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
if (ref($r)) { |
if (ref($r)) { |
$r->print($page); |
$r->print($page); |
return OK; |
return; |
} |
} |
return $page; |
return $page; |
} |
} |