[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages menu.html /interface lonremote.pm
www
lon-capa-cvs@mail.lon-capa.org
Wed, 02 Apr 2003 21:23:04 -0000
www Wed Apr 2 16:23:04 2003 EDT
Modified files:
/loncom/html/res/adm/pages menu.html
/loncom/interface lonremote.pm
Log:
Closing the remote sets user environment variable on whether or not the Remote
should be on
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.89 loncom/html/res/adm/pages/menu.html:1.90
--- loncom/html/res/adm/pages/menu.html:1.89 Tue Feb 25 14:16:46 2003
+++ loncom/html/res/adm/pages/menu.html Wed Apr 2 16:23:04 2003
@@ -4,7 +4,7 @@
Remote Control
//
-// $Id: menu.html,v 1.89 2003/02/25 19:16:46 albertel Exp $
+// $Id: menu.html,v 1.90 2003/04/02 21:23:04 www Exp $
//
// Copyright Michigan State University Board of Trustees
//
@@ -36,7 +36,7 @@
<body bgcolor="#BBBBBB"
background="remotebg.gif"
- onUnload="logout();"
+ onUnload="go('/adm/remote?action=collapse')"
onLoad="activate();"
>
<font size="1">
Index: loncom/interface/lonremote.pm
diff -u loncom/interface/lonremote.pm:1.1 loncom/interface/lonremote.pm:1.2
--- loncom/interface/lonremote.pm:1.1 Wed Apr 2 15:28:27 2003
+++ loncom/interface/lonremote.pm Wed Apr 2 16:23:04 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# User Authentication Module
#
-# $Id: lonremote.pm,v 1.1 2003/04/02 20:28:27 www Exp $
+# $Id: lonremote.pm,v 1.2 2003/04/02 21:23:04 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,36 +42,58 @@
use Apache::lonmenu();
sub launchremote {
- my ($r,$clientos,$lowerurl)=@_;
+ my ($r,$lowerurl)=@_;
# -------------------------------------------------------- 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('Successful Login');
-# ------------------------------------------------- Output for successful login
- $r->print(<<ENDSUCCESS);
+# 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');
+ $r->print(<<ENDLAUNCH);
<html>
<head>
-<title>Successful Login to the LearningOnline Network with CAPA</title>
-$startupremote
+<title>The LearningOnline Network with CAPA</title>
</head>
$bodytag
-$setflags
-$windowinfo
-<h1>Welcome!</h1>
-Welcome to the Learning<i>Online</i> Network with CAPA.
-Please wait while your session
-is being set up.<p>
-<a href="/adm/loginproblems.html">Problems?</a></p>
-$maincall
</body>
</html>
-ENDSUCCESS
+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');
+ $r->print(<<ENDCOLLAPSE);
+<html>
+<head>
+<title>The LearningOnline Network with CAPA</title>
+</head>
+$bodytag
+</body>
+</html>
+ENDCOLLAPSE
+ &Apache::lonnet::put('environment',{'remote' => 'off'});
+ &Apache::lonnet::appenv('environment.remote' => 'off');
}
sub handler {
my $r = shift;
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action']);
+ unless ($ENV{'form.action'}) {
+ if ($ENV{'environment.remote'} eq 'on') {
+ $ENV{'form.action'}='collapse';
+ } else {
+ $ENV{'form.action'}='launch';
+ }
+ }
+ if ($ENV{'form.action'} eq 'launch') {
+ &launchremote($r);
+ } else {
+ &collapseremote($r);
+ }
return OK;
}