--- loncom/interface/lonmenu.pm 2003/04/03 14:44:01 1.51 +++ loncom/interface/lonmenu.pm 2003/04/04 19:35:04 1.55 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.51 2003/04/03 14:44:01 www Exp $ +# $Id: lonmenu.pm,v 1.55 2003/04/04 19:35:04 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -52,13 +52,22 @@ sub menubuttons { my $forcereg=shift; my $target =shift; my $registration=shift; + my $navmaps=''; + my $escurl=&Apache::lonnet::escape($ENV{'REQUEST_URI'}); + my $escsymb=&Apache::lonnet::escape($ENV{'request.symb'}); if ($ENV{'browser.interface'} eq 'textual') { # Textual display only + if ($ENV{'request.course.id'}) { + $navmaps=(<Navigate Contents +ENDNAV + } my $output=(< // BEGIN LON-CAPA Internal -Main Menu
+Main Menu +$navmaps
@@ -67,18 +76,26 @@ ENDMAINMENU return $output."
"; } elsif ($ENV{'environment.remote'} eq 'off') { # Remote Control is switched off + if ($ENV{'request.course.id'}) { + $navmaps=(<Navigate Contents +ENDNAVREM + } my $output=(< // BEGIN LON-CAPA Internal +
Main Menu -Launch Remote Control +$navmaps +Launch Remote Control +
ENDINLINEMENU if ($registration) { $output.=&innerregister($forcereg,$target); } - return $output."
"; + return $output."
"; } else { return ''; } @@ -98,6 +115,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 +382,8 @@ sub startupremote { # The Remote actually gets launched! # my $configmenu=&rawconfig(); + my $esclowerurl=&Apache::lonnet::escape($lowerurl); + return(< @@ -393,7 +413,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 +422,7 @@ function wait() { } function main() { - canceltim=setTimeout('tim=1;',60000); + canceltim=setTimeout('tim=1;',30000); window.status='-'; wait(); } @@ -702,10 +722,13 @@ sub handler { $r->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