--- loncom/interface/lonmenu.pm 2009/05/26 20:30:28 1.268 +++ loncom/interface/lonmenu.pm 2009/06/02 17:25:03 1.269 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.268 2009/05/26 20:30:28 droeschl Exp $ +# $Id: lonmenu.pm,v 1.269 2009/06/02 17:25:03 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,15 +26,10 @@ # http://www.lon-capa.org/ # # -# 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 +# There is one parameter controlling the action of this module: # # 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' -# +# control, otherwise they render the main window controls; =head1 NAME @@ -350,8 +345,7 @@ sub registerurl { if ($env{'request.state'} eq 'construct') { $force_title=&Apache::lonxml::display_title(); } - if (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off') || + if (($env{'environment.remote'} eq 'off') || ((($env{'request.publicaccess'}) || (!&Apache::lonnet::is_on_map( &unescape($env{'request.noversionuri'})))) && @@ -734,7 +728,7 @@ ENDREGTHIS } else { # ========================================== This can or will not be registered if ($noremote) { -# Not registered, textual +# Not registered $result= (<'); } # @@ -901,8 +894,7 @@ ENDSETFLAGS } sub maincall() { - if (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { return ''; } + if ($env{'environment.remote'} eq 'off') { return ''; } return(< main(); @@ -913,8 +905,7 @@ ENDMAINCALL sub load_remote_msg { my ($lowerurl)=@_; - if (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { return ''; } + if ($env{'environment.remote'} eq 'off') { return ''; } my $esclowerurl=&escape($lowerurl); my $link=&mt('[_1]Continue[_2] on in Inline Menu mode' @@ -938,8 +929,7 @@ sub get_menu_name { sub reopenmenu { - if (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { return ''; } + if ($env{'environment.remote'} eq 'off') { return ''; } my $menuname = &get_menu_name(); my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); return('window.open('.$nothing.',"'.$menuname.'","",false);'); @@ -948,8 +938,7 @@ sub reopenmenu { sub open { my $returnval=''; - if (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { + if ($env{'environment.remote'} eq 'off') { return ''; } my $menuname = &get_menu_name(); @@ -977,8 +966,7 @@ ENDOPEN sub clear { my ($row,$col)=@_; - unless (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { + unless ($env{'environment.remote'} eq 'off') { return "\n".qq(window.status+='.';swmenu.clearbut($row,$col);); } else { $inlineremote[10*$row+$col]=''; @@ -1003,23 +991,10 @@ sub switch { my $idx=10*$row+$col; $category_members{$cat}.=':'.$idx; - unless (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { + unless ($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/\s*\-\s*//gs; - if ($nobreak) { - $inlineremote[$idx]= - ''.$text.''; - } else { - $inlineremote[$idx]="\n
". - $desc.' '.$text.''; - } } else { # Inline Remote if ($env{'environment.icons'} ne 'classic') { @@ -1082,8 +1057,7 @@ sub secondlevel { sub openmenu { my $menuname = &get_menu_name(); - if (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { return ''; } + if ($env{'environment.remote'} eq 'off') { return ''; } my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); return "window.open(".$nothing.",'".$menuname."');"; } @@ -1124,8 +1098,7 @@ sub inlinemenu { sub rawconfig { my $textualoverride=shift; my $output=''; - unless (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { + unless ($env{'environment.remote'} eq 'off') { $output.= "window.status='Opening Remote Control';var swmenu=".&openmenu(). "\nwindow.status='Configuring Remote Control ';"; @@ -1258,8 +1231,7 @@ sub rawconfig { $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat); } } - unless (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { + unless ($env{'environment.remote'} eq 'off') { $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';"; if (&Apache::lonmsg::newmail()) { $output.='swmenu.setstatus("you have","messages");'; @@ -1272,8 +1244,7 @@ sub rawconfig { # ======================================================================= Close sub close { - if (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off')) { return ''; } + if ($env{'environment.remote'} eq 'off') { return ''; } my $menuname = &get_menu_name(); return(< @@ -1315,8 +1286,10 @@ NAVCONTROL sub utilityfunctions { my $caller = shift; - unless (($env{'browser.interface'} eq 'textual') || - ($env{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; } + unless ($env{'environment.remote'} eq 'off' || + $caller eq '/adm/menu') { + return ''; } + my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0])); $currenturl=&Apache::lonenc::check_encrypt(&unescape($currenturl));