--- loncom/interface/lonmenu.pm 2003/02/17 19:28:54 1.41 +++ loncom/interface/lonmenu.pm 2003/04/03 14:44:01 1.51 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.41 2003/02/17 19:28:54 www Exp $ +# $Id: lonmenu.pm,v 1.51 2003/04/03 14:44:01 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"; @@ -90,7 +120,11 @@ sub innerregister { $Apache::lonxml::registered=1; - my $textual=($ENV{'browser.interface'} eq 'textual'); + my $textinter=($ENV{'browser.interface'} eq 'textual'); + my $noremote=($ENV{'environment.remote'} eq 'off'); + + my $textual=($textinter || $noremote); + my $reopen=&Apache::lonmenu::reopenmenu(); my $newmail=''; @@ -204,12 +238,23 @@ ENDMENUITEMS } if ($textual) { # Registered, textual output + my $utility=&utilityfunctions(); + my $form=&serverform(); $result =(< +// BEGIN LON-CAPA Internal +$utility + $timesync $newmail $buttons $hwkadd $editbutton +$form + + ENDREGTEXT # Registered, graphical output } else { @@ -217,6 +262,7 @@ ENDREGTEXT $bodytag ENDHEADER - $r->print(&rawconfig(1)); + $r->print(&rawconfig(1).$form); $r->print(''); return OK; }