--- loncom/interface/lonmenu.pm 2003/02/20 22:04:18 1.44 +++ loncom/interface/lonmenu.pm 2003/04/02 22:02:19 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.44 2003/02/20 22:04:18 www Exp $ +# $Id: lonmenu.pm,v 1.48 2003/04/02 22:02:19 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,18 +25,23 @@ # # http://www.lon-capa.org/ # -# (TeX Conversion Module # -# 05/29/00,05/30 Gerd Kortemeyer) +# There are two parameters controlling the action of this module: +# +# browser.interface - if this is 'textual', it overrides the second parameter +# and goes to screen reader PDA mode +# +# environment.remote - if this is 'on', the routines controll the remote +# control, otherwise they render the main window controls; ignored it +# browser.interface is 'textual' # -# 10/05,05/28,05/30,06/01,06/08,06/09,07/04,08/07 Gerd Kortemeyer -# 02/15/02 Matthew Hall package Apache::lonmenu; use strict; use Apache::lonnet; use Apache::Constants qw(:common); +use Apache::lonhtmlcommon(); use Apache::loncommon; use Apache::File; use vars qw(@desklines $readdesk); @@ -47,9 +52,9 @@ sub menubuttons { my $forcereg=shift; my $target =shift; my $registration=shift; - unless ($ENV{'browser.interface'} eq 'textual') { return ''; } + if ($ENV{'browser.interface'} eq 'textual') { # Textual display only - my $output=(< // BEGIN LON-CAPA Internal @@ -58,8 +63,25 @@ sub menubuttons { // END LON-CAPA Internal ENDMAINMENU - if ($registration) { $output.=&innerregister($forcereg,$target); } - return $output."
"; + if ($registration) { $output.=&innerregister($forcereg,$target); } + return $output."
"; + } elsif ($ENV{'environment.remote'} eq 'off') { +# Remote Control is switched off + my $output=(< +// BEGIN LON-CAPA Internal + +Main Menu +Launch Remote Control + +ENDINLINEMENU + if ($registration) { $output.=&innerregister($forcereg,$target); } + return $output."
"; + } else { + return ''; + } } # ====================================== This gets called in the header section @@ -70,7 +92,7 @@ sub registerurl { my $result = ''; if ($target eq 'edit') { - $result .="\n"; @@ -245,7 +267,7 @@ var swmenu=null; $newmail $buttons swmenu.currentURL=window.location.pathname; - swmenu.reloadURL=window.location.pathname; + swmenu.reloadURL=window.location.pathname+window.location.search; swmenu.currentSymb="$ENV{'request.symb'}"; swmenu.reloadSymb="$ENV{'request.symb'}"; swmenu.currentStale=0; @@ -401,11 +423,10 @@ ENDMAINCALL # ================================================================= Reopen menu sub reopenmenu { - my $nothing=''; if ($ENV{'browser.interface'} eq 'textual') { return ''; } my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; - if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; } - return('window.open("'.$nothing.'","'.$menuname.'","",false);'); + my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); + return('window.open('.$nothing.',"'.$menuname.'","",false);'); } # =============================================================== Open the menu @@ -479,11 +500,8 @@ sub secondlevel { sub openmenu { my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; if ($ENV{'browser.interface'} eq 'textual') { return ''; } - if ($ENV{'browser.type'} eq 'explorer') { - return "window.open('javascript:void(0);','".$menuname."');"; - } else { - return "window.open('','".$menuname."');"; - } + my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); + return "window.open(".$nothing.",'".$menuname."');"; } sub rawconfig {