--- loncom/interface/lonmenu.pm 2002/03/21 17:53:27 1.18 +++ loncom/interface/lonmenu.pm 2002/06/14 20:02:43 1.23 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.18 2002/03/21 17:53:27 www Exp $ +# $Id: lonmenu.pm,v 1.23 2002/06/14 20:02:43 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,17 +42,21 @@ use vars qw(@desklines $readdesk); # =============================================================== Open the menu sub open { -# return(< -menu=window.open("/res/adm/pages/menu.html","LONCAPAmenu", + my $returnval=''; + unless (shift eq 'unix') { +# resizing does not work on linux because of virtual desktop sizes + $returnval.=(< ENDOPEN + return ''; } # ============================================================ Switch Menu Item @@ -62,7 +66,7 @@ sub switchmenu { my $openwin=&openmenu(); return(< - swmenu=$openwin + var swmenu=$openwin swmenu.switchbutton($row,$col,"$imgsrc","$texttop","$textbot","$action"); ENDSMENU @@ -106,7 +110,8 @@ sub openmenu { } sub rawconfig { - my $output="swmenu=".&openmenu(); + my $r = shift; + my $output="var swmenu=".&openmenu(); my $uname=$ENV{'user.name'}; my $udom=$ENV{'user.domain'}; my $adv=$ENV{'user.adv'}; @@ -149,17 +154,27 @@ sub rawconfig { } elsif ($pro eq 'author') { if ($author) { if (($prt eq 'rca') && ($ENV{'request.role'}=~/^ca/)) { + # Check that we are on the correct machine my ($cadom,$caname)= ($ENV{'request.role'}=~/(\w+)\/(\w+)$/); - $output.=switch($caname,$cadom, - $row,$col,$img,$top,$bot,$act); + my $home = &Apache::lonnet::homeserver($caname,$cadom); + if ($home eq $r->dir_config('lonHostID')) { + $output.=switch($caname,$cadom, + $row,$col,$img,$top,$bot,$act); + } } elsif ($prt eq 'any') { - $output.=switch($ENV{'user.name'},$ENV{'user.domain'}, - $row,$col,$img,$top,$bot,$act); + 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); + } } } } } + $output.="swmenu.clock.setTime(1000*".time.");"; return $output; }