--- loncom/interface/lonmenu.pm 2006/04/21 20:45:42 1.176 +++ loncom/interface/lonmenu.pm 2006/04/21 22:00:56 1.177 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.176 2006/04/21 20:45:42 albertel Exp $ +# $Id: lonmenu.pm,v 1.177 2006/04/21 22:00:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,22 +64,6 @@ 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 { @@ -320,18 +304,26 @@ sub innerregister { my $textual=($textinter || $noremote); - @inlineremote=(); - undef @inlineremote; + undef(@inlineremote); my $reopen=&Apache::lonmenu::reopenmenu(); - my ($font,$pgbg,$tabbg) = &get_colors(); - my $newmail=''; if ($noremote) { - $newmail='
'; + $newmail=''; } - if (($textual) && ($env{'request.symb'}) && ($env{'request.course.id'})) { + if (&Apache::lonmsg::newmail()) { + if ($textual) { + $newmail.= ''; + } else { + $newmail= 'swmenu.setstatus("you have","messages");'; + } + } elsif (($textual) + && ($env{'request.symb'}) + && ($env{'request.course.id'})) { + $newmail.= ''; } if ($env{'request.state'} eq 'construct') { $newmail = $titletable; } else { if ($noremote) { - $newmail.='
+ '. + &mt('You have new messages').''; my ($mapurl,$rid,$resurl)= &Apache::lonnet::decode_symb(&Apache::lonnet::symbread()); $newmail.=$env{'course.'.$env{'request.course.id'}.'.description'}; @@ -343,23 +335,19 @@ sub innerregister { if ($restitle) { $newmail.=': '.$restitle; } - $newmail.='   '; - } - if (&Apache::lonmsg::newmail()) { - $newmail=($textual? - 'You have new messages
': - 'swmenu.setstatus("you have","messages");'); + $newmail.='   
'; + $newmail.='
'; } } my $timesync=($textual?'':'swmenu.syncclock(1000*'.time.');'); - my $tablestart=($noremote?'':'').($textinter?'
'.&mt('Skip to Content').'
':''); - my $tableend=($noremote?'
':'').($textinter?'':''); + my $tablestart=($noremote?'':''). + ($textinter?'
'.&mt('Skip to Content').'
':''); + my $tableend=($noremote?'
':'').($textinter?'':''); # ============================================================================= # ============================ This is for URLs that actually can be registered if (($env{'request.noversionuri'}!~m|^/(res/)*adm/|) || ($forcereg)) { @@ -814,8 +802,6 @@ sub switch { $desc=&mt($desc); $img=&mt($img); - my ($font,$pgbg,$tabbg) = &get_colors(); - unless (($env{'browser.interface'} eq 'textual') || ($env{'environment.remote'} eq 'off')) { # Remote @@ -842,34 +828,33 @@ sub switch { my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'}; if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; } my $pic= - ''.$text.''; - if (($env{'browser.interface'} eq 'textual') || ($env{'browser.interface'} eq 'faketextual')) { + if ($env{'browser.interface'} eq 'faketextual') { # Accessibility if ($nobreak==3) { $inlineremote[10*$row+$col]="\n". - ''.$text. - ''. + ''.$text. + ''. ''.$pic.''; } elsif ($nobreak) { $inlineremote[10*$row+$col]="\n". - ''. - ''.$pic. - ''.$text.''; + ''. + ''.$pic.' + '.$text.''; } else { $inlineremote[10*$row+$col]="\n". - ''. + ''. ''.$pic. - ''.$desc. - ''; + ''. + $desc.''; } } else { # Inline Menu $inlineremote[10*$row+$col]= ''.$pic. - ''.$desc. - ''; + ''.$desc.''; } } return '';