--- loncom/interface/loncommon.pm 2002/08/20 21:29:34 1.54 +++ loncom/interface/loncommon.pm 2002/08/21 17:18:08 1.55 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.54 2002/08/20 21:29:34 www Exp $ +# $Id: loncommon.pm,v 1.55 2002/08/21 17:18:08 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1195,7 +1195,20 @@ sub findallcourses { ############################################### sub bodytag { - my ($function,$title,$addentries)=@_; + my ($title,$function,$addentries)=@_; + unless ($function) { + $function='student'; + if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) { + $function='coordinator'; + } + if ($ENV{'request.role'}=~/^(su|dc|ad|li)/) { + $function='admin'; + } + if (($ENV{'request.role'}=~/^(au|ca)/) || + ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) { + $function='author'; + } + } my $img=''; my $pgbg=''; my $tabbg=''; @@ -1214,49 +1227,61 @@ sub bodytag { $img='coordinator'; $pgbg='#CCFFFF'; $tabbg='#CCCCFF'; - $font='#000033'; + $font='#000044'; $link='#003333'; $vlink='#006633'; } elsif ($function eq 'author') { $img='author'; $pgbg='#CCFFFF'; $tabbg='#CCFFCC'; - $font='#003300'; + $font='#004400'; $link='#003333'; $vlink='#006666'; } else { $img='student'; - $pgbg='#FFFF99'; + $pgbg='#FFFFAA'; $tabbg='#FF9900'; $font='#991100'; $link='#993300'; $vlink='#996600'; } - my $role=&Apache::lonnet::plaintext((split(/\./,$ENV{'request.role'}))[0]); +# role and realm + my ($role,$realm) + =&Apache::lonnet::plaintext((split(/\./,$ENV{'request.role'}))[0]); +# realm if ($ENV{'request.course.id'}) { - $role.='
'.$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; + $realm= + $ENV{'course.'.$ENV{'request.course.id'}.'.description'}; } + unless ($realm) { $realm=' '; } +# Set messages + my $messages=localtime(); +# Output return(< - - +
-
+ + + - + +
+$messages
-$title +$title $ENV{'environment.firstname'} $ENV{'environment.middlename'} $ENV{'environment.lastname'} $ENV{'environment.generation'} - +  
-$role +$role 
$realm 

ENDBODY }