--- loncom/interface/lonmenu.pm 2006/04/07 22:28:40 1.171 +++ loncom/interface/lonmenu.pm 2006/04/10 18:49:56 1.172 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.171 2006/04/07 22:28:40 albertel Exp $ +# $Id: lonmenu.pm,v 1.172 2006/04/10 18:49:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,9 +49,6 @@ use vars qw(@desklines $readdesk); my @inlineremote; -my $font; -my $tabbg; -my $pgbg; # ================================================================ Little texts @@ -67,6 +64,22 @@ sub initlittle { 'groups' => 'Groups'); } +sub get_colors { + my ($font,$pgbg,$tabbg); + if ($env{'browser.interface'} eq 'textual') { + $pgbg='#FFFFFF'; + $tabbg='#FFFFFF'; + $font='#000000'; + } else { + my $domain =&Apache::loncommon::determinedomain(); + my $function =&Apache::loncommon::get_users_function(); + + $pgbg =&Apache::loncommon::designparm($function.'.pgbg', $domain); + $tabbg =&Apache::loncommon::designparm($function.'.tabbg',$domain); + $font =&Apache::loncommon::designparm($function.'.font', $domain); + } + return ($font,$pgbg,$tabbg); +} # ============================= This gets called at the top of the body section sub menubuttons { @@ -106,11 +119,10 @@ sub menubuttons { } } + my ($font,$pgbg,$tabbg) = &get_colors(); + if ($env{'browser.interface'} eq 'textual') { # Textual display only - $pgbg='#FFFFFF'; - $tabbg='#FFFFFF'; - $font='#000000'; if ($env{'request.course.id'}) { $navmaps=(<$lt{'nav'} @@ -158,21 +170,9 @@ ENDMAINMENU # Remote Control is switched off # figure out colors my %lt=&initlittle(); - my $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.noversionuri'}=~/^(\/priv|\~)/)) { - $function='author'; - } + my $domain=&Apache::loncommon::determinedomain(); - $pgbg=&Apache::loncommon::designparm($function.'.pgbg',$domain); - $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); - $font=&Apache::loncommon::designparm($function.'.font',$domain); + my $function =&Apache::loncommon::get_users_function(); my $link=&Apache::loncommon::designparm($function.'.link',$domain); my $alink=&Apache::loncommon::designparm($function.'.alink',$domain); my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain); @@ -329,9 +329,7 @@ sub registerurl { # =========== and in the body of the document sub innerregister { - my $forcereg=shift; - my $target = shift; - my $titletable = shift; + my ($forcereg, $target, $titletable) = @_; my $result = ''; my ($uname,$thisdisfn); my $const_space = ($env{'request.state'} eq 'construct'); @@ -351,6 +349,8 @@ sub innerregister { my $reopen=&Apache::lonmenu::reopenmenu(); + my ($font,$pgbg,$tabbg) = &get_colors(); + my $newmail=''; if ($noremote) { $newmail='
'; @@ -837,6 +837,9 @@ sub switch { $bot=&mt($bot); $desc=&mt($desc); $img=&mt($img); + + my ($font,$pgbg,$tabbg) = &get_colors(); + unless (($env{'browser.interface'} eq 'textual') || ($env{'environment.remote'} eq 'off')) { # Remote