Diff for /loncom/interface/lonmenu.pm between versions 1.268 and 1.269

version 1.268, 2009/05/26 20:30:28 version 1.269, 2009/06/02 17:25:03
Line 26 Line 26
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
 #  #
 # There are two parameters controlling the action of this module:  # There is one parameter 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  # environment.remote - if this is 'on', the routines controll the remote
 # control, otherwise they render the main window controls; ignored it  # control, otherwise they render the main window controls; 
 # browser.interface is 'textual'  
 #  
   
 =head1 NAME  =head1 NAME
   
Line 350  sub registerurl { Line 345  sub registerurl {
     if ($env{'request.state'} eq 'construct') {      if ($env{'request.state'} eq 'construct') {
  $force_title=&Apache::lonxml::display_title();   $force_title=&Apache::lonxml::display_title();
     }      }
     if (($env{'browser.interface'} eq 'textual') ||      if (($env{'environment.remote'} eq 'off') ||
         ($env{'environment.remote'} eq 'off') ||  
         ((($env{'request.publicaccess'}) ||           ((($env{'request.publicaccess'}) || 
          (!&Apache::lonnet::is_on_map(           (!&Apache::lonnet::is_on_map(
    &unescape($env{'request.noversionuri'})))) &&     &unescape($env{'request.noversionuri'})))) &&
Line 734  ENDREGTHIS Line 728  ENDREGTHIS
     } else {      } else {
 # ========================================== This can or will not be registered  # ========================================== This can or will not be registered
         if ($noremote) {          if ($noremote) {
 # Not registered, textual  # Not registered
             $result= (<<ENDDONOTREGTEXT);              $result= (<<ENDDONOTREGTEXT);
 ENDDONOTREGTEXT  ENDDONOTREGTEXT
         } else {          } else {
Line 825  sub unloadevents() { Line 819  sub unloadevents() {
   
 sub startupremote {  sub startupremote {
     my ($lowerurl)=@_;      my ($lowerurl)=@_;
     if (($env{'browser.interface'} eq 'textual') ||      if ($env{'environment.remote'} eq 'off') {
         ($env{'environment.remote'} eq 'off')) {  
      return ('<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'" />');       return ('<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'" />');
     }      }
 #  #
Line 901  ENDSETFLAGS Line 894  ENDSETFLAGS
 }  }
   
 sub maincall() {  sub maincall() {
     if (($env{'browser.interface'} eq 'textual') ||      if ($env{'environment.remote'} eq 'off') { return ''; }
         ($env{'environment.remote'} eq 'off')) { return ''; }  
     return(<<ENDMAINCALL);      return(<<ENDMAINCALL);
 <script type="text/javascript">  <script type="text/javascript">
     main();      main();
Line 913  ENDMAINCALL Line 905  ENDMAINCALL
 sub load_remote_msg {  sub load_remote_msg {
     my ($lowerurl)=@_;      my ($lowerurl)=@_;
   
     if (($env{'browser.interface'} eq 'textual') ||      if ($env{'environment.remote'} eq 'off') { return ''; }
         ($env{'environment.remote'} eq 'off')) { return ''; }  
   
     my $esclowerurl=&escape($lowerurl);      my $esclowerurl=&escape($lowerurl);
     my $link=&mt('[_1]Continue[_2] on in Inline Menu mode'      my $link=&mt('[_1]Continue[_2] on in Inline Menu mode'
Line 938  sub get_menu_name { Line 929  sub get_menu_name {
   
   
 sub reopenmenu {  sub reopenmenu {
    if (($env{'browser.interface'} eq 'textual') ||     if ($env{'environment.remote'} eq 'off') { return ''; }
        ($env{'environment.remote'} eq 'off')) { return ''; }  
    my $menuname = &get_menu_name();     my $menuname = &get_menu_name();
    my $nothing = &Apache::lonhtmlcommon::javascript_nothing();     my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
    return('window.open('.$nothing.',"'.$menuname.'","",false);');     return('window.open('.$nothing.',"'.$menuname.'","",false);');
Line 948  sub reopenmenu { Line 938  sub reopenmenu {
   
 sub open {  sub open {
     my $returnval='';      my $returnval='';
     if (($env{'browser.interface'} eq 'textual') ||      if ($env{'environment.remote'} eq 'off') { 
         ($env{'environment.remote'} eq 'off')) {   
  return '<script type="text/javascript">self.name="loncapaclient";</script>';   return '<script type="text/javascript">self.name="loncapaclient";</script>';
     }      }
     my $menuname = &get_menu_name();      my $menuname = &get_menu_name();
Line 977  ENDOPEN Line 966  ENDOPEN
   
 sub clear {  sub clear {
     my ($row,$col)=@_;      my ($row,$col)=@_;
     unless (($env{'browser.interface'} eq 'textual') ||      unless ($env{'environment.remote'} eq 'off') {
             ($env{'environment.remote'} eq 'off')) {  
        return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););         return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););
    } else {      } else { 
        $inlineremote[10*$row+$col]='';         $inlineremote[10*$row+$col]='';
Line 1003  sub switch { Line 991  sub switch {
     my $idx=10*$row+$col;      my $idx=10*$row+$col;
     $category_members{$cat}.=':'.$idx;      $category_members{$cat}.=':'.$idx;
   
     unless (($env{'browser.interface'} eq 'textual')  ||      unless ($env{'environment.remote'} eq 'off') {
             ($env{'environment.remote'} eq 'off')) {  
 # Remote  # Remote
        return "\n".         return "\n".
  qq(window.status+='.';swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););   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]=  
        '<a href="javascript:'.$act.';">'.$text.'</a>';  
        } else {  
    $inlineremote[$idx]="\n<br />".  
        $desc.' <a href="javascript:'.$act.';">'.$text.'</a>';  
        }  
    } else {     } else {
 # Inline Remote  # Inline Remote
        if ($env{'environment.icons'} ne 'classic') {         if ($env{'environment.icons'} ne 'classic') {
Line 1082  sub secondlevel { Line 1057  sub secondlevel {
   
 sub openmenu {  sub openmenu {
     my $menuname = &get_menu_name();      my $menuname = &get_menu_name();
     if (($env{'browser.interface'} eq 'textual') ||      if ($env{'environment.remote'} eq 'off') { return ''; }
         ($env{'environment.remote'} eq 'off')) { return ''; }  
     my $nothing = &Apache::lonhtmlcommon::javascript_nothing();      my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
     return "window.open(".$nothing.",'".$menuname."');";      return "window.open(".$nothing.",'".$menuname."');";
 }  }
Line 1124  sub inlinemenu { Line 1098  sub inlinemenu {
 sub rawconfig {  sub rawconfig {
     my $textualoverride=shift;      my $textualoverride=shift;
     my $output='';      my $output='';
     unless (($env{'browser.interface'} eq 'textual') ||      unless ($env{'environment.remote'} eq 'off') {
             ($env{'environment.remote'} eq 'off')) {  
        $output.=         $output.=
  "window.status='Opening Remote Control';var swmenu=".&openmenu().   "window.status='Opening Remote Control';var swmenu=".&openmenu().
 "\nwindow.status='Configuring Remote Control ';";  "\nwindow.status='Configuring Remote Control ';";
Line 1258  sub rawconfig { Line 1231  sub rawconfig {
           $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat);            $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat);
         }          }
     }      }
     unless (($env{'browser.interface'} eq 'textual') ||      unless ($env{'environment.remote'} eq 'off') {
             ($env{'environment.remote'} eq 'off')) {  
        $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';";         $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';";
        if (&Apache::lonmsg::newmail()) {          if (&Apache::lonmsg::newmail()) { 
    $output.='swmenu.setstatus("you have","messages");';     $output.='swmenu.setstatus("you have","messages");';
Line 1272  sub rawconfig { Line 1244  sub rawconfig {
 # ======================================================================= Close  # ======================================================================= Close
   
 sub close {  sub close {
     if (($env{'browser.interface'} eq 'textual') ||      if ($env{'environment.remote'} eq 'off') { return ''; }
         ($env{'environment.remote'} eq 'off')) { return ''; }  
     my $menuname = &get_menu_name();      my $menuname = &get_menu_name();
     return(<<ENDCLOSE);      return(<<ENDCLOSE);
 <script type="text/javascript">  <script type="text/javascript">
Line 1315  NAVCONTROL Line 1286  NAVCONTROL
   
 sub utilityfunctions {  sub utilityfunctions {
     my $caller = shift;      my $caller = shift;
     unless (($env{'browser.interface'} eq 'textual')  ||      unless ($env{'environment.remote'} eq 'off' || 
         ($env{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; }              $caller eq '/adm/menu') { 
               return ''; }
               
     my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));      my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
     $currenturl=&Apache::lonenc::check_encrypt(&unescape($currenturl));      $currenturl=&Apache::lonenc::check_encrypt(&unescape($currenturl));
           

Removed from v.1.268  
changed lines
  Added in v.1.269


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>