--- loncom/interface/lonmenu.pm 2003/04/18 00:02:34 1.62
+++ loncom/interface/lonmenu.pm 2003/08/15 13:25:28 1.83
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.62 2003/04/18 00:02:34 www Exp $
+# $Id: lonmenu.pm,v 1.83 2003/08/15 13:25:28 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -143,6 +143,9 @@ $navmaps
-//END LON-CAPA Internal
+// END LON-CAPA Internal
ENDREGTEXT
@@ -385,7 +412,6 @@ var swmenu=null;
'clearbut(2,1);clearbut(2,3);clearbut(8,1);clearbut(8,2);clearbut(8,3);'+
'clearbut(9,1);clearbut(9,2);clearbut(9,3);clearbut(6,3);clearbut(6,1)',
2000);
-
}
// END LON-CAPA Internal
@@ -437,10 +463,12 @@ ENDDONOTREGTHIS
}
sub loadevents() {
+ if ($ENV{'REQUEST_URI'} eq '/res/adm/pages/menu.html') { return ''; }
return 'LONCAPAreg();';
}
sub unloadevents() {
+ if ($ENV{'REQUEST_URI'} eq '/res/adm/pages/menu.html') { return ''; }
return 'LONCAPAstale();';
}
@@ -553,6 +581,7 @@ ENDRESIZE
window.status='Opening LON-CAPA Remote Control';
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");
+self.name='loncapaclient';
ENDOPEN
return '';
}
@@ -588,19 +617,19 @@ sub switch {
# Accessibility
if ($nobreak==2) { return ''; }
my $text=$top.' '.$bot;
- $text=~s/\- //;
+ $text=~s/\s*\-\s*//gs;
$inlineremote[10*$row+$col]="\n".($nobreak?' ':'
').
- ''.$text.' '.
+ ''.$text.' '.
($nobreak?'':$desc);
} else {
# Inline Remote
if ($nobreak==2) { return ''; }
my $text=$top.' '.$bot;
- $text=~s/\- //;
+ $text=~s/\s*\-\s*//gs;
$inlineremote[10*$row+$col]="\n".
($nobreak==3?' | '.$text.' | '.
($nobreak?'':''.$desc.'').($nobreak!=1?'':'');
@@ -685,7 +714,7 @@ sub rawconfig {
$output.=&secondlevel(
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc);
}
- } elsif (($pro=~/p(\w+)/) && ($prt)) {
+ } elsif (($pro=~/^p(\w+)/) && ($prt)) {
if (&Apache::lonnet::allowed($1,$prt)) {
$output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
}
@@ -693,6 +722,14 @@ sub rawconfig {
if ($ENV{'request.course.fn'}) {
$output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
}
+ } elsif ($pro =~ /^course_(.*)$/) {
+ # Check for permissions inside of a course
+ if (($ENV{'request.course.id'}) &&
+ (&Apache::lonnet::allowed($1,$ENV{'request.course.id'}.
+ ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))
+ )) {
+ $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
+ }
} elsif ($pro eq 'author') {
if ($author) {
if ((($prt eq 'rca') && ($ENV{'request.role'}=~/^ca/)) ||
|