--- loncom/interface/lonmenu.pm 2003/02/17 22:59:37 1.42
+++ 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.42 2003/02/17 22:59:37 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,11 +52,36 @@ 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='Main Menu
';
- if ($registration) { $output.=&innerregister($forcereg,$target); }
- return $output."
";
+ my $output=(<
+// BEGIN LON-CAPA Internal
+
+Main Menu
+
+ENDMAINMENU
+ 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
@@ -62,7 +92,7 @@ sub registerurl {
my $result = '';
if ($target eq 'edit') {
- $result .="\n";
@@ -237,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;
@@ -393,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
@@ -449,7 +478,8 @@ sub switch {
my $text=$top.' '.$bot;
$text=~s/\- //;
return "\n".($nobreak?' ':'
').
- ''.$text.' '.($nobreak?'':$desc);
+ ''.$text.' '.
+ ($nobreak?'':$desc);
}
}
@@ -470,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 {