version 1.27, 2002/11/12 13:37:43
|
version 1.31, 2003/01/29 15:22:06
|
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); |
|
|
|
# ================================================================= 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); |
if (window.screen) { |
if (window.screen) { |
self.resizeTo(screen.availWidth-215,screen.availHeight-40); |
self.resizeTo(screen.availWidth-215,screen.availHeight-55); |
self.moveTo(190,15); |
self.moveTo(190,15); |
} |
} |
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 114 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."');"; |
} |
} |
} |
} |
|
|
Line 161 sub rawconfig {
|
Line 172 sub rawconfig {
|
} |
} |
} elsif ($pro eq 'author') { |
} elsif ($pro eq 'author') { |
if ($author) { |
if ($author) { |
if (($prt eq 'rca') && ($ENV{'request.role'}=~/^ca/)) { |
if ((($prt eq 'rca') && ($ENV{'request.role'}=~/^ca/)) || |
|
(($prt eq 'rau') && ($ENV{'request.role'}=~/^au/))) { |
# Check that we are on the correct machine |
# Check that we are on the correct machine |
my ($cadom,$caname)= |
my $cadom=$requested_domain; |
|
my $caname=$ENV{'user.name'}; |
|
if ($prt eq 'rca') { |
|
($cadom,$caname)= |
($ENV{'request.role'}=~/(\w+)\/(\w+)$/); |
($ENV{'request.role'}=~/(\w+)\/(\w+)$/); |
|
} |
|
$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 $r->dir_config('lonHostID')) { |
$output.=switch($caname,$cadom, |
$output.=switch($caname,$cadom, |
$row,$col,$img,$top,$bot,$act,$desc); |
$row,$col,$img,$top,$bot,$act,$desc); |
} |
} |
} elsif ($prt eq 'any') { |
|
my $home = &Apache::lonnet::homeserver |
|
($ENV{'user.name'},$ENV{'user.domain'}); |
|
if ($home eq $r->dir_config('lonHostID')) { |
|
$output.=switch |
|
($ENV{'user.name'},$ENV{'user.domain'}, |
|
$row,$col,$img,$top,$bot,$act,$desc); |
|
} |
|
} |
} |
} |
} |
} |
} |
Line 189 sub rawconfig {
|
Line 198 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 223 BEGIN {
|
Line 234 BEGIN {
|
$readdesk='done'; |
$readdesk='done'; |
} |
} |
} |
} |
|
|
1; |
1; |
__END__ |
__END__ |
|
|