Diff for /loncom/interface/Attic/lonremote.pm between versions 1.11 and 1.20

version 1.11, 2004/06/18 00:34:14 version 1.20, 2006/03/16 22:17:30
Line 32  package Apache::lonremote; Line 32  package Apache::lonremote;
 use strict;  use strict;
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonnet();  use Apache::lonnet;
 use Apache::lonmenu();  use Apache::lonmenu();
 use Apache::lonlocal;  use Apache::lonlocal;
   
Line 41  sub launchremote { Line 41  sub launchremote {
     &Apache::lonnet::put('environment',{'remote' => 'on'});      &Apache::lonnet::put('environment',{'remote' => 'on'});
     &Apache::lonnet::appenv('environment.remote' => 'on');      &Apache::lonnet::appenv('environment.remote' => 'on');
 # -------------------------------------------------------- Menu script and info  # -------------------------------------------------------- Menu script and info
     my $windowinfo=&Apache::lonmenu::open($ENV{'browser.os'});      my $windowinfo=&Apache::lonmenu::open($env{'browser.os'});
     my $startupremote=&Apache::lonmenu::startupremote($lowerurl);      my $startupremote=&Apache::lonmenu::startupremote($lowerurl);
       my $start_page = &Apache::loncommon::start_page('Remote Control',
       $startupremote);
       my $end_page   = &Apache::loncommon::end_page();
       my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl);
     my $setflags=&Apache::lonmenu::setflags();      my $setflags=&Apache::lonmenu::setflags();
     my $maincall=&Apache::lonmenu::maincall();      my $maincall=&Apache::lonmenu::maincall();
     my $bodytag=&Apache::loncommon::bodytag('Launch Remote Control');  
     my $message=&mt("Launching of the Remote Control menu will fail if pop-up window filters are active. To use the Remote Control, disable the filter for this site.");      my $message=&mt("Launching of the Remote Control menu will fail if pop-up window filters are active. To use the Remote Control, disable the filter for this site.");
     $r->print(<<ENDLAUNCH);      $r->print(<<ENDLAUNCH);
 <html>  $start_page
 <head>  
 <title>The LearningOnline Network with CAPA</title>  
 $startupremote  
 </head>  
 $bodytag  
 $setflags  $setflags
 $windowinfo  $windowinfo
 $maincall  
 $message  $message
 </body>  $remoteinfo
 </html>  $maincall
   $end_page
 ENDLAUNCH  ENDLAUNCH
 }  }
   
 sub collapseremote {  sub collapseremote {
     my ($r,$lowerurl)=@_;      my ($r,$lowerurl)=@_;
 # -------------------------------------------------------- Menu script and info  # -------------------------------------------------------- Menu script and info
     my $bodytag=&Apache::loncommon::bodytag('Collapse Remote Control');      my $start_page = &Apache::loncommon::start_page('Collapse Remote Control');
       my $end_page  =  &Apache::loncommon::end_page();
     my $windowinfo=&Apache::lonmenu::close();      my $windowinfo=&Apache::lonmenu::close();
     my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'">';  #    my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'">';
     my $message=&mt('The external menu (Remote Control) has been disabled, and you will be working with the smaller inline menu.\nYou may have either closed the Remote Control window, or it was blocked by a pop-up window filter in your browser.\nTo use the Remote Control, disable the filter for this site, and re-launch the Remote Control from the inline menu.');       my $message='<p>'.&mt("The external menu (Remote Control) has been disabled, and you will be working with the smaller inline menu.\nYou may have either closed the Remote Control window, or it was blocked by a pop-up window filter in your browser.\nTo use the Remote Control, disable the filter for this site, and re-launch the Remote Control from the inline menu.").'</p>'; 
     $r->print(<<ENDCOLLAPSE);      $r->print(<<ENDCOLLAPSE);
 <html>  $start_page
 <head>  
 <title>The LearningOnline Network with CAPA</title>  
 $switch  
 </head>  
 $bodytag  
 $windowinfo  $windowinfo
 <script>  <p>
 alert("$message");  $message
 </script>  </p>
 </body>  <a href="$lowerurl">Continue</a>
 </html>  $end_page
 ENDCOLLAPSE  ENDCOLLAPSE
    &Apache::lonnet::put('environment',{'remote' => 'off'});     &Apache::lonnet::put('environment',{'remote' => 'off'});
    &Apache::lonnet::appenv('environment.remote' => 'off');     &Apache::lonnet::appenv('environment.remote' => 'off');
Line 92  sub handler { Line 86  sub handler {
     my $r = shift;      my $r = shift;
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['action','url']);                                              ['action','url']);
     unless ($ENV{'form.action'}) {      unless ($env{'form.action'}) {
  if ($ENV{'environment.remote'} eq 'on') {   if ($env{'environment.remote'} ne 'off') {
     $ENV{'form.action'}='collapse';      $env{'form.action'}='collapse';
         } else {          } else {
     $ENV{'form.action'}='launch';      $env{'form.action'}='launch';
         }          }
     }      }
   
     my $lowerurl=$ENV{'form.url'};      my $lowerurl=$env{'form.url'};
     unless ($lowerurl) { $lowerurl='/adm/menu'; }      unless ($lowerurl) { $lowerurl='/adm/menu'; }
   
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
   
     if ($ENV{'form.action'} eq 'launch') {      if ($env{'form.action'} eq 'launch') {
  &launchremote($r,$lowerurl);   &launchremote($r,$lowerurl);
     } else {      } else {
         &collapseremote($r,$lowerurl);          &collapseremote($r,$lowerurl);

Removed from v.1.11  
changed lines
  Added in v.1.20


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