--- loncom/interface/lonmenu.pm 2003/04/03 03:08:12 1.50 +++ loncom/interface/lonmenu.pm 2003/04/18 00:02:34 1.62 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.50 2003/04/03 03:08:12 www Exp $ +# $Id: lonmenu.pm,v 1.62 2003/04/18 00:02:34 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -45,6 +45,10 @@ use Apache::lonhtmlcommon(); use Apache::loncommon; use Apache::File; use vars qw(@desklines $readdesk); +my @inlineremote; +my $font; +my $tabbg; +my $pgbg; # ============================= This gets called at the top of the body section @@ -52,13 +56,31 @@ sub menubuttons { my $forcereg=shift; my $target =shift; my $registration=shift; + my $navmaps=''; + my $reloadlink=''; + my $escurl=&Apache::lonnet::escape($ENV{'REQUEST_URI'}); + my $escsymb=&Apache::lonnet::escape($ENV{'request.symb'}); if ($ENV{'browser.interface'} eq 'textual') { # Textual display only + if ($ENV{'request.course.id'}) { + $navmaps=(<Navigate Contents +ENDNAV + if (($ENV{'REQUEST_URI'}=~/^\/adm\//) && + ($ENV{'REQUEST_URI'}!~/^\/adm\/wrapper\//) && + ($ENV{'REQUEST_URI'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { + my $escreload=&Apache::lonnet::escape('return:'); + $reloadlink=(<Return to Last Location +ENDRELOAD + } + } my $output=(< // BEGIN LON-CAPA Internal -Main Menu
+Main Menu +$reloadlink $navmaps
@@ -67,18 +89,67 @@ ENDMAINMENU return $output."
"; } elsif ($ENV{'environment.remote'} eq 'off') { # Remote Control is switched off - my $output=(< +Navigate Contents +ENDNAVREM + if (($ENV{'REQUEST_URI'}=~/^\/adm\//) && + ($ENV{'REQUEST_URI'}!~/^\/adm\/wrapper\//) && + ($ENV{'REQUEST_URI'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { + my $escreload=&Apache::lonnet::escape('return:'); + $reloadlink=(< +Return to Last Location +ENDRELOAD + } + } + my $reg=''; + if ($registration) { + $reg=&innerregister($forcereg,$target); + } + return (< // BEGIN LON-CAPA Internal -Main Menu -Launch Remote Control + + + +$reloadlink +$navmaps + + +
+Main Menu + + +Launch Remote Control
+$reg ENDINLINEMENU - if ($registration) { $output.=&innerregister($forcereg,$target); } - return $output."
"; } else { return ''; } @@ -98,6 +169,7 @@ sub registerurl { "\n\n"; } if (($ENV{'browser.interface'} eq 'textual') || + ($ENV{'environment.remote'} eq 'off') || ((($ENV{'request.publicaccess'}) || (!&Apache::lonnet::is_on_map($ENV{'REQUEST_URI'}))) && (!$forcereg))) { @@ -125,15 +197,33 @@ sub innerregister { my $textual=($textinter || $noremote); + @inlineremote=(); + undef @inlineremote; + my $reopen=&Apache::lonmenu::reopenmenu(); my $newmail=''; + if (($textual) && ($ENV{'request.symb'}) && ($ENV{'request.course.id'})) { + my ($mapurl,$rid,$resurl)=split(/\_\_\_/,$ENV{'request.symb'}); + $newmail=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; + my $maptitle=&Apache::lonnet::gettitle($mapurl); + my $restitle=&Apache::lonnet::gettitle($resurl); + if ($maptitle) { + $newmail.=', '.$maptitle; + } + if ($restitle) { + $newmail.=': '.$restitle; + } + $newmail.='   '; + } if (&Apache::lonmsg::newmail()) { $newmail=($textual? 'You have new messages
': 'swmenu.setstatus("you have","messages");'); } my $timesync=($textual?'':'swmenu.syncclock(1000*'.time.');'); + my $tablestart=($noremote?'':''); + my $tableend=($noremote?'
':''); # ============================================================================= # ============================ This is for URLs that actually can be registered if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) { @@ -218,7 +308,7 @@ sub innerregister { my $menuitems=(< // BEGIN LON-CAPA Internal @@ -247,9 +339,9 @@ $utility $timesync $newmail -$buttons -$hwkadd -$editbutton +$tablestart +$inlinebuttons +$tableend $form