--- loncom/interface/lonmenu.pm 2004/07/23 19:09:27 1.111 +++ loncom/interface/lonmenu.pm 2004/08/27 17:03:45 1.115 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.111 2004/07/23 19:09:27 albertel Exp $ +# $Id: lonmenu.pm,v 1.115 2004/08/27 17:03:45 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,10 +39,11 @@ package Apache::lonmenu; use strict; -use Apache::lonnet; +use Apache::lonnet(); use Apache::Constants qw(:common); use Apache::lonhtmlcommon(); -use Apache::loncommon; +use Apache::loncommon(); +use Apache::lonnavmaps(); use Apache::lonlocal; use vars qw(@desklines $readdesk); @@ -68,6 +69,11 @@ sub menubuttons { my $forcereg=shift; my $target =shift; my $registration=shift; + + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['inhibitmenu']); + if ($ENV{'form.inhibitmenu'} eq 'yes') { return ''; } + my $navmaps=''; my $reloadlink=''; my $escurl=&Apache::lonnet::escape($ENV{'request.noversionuri'}); @@ -128,11 +134,15 @@ ENDMAINMENU my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); # Do we have a NAV link? if ($ENV{'request.course.id'}) { - $navmaps=(< -$lt{'nav'} -ENDNAVREM - if (($ENV{'request.noversionuri'}=~/^\/adm\//) && + +$lt{'nav'} +ENDNAV + if (($ENV{'request.noversionuri'}=~/^\/adm\//) && ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && ($ENV{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { my $escreload=&Apache::lonnet::escape('return:'); @@ -415,6 +425,7 @@ ENDREGTEXT } else { my $requri=(split(/\?/,$ENV{'request.noversionuri'}))[0]; $requri=&Apache::lonnet::unescape($requri); + my $navstatus=&get_nav_status(); $result = (< @@ -432,6 +443,7 @@ var swmenu=null; swmenu.currentSymb="$ENV{'request.symb'}"; swmenu.reloadSymb="$ENV{'request.symb'}"; swmenu.currentStale=0; + $navstatus $hwkadd $editbutton } @@ -867,12 +879,15 @@ sub utilityfunctions { ($ENV{'environment.remote'} eq 'off')) { return ''; } my $currenturl=$ENV{'request.noversionuri'}; my $currentsymb=$ENV{'request.symb'}; + my $nav_control=&Apache::lonnavmaps::nav_control_js(); return (< ENDSERVERFORM } + +sub get_nav_status { + my $navstatus="swmenu.w_loncapanav_flag="; + if ($ENV{'environment.remotenavmap'} eq 'on') { + $navstatus.="1"; + } else { + $navstatus.="-1"; + } + return $navstatus; +} + # ================================================ Handler when called directly