--- loncom/interface/lonmenu.pm 2004/08/10 18:05:12 1.112 +++ loncom/interface/lonmenu.pm 2004/10/28 16:25:21 1.118 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.112 2004/08/10 18:05:12 albertel Exp $ +# $Id: lonmenu.pm,v 1.118 2004/10/28 16:25:21 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,7 +69,6 @@ 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 ''; } @@ -96,9 +96,11 @@ ENDNAV ENDRELOAD } } + my $utility=&utilityfunctions(); my $output=(< // BEGIN LON-CAPA Internal +$utility $lt{'main'} $reloadlink $navmaps
@@ -133,11 +135,11 @@ 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:'); @@ -151,9 +153,11 @@ ENDRELOAD if ($registration) { $reg=&innerregister($forcereg,$target); } + my $utility=&utilityfunctions(); return (< // BEGIN LON-CAPA Internal +$utility @@ -384,7 +388,6 @@ ENDREALRES } if ($textual) { # Registered, textual output - my $utility=&utilityfunctions(); my $form=&serverform(); my $inlinebuttons=''; @@ -403,7 +406,6 @@ ENDINLINE $result =(< // BEGIN LON-CAPA Internal -$utility $timesync $newmail @@ -420,6 +422,7 @@ ENDREGTEXT } else { my $requri=(split(/\?/,$ENV{'request.noversionuri'}))[0]; $requri=&Apache::lonnet::unescape($requri); + my $navstatus=&get_nav_status(); $result = (< @@ -437,6 +440,7 @@ var swmenu=null; swmenu.currentSymb="$ENV{'request.symb'}"; swmenu.reloadSymb="$ENV{'request.symb'}"; swmenu.currentStale=0; + $navstatus $hwkadd $editbutton } @@ -528,11 +532,18 @@ sub startupremote { # my $configmenu=&rawconfig(); my $esclowerurl=&Apache::lonnet::escape($lowerurl); - + my $message=&mt('"Waiting for remote to load "+[_1]','waited'); return(< - +var timestart; function wheelswitch() { + if (typeof(document.wheel) != 'undefined') { + if (typeof(document.wheel.spin) != 'undefined') { + var date=new Date(); + var waited=Math.round(30-((date.getTime()-timestart)/1000)); + document.wheel.spin.value=$message; + } + } if (window.status=='|') { window.status='/'; } else { @@ -569,6 +580,8 @@ function wait() { function main() { canceltim=setTimeout('tim=1;',30000); window.status='-'; + var date=new Date(); + timestart=date.getTime(); wait(); } @@ -594,6 +607,25 @@ sub maincall() { ENDMAINCALL } + +sub load_remote_msg { + my ($lowerurl)=@_; + + if (($ENV{'browser.interface'} eq 'textual') || + ($ENV{'environment.remote'} eq 'off')) { return ''; } + + my $esclowerurl=&Apache::lonnet::escape($lowerurl); + my $link=&mt('Continue on in inline remote mode', + "/adm/remote?action=collapse?url=$esclowerurl"); + return(< +
+ + +

+

$link

+ENDREMOTEFORM +} # ================================================================= Reopen menu sub reopenmenu { @@ -872,12 +904,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 @@ -960,13 +1006,9 @@ sub handler { $ENV{'browser.interface'}='faketextual'; $ENV{'environment.remote'}='off'; } - my $utility=&utilityfunctions(); $r->print(< LON-CAPA Main Menu - $bodytag ENDHEADER