--- loncom/interface/lonmenu.pm 2003/04/03 00:52:21 1.49
+++ loncom/interface/lonmenu.pm 2003/04/03 20:25:08 1.53
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.49 2003/04/03 00:52:21 www Exp $
+# $Id: lonmenu.pm,v 1.53 2003/04/03 20:25:08 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -73,6 +73,7 @@ ENDMAINMENU
Main Menu
Launch Remote Control
+
@@ -98,6 +99,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))) {
@@ -364,6 +366,8 @@ sub startupremote {
# The Remote actually gets launched!
#
my $configmenu=&rawconfig();
+ my $esclowerurl=&Apache::lonnet::escape($lowerurl);
+
return(<
@@ -393,7 +397,7 @@ function wait() {
$configmenu
window.location='$lowerurl';
} else {
- alert("Remote Control timed out. It is possible that it was blocked by pop-up window filters.");
+ window.location='/adm/remote?action=collapse&url=$esclowerurl';
}
} else {
wheelswitch();
@@ -402,7 +406,7 @@ function wait() {
}
function main() {
- canceltim=setTimeout('tim=1;',60000);
+ canceltim=setTimeout('tim=1;',30000);
window.status='-';
wait();
}
@@ -484,9 +488,19 @@ sub switch {
$act=~s/\$udom/$udom/g;
unless (($ENV{'browser.interface'} eq 'textual') ||
($ENV{'environment.remote'} eq 'off')) {
+# Remote
return "\n".
qq(window.status+='.';swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
+ } elsif ($ENV{'browser.interface'} eq 'textual') {
+# Accessibility
+ if ($nobreak==2) { return ''; }
+ my $text=$top.' '.$bot;
+ $text=~s/\- //;
+ return "\n".($nobreak?' ':'
').
+ ''.$text.' '.
+ ($nobreak?'':$desc);
} else {
+# Inline Remote
if ($nobreak==2) { return ''; }
my $text=$top.' '.$bot;
$text=~s/\- //;
@@ -630,7 +644,8 @@ sub footer {
}
sub utilityfunctions {
- unless ($ENV{'browser.interface'} eq 'textual') { return ''; }
+ unless (($ENV{'browser.interface'} eq 'textual') ||
+ ($ENV{'environment.remote'} eq 'off')) { return ''; }
my $currenturl=$ENV{'REQUEST_URI'};
my $currentsymb=$ENV{'request.symb'};
return (<send_http_header;
return OK if $r->header_only;
- my $utility=&utilityfunctions();
my $form=&serverform();
my $bodytag=&Apache::loncommon::bodytag('Main Menu');
-# ------------------------------------------------------------ Print the screen
+# ---- Print the screen, pretent to be in text mode to generate text-based menu
+ unless ($ENV{'brower.interface'} eq 'textual') {
+ $ENV{'environment.remote'}='off';
+ }
+ my $utility=&utilityfunctions();
$r->print(<
LON-CAPA Main Menu