version 1.303, 2006/02/18 01:27:07
|
version 1.314, 2006/03/19 22:48:53
|
Line 2737 Inputs:
|
Line 2737 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 * $notopbar, if true, keep the 'what is this' info but remove the |
|
navigational links |
=back |
=back |
|
|
Returns: A uniform header for LON-CAPA web pages. |
Returns: A uniform header for LON-CAPA web pages. |
Line 2747 other decorations will be returned.
|
Line 2751 other decorations will be returned.
|
=cut |
=cut |
|
|
sub bodytag { |
sub bodytag { |
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,$customtitle,$notopbar)=@_; |
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,$customtitle, |
|
$notopbar)=@_; |
$title=&mt($title); |
$title=&mt($title); |
$function = &get_users_function() if (!$function); |
$function = &get_users_function() if (!$function); |
my $img=&designparm($function.'.img',$domain); |
my $img=&designparm($function.'.img',$domain); |
Line 2787 table.thinborder { border-collapse: coll
|
Line 2792 table.thinborder { border-collapse: coll
|
table.thinborder tr th, table.thinborder tr td { border-style: solid; border-width: 1px} |
table.thinborder tr th, table.thinborder tr td { border-style: solid; border-width: 1px} |
form, .inline { display: inline; } |
form, .inline { display: inline; } |
.center { text-align: center; } |
.center { text-align: center; } |
|
.filename {font-family: monospace;} |
</style> |
</style> |
<body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link" |
<body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link" |
style="margin-top: 0px;$addstyle" $addentries> |
style="margin-top: 0px;$addstyle" $addentries> |
Line 2892 ENDROLE
|
Line 2898 ENDROLE
|
$dc_info.= $cid.' '.$env{'course.'.$cid.'.internal.coursecode'}; |
$dc_info.= $cid.' '.$env{'course.'.$cid.'.internal.coursecode'}; |
$dc_info = '('.$dc_info.')'; |
$dc_info = '('.$dc_info.')'; |
} |
} |
|
# Explicit link to get inline menu |
|
my $menu='<br /><font size="2" face="Arial, Helvetica, sans-serif"> <a href="/adm/remote?action=collapse">'.&mt('Switch to Inline Menu Mode').'</a></font>'; |
# |
# |
return(<<ENDBODY); |
return(<<ENDBODY); |
$bodytag |
$bodytag |
Line 2902 $upperleft</td>
|
Line 2910 $upperleft</td>
|
</tr> |
</tr> |
<tr> |
<tr> |
<td rowspan="3" bgcolor="$tabbg"> |
<td rowspan="3" bgcolor="$tabbg"> |
$titleinfo $dc_info |
$titleinfo $dc_info $menu |
</td><td bgcolor="$tabbg" align="right"> |
</td><td bgcolor="$tabbg" align="right"> |
<font size="2" face="Arial, Helvetica, sans-serif"> |
<font size="2" face="Arial, Helvetica, sans-serif"> |
$env{'environment.firstname'} |
$env{'environment.firstname'} |
Line 2928 ENDBODY
|
Line 2936 ENDBODY
|
|
|
=back |
=back |
|
|
=head1 HTTP Helpers |
=head1 HTML Helpers |
|
|
=over 4 |
=over 4 |
|
|
Line 2936 ENDBODY
|
Line 2944 ENDBODY
|
|
|
Returns a uniform footer for LON-CAPA web pages. |
Returns a uniform footer for LON-CAPA web pages. |
|
|
Inputs: |
Inputs: none |
|
|
=over 4 |
|
|
|
=back |
=back |
|
|
Returns: A uniform footer for LON-CAPA web pages. |
|
|
|
=cut |
=cut |
|
|
sub endbodytag { |
sub endbodytag { |
Line 2952 sub endbodytag {
|
Line 2956 sub endbodytag {
|
return $endbodytag; |
return $endbodytag; |
} |
} |
|
|
|
=pod |
|
|
|
=over 4 |
|
|
|
=item * &headtag() |
|
|
|
Returns a uniform footer for LON-CAPA web pages. |
|
|
|
Inputs: $title - optional title for the head |
|
$head_extra - optional extra HTML to put inside the <head> |
|
|
|
=back |
|
|
|
=cut |
|
|
|
sub headtag { |
|
my ($title,$head_extra,$args) = @_; |
|
|
|
my $result = |
|
'<head>'. |
|
&Apache::lonxml::fontsettings(). |
|
&Apache::lonhtmlcommon::htmlareaheaders(); |
|
|
|
if (ref($args->{'redirect'})) { |
|
my ($time,$url) = @{$args->{'redirect'}}; |
|
$result.=<<ADDMETA |
|
<meta http-equiv="pragma" content="no-cache" /> |
|
<meta HTTP-EQUIV="Refresh" CONTENT="2; url=$url" /> |
|
ADDMETA |
|
} |
|
if (!defined($title)) { |
|
$title = 'The LearningOnline Network with CAPA'; |
|
} |
|
|
|
$result .= '<title>'.&mt($title).'</title>'.$head_extra; |
|
|
|
return $result; |
|
} |
|
|
|
=pod |
|
|
|
=over 4 |
|
|
|
=item * &endheadtag() |
|
|
|
Returns a uniform </head> for LON-CAPA web pages. |
|
|
|
Inputs: none |
|
|
|
=back |
|
|
|
=cut |
|
|
|
sub endheadtag { |
|
return '</head>'; |
|
} |
|
|
|
=pod |
|
|
|
=over 4 |
|
|
|
=item * &head() |
|
|
|
Returns a uniform complete <head>..</head> section for LON-CAPA web pages. |
|
|
|
Inputs: $title - optional title for the page |
|
$head_extra - optional extra HTML to put inside the <head> |
|
=back |
|
|
|
=cut |
|
|
|
sub head { |
|
my ($title,$head_extra) = @_; |
|
return &headtag($title,$head_extra).&endheadtag(); |
|
} |
|
|
|
=pod |
|
|
|
=over 4 |
|
|
|
=item * &start_page() |
|
|
|
Returns a complete <html> .. <body> section for LON-CAPA web pages. |
|
|
|
Inputs: $title - optional title for the page |
|
$head_extra - optional extra HTML to incude inside the <head> |
|
%args - additional optional args supported are: |
|
only_body -> is true will set &bodytag() onlybodytag arg on |
|
no_nav_bar -> is true will set &bodytag() notopbar arg on |
|
add_entries -> additional attributes to add to the <body> |
|
domain -> force to color decorate a page for a |
|
specific domain |
|
function -> force usage of a specific rolish color scheme |
|
redirect -> ... |
|
|
|
=back |
|
|
|
=cut |
|
|
|
sub start_page { |
|
my ($title,$head_extra,$args) = @_; |
|
my %head_args; |
|
if (defined($args->{'redirect'})) { |
|
$head_args{'redirect'} = $args->{'redirect'}; |
|
} |
|
|
|
return |
|
&Apache::lonxml::xmlbegin(). |
|
&headtag($title,$head_extra,\%head_args).&endheadtag(). |
|
&bodytag($title, $args->{'function'}, $args->{'add_entries'}, |
|
$args->{'only_body'}, |
|
undef,undef,undef,$args->{'no_nav_bar'}); |
|
} |
|
|
|
=pod |
|
|
|
=over 4 |
|
|
|
=item * &head() |
|
|
|
Returns a complete </body></html> section for LON-CAPA web pages. |
|
|
|
Inputs: None |
|
|
|
=back |
|
|
|
=cut |
|
|
|
sub end_page { |
|
return &endbodytag."\n</html>"; |
|
} |
############################################### |
############################################### |
|
|
=pod |
=pod |
|
|
|
=over 4 |
|
|
=item get_users_function |
=item get_users_function |
|
|
Used by &bodytag to determine the current users primary role. |
Used by &bodytag to determine the current users primary role. |