[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /interface lonmenu.pm
raeburn
raeburn@source.lon-capa.org
Wed, 26 May 2010 19:50:46 -0000
raeburn Wed May 26 19:50:46 2010 EDT
Modified files: (Branch: version_2_10_X)
/loncom/interface lonmenu.pm
Log:
- Backport 1.319, 1.320, 1.322, 1.323, 1.324, 1.326.
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.315 loncom/interface/lonmenu.pm:1.315.2.1
--- loncom/interface/lonmenu.pm:1.315 Wed Mar 3 21:33:15 2010
+++ loncom/interface/lonmenu.pm Wed May 26 19:50:46 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.315 2010/03/03 21:33:15 droeschl Exp $
+# $Id: lonmenu.pm,v 1.315.2.1 2010/05/26 19:50:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -220,6 +220,11 @@
my $menu;
# each element of @primary contains following array:
# (link url, icon path, alt text, link text, condition)
+ my $public;
+ if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
+ || (($env{'user.name'} eq '') && ($env{'user.domain'} eq ''))) {
+ $public = 1;
+ }
foreach my $menuitem (@primary_menu) {
# evaluate conditions
next if ref($menuitem) ne 'ARRAY'; #
@@ -227,18 +232,18 @@
&& &Apache::lonmsg::mynewmail(); # whether a new msg
next if $$menuitem[4] eq 'newmsg' # arrived or not
&& !&Apache::lonmsg::mynewmail(); #
- next if $$menuitem[4] !~ /public/ ##we've a public user,
- && $env{'user.name'} eq 'public' ##who should not see all
- && $env{'user.domain'} eq 'public'; ##links
- next if $$menuitem[4] eq 'onlypublic'# hide links which are
- && $env{'user.name'} ne 'public' # only visible to public
- && $env{'user.domain'} ne 'public'; # users
+ next if $$menuitem[4] !~ /public/ ##we've a public user,
+ && $public; ##who should not see all
+ ##links
+ next if $$menuitem[4] eq 'onlypublic'# hide links which are
+ && !$public; # only visible to public
+ # users
next if $$menuitem[4] eq 'roles' ##show links depending on
- && &Apache::loncommon::show_course(); ##term 'Courses' or
+ && &Apache::loncommon::show_course(); ##term 'Courses' or
next if $$menuitem[4] eq 'courses' ##'Roles' wanted
&& !&Apache::loncommon::show_course(); ##
-
-
+
+
if ($$menuitem[3] eq 'Help') { # special treatment for helplink
$menu .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>';
} else {
@@ -336,6 +341,11 @@
}
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 '')
||
@@ -344,7 +354,7 @@
(($env{'request.noversionuri'}=~/^\/adm\//) &&
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
($env{'request.noversionuri'}!~
- m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)])
+ m[^/adm/.*/(smppg|bulletinboard)($|\?)])
));
}
@@ -417,9 +427,12 @@
} else {
$contentstext = &mt('Course Contents');
}
- my @crumbs = ({text => $contentstext,
- href => "Javascript:gonav('/adm/navmaps')"});
-
+ my @crumbs;
+ unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps')
+ && ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) {
+ @crumbs = ({text => $contentstext,
+ href => "Javascript:gopost('/adm/navmaps','')"});
+ }
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) {
push(@crumbs, {text => '...',
no_mt => 1});
@@ -663,7 +676,7 @@
"&go('/adm/requestcourse')&Course requests\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.=(<<ENDREALRES);
s&6&3&catalog.gif&catalog[_2]&info[_1]&catalog_info()&Show Metadata
@@ -722,10 +735,11 @@
Apache::lonhtmlcommon::add_breadcrumb_tool(
'tools', @inlineremote[63]);
}
-
- Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'advtools', @inlineremote[61,71,72,73,92]);
+ unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {
+ Apache::lonhtmlcommon::add_breadcrumb_tool(
+ 'advtools', @inlineremote[61,71,72,73,92]);
+ }
}
# # Registered, textual output
@@ -1666,7 +1680,7 @@
go('');
w_BookmarkPal_flag=1;
bookmarkpal=window.open("/adm/bookmarks",
- "BookmarkPal", "width=400,height=505,scrollbars=0");
+ "BookmarkPal", "width=500,height=505,scrollbars=0");
}
function annotate() {