version 1.11, 2004/06/18 00:34:14
|
version 1.18, 2005/04/07 06:56:23
|
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 $html=&Apache::lonxml::xmlbegin(); |
my $startupremote=&Apache::lonmenu::startupremote($lowerurl); |
my $startupremote=&Apache::lonmenu::startupremote($lowerurl); |
|
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 $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> |
$html |
<head> |
<head> |
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
$startupremote |
$startupremote |
Line 56 $startupremote
|
Line 58 $startupremote
|
$bodytag |
$bodytag |
$setflags |
$setflags |
$windowinfo |
$windowinfo |
$maincall |
|
$message |
$message |
|
$remoteinfo |
|
$maincall |
</body> |
</body> |
</html> |
</html> |
ENDLAUNCH |
ENDLAUNCH |
Line 66 ENDLAUNCH
|
Line 69 ENDLAUNCH
|
sub collapseremote { |
sub collapseremote { |
my ($r,$lowerurl)=@_; |
my ($r,$lowerurl)=@_; |
# -------------------------------------------------------- Menu script and info |
# -------------------------------------------------------- Menu script and info |
|
my $html=&Apache::lonxml::xmlbegin(); |
my $bodytag=&Apache::loncommon::bodytag('Collapse Remote Control'); |
my $bodytag=&Apache::loncommon::bodytag('Collapse Remote Control'); |
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> |
$html |
<head> |
<head> |
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
$switch |
|
</head> |
</head> |
$bodytag |
$bodytag |
$windowinfo |
$windowinfo |
<script> |
<p> |
alert("$message"); |
$message |
</script> |
</p> |
|
<a href="$lowerurl">Continue</a> |
</body> |
</body> |
</html> |
</html> |
ENDCOLLAPSE |
ENDCOLLAPSE |
Line 92 sub handler {
|
Line 96 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); |