version 1.351, 2006/04/22 20:58:32
|
version 1.355, 2006/04/25 21:24:06
|
Line 1948 sub plainname {
|
Line 1948 sub plainname {
|
$name=~s/^\s+//; |
$name=~s/^\s+//; |
$name=~s/\s+$//; |
$name=~s/\s+$//; |
$name=~s/\s+/ /g; |
$name=~s/\s+/ /g; |
if ($name !~ /\S/) { $name=$uname.'@'.$udom; } |
if ($name !~ /\S/) { $name=$uname.':'.$udom; } |
return $name; |
return $name; |
} |
} |
|
|
Line 2610 sub maketime {
|
Line 2610 sub maketime {
|
######################################### |
######################################### |
|
|
sub findallcourses { |
sub findallcourses { |
|
my ($roles) = @_; |
|
my %roles; |
|
if (ref($roles)) { %roles = map { $_ => 1 } @{$roles}; } |
my %courses; |
my %courses; |
my $now=time; |
my $now=time; |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ( $key=~m{^user\.role\.(\w+)\./(\w+)/(\w+)} ) { |
if ( $key=~m{^user\.role\.(\w+)\./(\w+)/(\w+)} ) { |
my ($role,$domain,$id) = ($1,$2,$3); |
my ($role,$domain,$id) = ($1,$2,$3); |
next if ($role eq 'ca' || $role eq 'aa'); |
next if ($role eq 'ca' || $role eq 'aa'); |
my ($starttime,$endtime)=$env{$key}; |
next if (%roles && !exists($roles{$role})); |
|
my ($starttime,$endtime)=split(/\./,$env{$key}); |
my $active=1; |
my $active=1; |
if ($starttime) { |
if ($starttime) { |
if ($now<$starttime) { $active=0; } |
if ($now<$starttime) { $active=0; } |
Line 3048 sub endbodytag {
|
Line 3052 sub endbodytag {
|
return $endbodytag; |
return $endbodytag; |
} |
} |
|
|
|
=pod |
|
|
|
=over 4 |
|
|
|
=item * &standard_css() |
|
|
|
Returns a style sheet |
|
|
|
Inputs: (all optional) |
|
domain -> force to color decorate a page for a specific |
|
domain |
|
function -> force usage of a specific rolish color scheme |
|
bgcolor -> override the default page bgcolor |
|
|
|
=back |
|
|
|
=cut |
|
|
sub standard_css { |
sub standard_css { |
my ($function,$domain,$bgcolor) = @_; |
my ($function,$domain,$bgcolor) = @_; |
my $function = &get_users_function() if (!$function); |
$function = &get_users_function() if (!$function); |
my $img = &designparm($function.'.img',$domain); |
my $img = &designparm($function.'.img', $domain); |
my $tabbg = &designparm($function.'.tabbg',$domain); |
my $tabbg = &designparm($function.'.tabbg', $domain); |
my $font = &designparm($function.'.font',$domain); |
my $font = &designparm($function.'.font', $domain); |
my $sidebg = &designparm($function.'.sidebg',$domain); |
my $sidebg = &designparm($function.'.sidebg',$domain); |
my $pgbg = $bgcolor || &designparm($function.'.pgbg',$domain); |
my $pgbg = $bgcolor || |
|
&designparm($function.'.pgbg', $domain); |
my $alink = &designparm($function.'.alink',$domain); |
my $alink = &designparm($function.'.alink', $domain); |
my $vlink = &designparm($function.'.vlink',$domain); |
my $vlink = &designparm($function.'.vlink', $domain); |
my $link = &designparm($function.'.link',$domain); |
my $link = &designparm($function.'.link', $domain); |
my $sans = 'Arial,Helvetica,sans-serif'; |
|
my $data_table_head = $tabbg; |
my $sans = 'Arial,Helvetica,sans-serif'; |
my $data_table_light = '#EEEEEE'; |
my $data_table_head = $tabbg; |
my $data_table_dark = '#DDD'; |
my $data_table_light = '#EEEEEE'; |
|
my $data_table_dark = '#DDD'; |
my $data_table_highlight = '#FFFF00'; |
my $data_table_highlight = '#FFFF00'; |
my $mail_new = '#FFBB77'; |
my $mail_new = '#FFBB77'; |
my $mail_new_hover = '#DD9955'; |
my $mail_new_hover = '#DD9955'; |
my $mail_read = '#BBBB77'; |
my $mail_read = '#BBBB77'; |
my $mail_read_hover = '#999944'; |
my $mail_read_hover = '#999944'; |
my $mail_replied = '#AAAA88'; |
my $mail_replied = '#AAAA88'; |
my $mail_replied_hover = '#888855'; |
my $mail_replied_hover = '#888855'; |
my $mail_other = '#99BBBB'; |
my $mail_other = '#99BBBB'; |
my $mail_other_hover = '#669999'; |
my $mail_other_hover = '#669999'; |
|
|
return <<END; |
return <<END; |
<style type="text/css"> |
<style type="text/css"> |
Line 3217 Inputs: $title - optional title for the
|
Line 3240 Inputs: $title - optional title for the
|
$args - optional arguments |
$args - optional arguments |
force_register - if is true call registerurl so the remote is |
force_register - if is true call registerurl so the remote is |
informed |
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 |
$env{'internal.head.redirect'} to the url |
$env{'internal.head.redirect'} to the url |
redirected too) |
redirected too) |
|
domain -> force to color decorate a page for a specific |
|
domain |
|
function -> force usage of a specific rolish color scheme |
|
bgcolor -> override the default page bgcolor |
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 3231 sub headtag {
|
Line 3259 sub headtag {
|
|
|
my $result = |
my $result = |
'<head>'. |
'<head>'. |
&standard_css(). |
&standard_css($args->{'function'},$args->{'domain'}, |
|
$args->{'bgcolor'}). |
&font_settings(). |
&font_settings(). |
&Apache::lonhtmlcommon::htmlareaheaders(); |
&Apache::lonhtmlcommon::htmlareaheaders(); |
|
|
Line 3398 sub start_page {
|
Line 3427 sub start_page {
|
my ($title,$head_extra,$args) = @_; |
my ($title,$head_extra,$args) = @_; |
#&Apache::lonnet::logthis("start_page ".join(':',caller(0))); |
#&Apache::lonnet::logthis("start_page ".join(':',caller(0))); |
my %head_args; |
my %head_args; |
foreach my $arg ('redirect','force_register') { |
foreach my $arg ('redirect','force_register','domain','function', |
|
'bgcolor') { |
if (defined($args->{$arg})) { |
if (defined($args->{$arg})) { |
$head_args{$arg} = $args->{$arg}; |
$head_args{$arg} = $args->{$arg}; |
} |
} |