--- loncom/interface/lonmenu.pm 2013/12/27 19:10:02 1.369.2.49
+++ loncom/interface/lonmenu.pm 2014/02/23 22:36:16 1.369.2.51
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.49 2013/12/27 19:10:02 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.51 2014/02/23 22:36:16 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -562,8 +562,11 @@ sub create_submenu {
if ($count == $numsub) {
$borderbot = 'border-bottom:1px solid black;';
}
+ unless (($href eq '') || ($href =~ /^\#/)) {
+ $target = ' target="_top"';
+ }
$menu .= '
';
+ $borderbot.'">';
if ($translate) {
$menu .= &mt($item->[1]);
} else {
@@ -1709,7 +1712,10 @@ sub rawconfig {
my $pub=($env{'request.state'} eq 'published');
my $con=($env{'request.state'} eq 'construct');
my $rol=$env{'request.role'};
- my $requested_domain = $env{'request.role.domain'};
+ my $requested_domain;
+ if ($rol) {
+ $requested_domain = $env{'request.role.domain'};
+ }
foreach my $line (@desklines) {
my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc,$cat)=split(/\:/,$line);
$prt=~s/\$uname/$uname/g;
@@ -1723,7 +1729,13 @@ sub rawconfig {
next if ($crstype ne 'Community');
$prt=~s/\$cmty/$crs/g;
}
- $prt=~s/\$requested_domain/$requested_domain/g;
+ if ($prt =~ m/\$requested_domain/) {
+ if ((!$requested_domain) && ($pro eq 'pbre') && ($env{'user.adv'})) {
+ $prt=~s/\$requested_domain/$env{'user.domain'}/g;
+ } else {
+ $prt=~s/\$requested_domain/$requested_domain/g;
+ }
+ }
if ($category_names{$cat}!~/\w/) { $cat='oth'; }
if ($pro eq 'clear') {
$output.=&clear($row,$col);
@@ -1759,8 +1771,9 @@ sub rawconfig {
next;
}
}
- if (&Apache::lonnet::allowed($priv,$prt)) {
- $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat);
+ if ((($priv eq 'bre') && (&Apache::lonnet::allowed($priv,$prt) eq 'F')) ||
+ (($priv ne 'bre') && (&Apache::lonnet::allowed($priv,$prt)))) {
+ $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat);
}
} elsif ($pro eq 'course') {
if (($env{'request.course.fn'}) && ($crstype ne 'Community')) {