--- loncom/interface/Attic/lonremote.pm 2003/04/02 21:23:04 1.2 +++ loncom/interface/Attic/lonremote.pm 2003/05/23 21:18:56 1.7 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonremote.pm,v 1.2 2003/04/02 21:23:04 www Exp $ +# $Id: lonremote.pm,v 1.7 2003/05/23 21:18:56 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,35 +43,44 @@ use Apache::lonmenu(); sub launchremote { my ($r,$lowerurl)=@_; + &Apache::lonnet::put('environment',{'remote' => 'on'}); + &Apache::lonnet::appenv('environment.remote' => 'on'); # -------------------------------------------------------- Menu script and info -# my $windowinfo=&Apache::lonmenu::open($clientos); -# my $startupremote=&Apache::lonmenu::startupremote($lowerurl); -# my $setflags=&Apache::lonmenu::setflags(); -# my $maincall=&Apache::lonmenu::maincall(); - my $bodytag=&Apache::loncommon::bodytag('Launch Remote Control'); + my $windowinfo=&Apache::lonmenu::open($ENV{'browser.os'}); + my $startupremote=&Apache::lonmenu::startupremote($lowerurl); + my $setflags=&Apache::lonmenu::setflags(); + my $maincall=&Apache::lonmenu::maincall(); + my $bodytag=&Apache::loncommon::bodytag('Launch Remote Control',undef,' '); $r->print(< The LearningOnline Network with CAPA +$startupremote $bodytag +$setflags +$windowinfo +$maincall ENDLAUNCH - &Apache::lonnet::put('environment',{'remote' => 'on'}); - &Apache::lonnet::appenv('environment.remote' => 'on'); } sub collapseremote { my ($r,$lowerurl)=@_; # -------------------------------------------------------- Menu script and info - my $bodytag=&Apache::loncommon::bodytag('Collapse Remote Control'); + my $bodytag=&Apache::loncommon::bodytag('Collapse Remote Control',undef, + ' '); + my $windowinfo=&Apache::lonmenu::close(); + my $switch=''; $r->print(< The LearningOnline Network with CAPA +$switch $bodytag +$windowinfo ENDCOLLAPSE @@ -81,7 +90,8 @@ ENDCOLLAPSE sub handler { my $r = shift; - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action']); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['action','url']); unless ($ENV{'form.action'}) { if ($ENV{'environment.remote'} eq 'on') { $ENV{'form.action'}='collapse'; @@ -89,10 +99,14 @@ sub handler { $ENV{'form.action'}='launch'; } } + + my $lowerurl=$ENV{'form.url'}; + unless ($lowerurl) { $lowerurl='/adm/menu'; } + if ($ENV{'form.action'} eq 'launch') { - &launchremote($r); + &launchremote($r,$lowerurl); } else { - &collapseremote($r); + &collapseremote($r,$lowerurl); } return OK; }