version 1.29, 2002/12/06 17:49:49
|
version 1.32, 2003/01/31 21:46:36
|
Line 38 use strict;
|
Line 38 use strict;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::File; |
use Apache::File; |
use vars qw(@desklines $readdesk); |
use vars qw(@desklines $readdesk); |
|
|
|
# ============================================================= Start up remote |
|
|
|
sub startupremote { |
|
my ($lowerurl)=@_; |
|
my $configmenu=&rawconfig(); |
|
return(<<ENDREMOTESTARTUP); |
|
<script> |
|
|
|
// ---------------------------------------------------------- The wait function |
|
var canceltim; |
|
function wait() { |
|
if ((menuloaded==1) || (tim==1)) { |
|
if (tim==0) { |
|
clearTimeout(canceltim); |
|
$configmenu |
|
window.location='$lowerurl'; |
|
} else { |
|
alert("Remote Control Timed Out."); |
|
} |
|
} else { |
|
setTimeout('wait();',100); |
|
} |
|
} |
|
|
|
function main() { |
|
canceltim=setTimeout('tim=1;',80000); |
|
wait(); |
|
} |
|
|
|
</script> |
|
ENDREMOTESTARTUP |
|
} |
|
|
|
sub setflags() { |
|
return(<<ENDSETFLAGS); |
|
<script> |
|
menuloaded=0; |
|
tim=0; |
|
</script> |
|
ENDSETFLAGS |
|
} |
|
|
|
sub maincall() { |
|
return(<<ENDMAINCALL); |
|
<script> |
|
main(); |
|
</script> |
|
ENDMAINCALL |
|
} |
|
# ================================================================= Reopen menu |
|
|
|
sub reopenmenu { |
|
my $nothing=''; |
|
my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; |
|
if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; } |
|
return('window.open("'.$nothing.'","'.$menuname.'","",false);'); |
|
} |
|
|
# =============================================================== Open the menu |
# =============================================================== Open the menu |
|
|
sub open { |
sub open { |
my $returnval=''; |
my $returnval=''; |
|
my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; |
unless (shift eq 'unix') { |
unless (shift eq 'unix') { |
# resizing does not work on linux because of virtual desktop sizes |
# resizing does not work on linux because of virtual desktop sizes |
$returnval.=(<<ENDRESIZE); |
$returnval.=(<<ENDRESIZE); |
Line 53 if (window.screen) {
|
Line 112 if (window.screen) {
|
ENDRESIZE |
ENDRESIZE |
} |
} |
$returnval.=(<<ENDOPEN); |
$returnval.=(<<ENDOPEN); |
var menu=window.open("/res/adm/pages/menu.html","LONCAPAmenu", |
var menu=window.open("/res/adm/pages/menu.html","$menuname", |
"height=350,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5"); |
"height=350,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5"); |
ENDOPEN |
ENDOPEN |
return '<script>'.$returnval.'</script>'; |
return '<script>'.$returnval.'</script>'; |
Line 104 sub secondlevel {
|
Line 163 sub secondlevel {
|
} |
} |
|
|
sub openmenu { |
sub openmenu { |
|
my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; |
if ($ENV{'browser.type'} eq 'explorer') { |
if ($ENV{'browser.type'} eq 'explorer') { |
return "window.open('javascript:void(0);','LONCAPAmenu');"; |
return "window.open('javascript:void(0);','".$menuname."');"; |
} else { |
} else { |
return "window.open('','LONCAPAmenu');"; |
return "window.open('','".$menuname."');"; |
} |
} |
} |
} |
|
|
sub rawconfig { |
sub rawconfig { |
my $r = shift; |
|
my $output="var swmenu=".&openmenu(); |
my $output="var swmenu=".&openmenu(); |
my $uname=$ENV{'user.name'}; |
my $uname=$ENV{'user.name'}; |
my $udom=$ENV{'user.domain'}; |
my $udom=$ENV{'user.domain'}; |
Line 172 sub rawconfig {
|
Line 231 sub rawconfig {
|
} |
} |
$act =~ s/\$caname/$caname/g; |
$act =~ s/\$caname/$caname/g; |
my $home = &Apache::lonnet::homeserver($caname,$cadom); |
my $home = &Apache::lonnet::homeserver($caname,$cadom); |
if ($home eq $r->dir_config('lonHostID')) { |
if ($home eq $Apache::lonnet::perlvar{'lonHostID'}) { |
$output.=switch($caname,$cadom, |
$output.=switch($caname,$cadom, |
$row,$col,$img,$top,$bot,$act,$desc); |
$row,$col,$img,$top,$bot,$act,$desc); |
} |
} |
Line 187 sub rawconfig {
|
Line 246 sub rawconfig {
|
# ======================================================================= Close |
# ======================================================================= Close |
|
|
sub close { |
sub close { |
|
my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; |
return(<<ENDCLOSE); |
return(<<ENDCLOSE); |
<script> |
<script> |
menu=window.open("/adm/rat/empty.html","LONCAPAmenu", |
menu=window.open("/adm/rat/empty.html","$menuname", |
"height=350,width=150,scrollbars=no,menubar=no"); |
"height=350,width=150,scrollbars=no,menubar=no"); |
|
menu.autologout=0; |
menu.close(); |
menu.close(); |
</script> |
</script> |
ENDCLOSE |
ENDCLOSE |
Line 221 BEGIN {
|
Line 282 BEGIN {
|
$readdesk='done'; |
$readdesk='done'; |
} |
} |
} |
} |
|
|
1; |
1; |
__END__ |
__END__ |
|
|