--- loncom/interface/lonmenu.pm 2010/03/22 15:10:10 1.320
+++ loncom/interface/lonmenu.pm 2010/04/12 15:05:45 1.325
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.320 2010/03/22 15:10:10 droeschl Exp $
+# $Id: lonmenu.pm,v 1.325 2010/04/12 15:05:45 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -109,10 +109,6 @@ Same as primary_menu() but operates on @
=item show_return_link()
-=item registerurl()
-
-This gets called in the header section
-
=item innerregister()
This gets called in order to register a URL in the body of the document
@@ -181,7 +177,7 @@ sub prep_menuitem {
return '
$link|;
+ . qq| href="$$menuitem[0]" target="_top">$link|;
}
# primary_menu() evaluates @primary_menu and returns XHTML for the menu
@@ -220,11 +216,11 @@ sub primary_menu {
if ($$menuitem[3] eq 'Help') { # special treatment for helplink
$menu .= ''.&Apache::loncommon::top_nav_help('Help').'';
} else {
- my @items = @{$menuitem};
- $items[0] = 'javascript:'.$menuitem->[0].';';
- $menu .= &prep_menuitem(\@items);
+ $menu .= prep_menuitem($menuitem);
}
}
+ $menu =~ s/\[domain\]/$env{'user.domain'}/g;
+ $menu =~ s/\[user\]/$env{'user.name'}/g;
return "";
}
@@ -301,6 +297,11 @@ sub secondary_menu {
}
sub show_return_link {
+ if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)})
+ || ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) {
+
+ return if ($env{'form.register'});
+ }
return (($env{'request.noversionuri'}=~m{^/(res|public)/} &&
$env{'request.symb'} eq '')
||
@@ -309,19 +310,12 @@ sub show_return_link {
(($env{'request.noversionuri'}=~/^\/adm\//) &&
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
($env{'request.noversionuri'}!~
- m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)])
- ));
-}
-
-
-sub registerurl {
- if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; }
- return Apache::lonxml::display_title();
+ m{^/adm/.*/(smppg|bulletinboard)($|\?)})
+ ));
}
sub innerregister {
- my ($forcereg,$titletable,$bread_crumbs) = @_;
- my ($uname,$thisdisfn);
+ my ($forcereg,$bread_crumbs) = @_;
my $const_space = ($env{'request.state'} eq 'construct');
my $is_const_dir = 0;
@@ -342,10 +336,13 @@ sub innerregister {
#SD
#course_type only Course and Community?
#
- my @crumbs = ({text => Apache::loncommon::course_type()
+ my @crumbs;
+ unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps')
+ && ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) {
+ @crumbs = ({text => Apache::loncommon::course_type()
. ' Contents',
- href => "Javascript:gopost('/adm/navmaps','')"});
-
+ href => "Javascript:gopost('/adm/navmaps','')"});
+ }
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) {
push(@crumbs, {text => '...',
no_mt => 1});
@@ -569,7 +566,7 @@ if(length($annotation) > 0){
$menuitems.="&anno-[_1]&tations[_1]&annotate()&";
$menuitems.="Make notes and annotations about this resource&&1\n";
- unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) {
+ unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {
if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) {
$menuitems.=(<