--- loncom/interface/lonmenu.pm 2006/04/20 04:22:38 1.175 +++ loncom/interface/lonmenu.pm 2006/05/08 22:30:56 1.179 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.175 2006/04/20 04:22:38 albertel Exp $ +# $Id: lonmenu.pm,v 1.179 2006/05/08 22:30: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 { @@ -101,7 +85,7 @@ sub menubuttons { my $showgroups=0; my $escurl=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'})); my $escsymb=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.symb'})); - my $face= 'face="Arial,Helvetica,sans-serif"'; + if ($env{'request.state'} eq 'construct') { if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) { my $returnurl = $env{'request.filename'}; @@ -121,8 +105,6 @@ sub menubuttons { } } - my ($font,$pgbg,$tabbg) = &get_colors(); - if ($env{'browser.interface'} eq 'textual') { # Textual display only if ($env{'request.course.id'}) { @@ -134,18 +116,17 @@ ENDNAV ($env{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { my $escreload=&Apache::lonnet::escape('return:'); $reloadlink=(<$lt{'ret'} +$lt{'ret'} ENDRELOAD } if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { $docs=(<$lt{'docs'} +$lt{'docs'} ENDDOCS } if ($showgroups) { $groups =(< -$lt{'groups'} +$lt{'groups'} ENDGROUPS } } @@ -156,10 +137,12 @@ ENDGROUPS // BEGIN LON-CAPA Internal $utility +
$lt{'main'} $reloadlink $navmaps $docs $groups -$lt{'roles'} -$lt{'exit'} +$lt{'roles'} +$lt{'exit'} +

- +
- + $reloadlink $navmaps $docs $groups - - - - +$remote + + +
-$lt{'main'} -$lt{'main'} - -$lt{'launch'} -$lt{'roles'} - -$lt{'exit'} - -Logo -LON-CAPA$lt{'roles'}$lt{'exit'}LogoLON-CAPA
$form @@ -337,18 +307,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'}; @@ -360,23 +338,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)) { @@ -510,7 +484,6 @@ s&8&2&fdbk.gif&feedback[_1]&discuss[_1]& ENDREALRES } } - &Apache::lonnet::logthis("menuitems $menuitems"); my $buttons=''; foreach (split(/\n/,$menuitems)) { my ($command,@rest)=split(/\&/,$_); @@ -832,8 +805,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 @@ -860,34 +831,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 '';