--- loncom/interface/lonmenu.pm 2010/01/18 20:28:20 1.244.2.8
+++ loncom/interface/lonmenu.pm 2010/01/18 21:58:59 1.244.2.13
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.244.2.8 2010/01/18 20:28:20 raeburn Exp $
+# $Id: lonmenu.pm,v 1.244.2.13 2010/01/18 21:58:59 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -120,11 +120,6 @@ The javascript is usually similar to "go
=item get_nav_status()
-=item convert_menu_function()
-
-FIXME this needs to move into mydesktab and the other locations
-the text is generated
-
=item hidden_button_check()
=item roles_selector()
@@ -179,7 +174,7 @@ sub initlittle {
'login' => 'Log In',
'launch' => 'Launch Remote Control',
'groups' => 'Groups',
- 'gdoc' => 'Group Documents',
+ 'gdoc' => 'Community Documents',
);
}
@@ -247,9 +242,12 @@ ENDNAV
$lt{'ret'}
ENDRELOAD
}
- if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
- $docs=(<$lt{'docs'}
+ my $is_community =
+ (&Apache::loncommon::course_type() eq 'Community');
+ if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+ my $text = ($is_community) ? $lt{'gdoc'} : $lt{'docs'};
+ $docs=(<$text
ENDDOCS
}
if ($showgroups) {
@@ -314,9 +312,10 @@ ENDINLINEMENU
$navmaps=(<$lt{'nav'}
ENDNAV
- my $is_group = (&Apache::loncommon::course_type() eq 'Group');
+ my $is_community =
+ (&Apache::loncommon::course_type() eq 'Community');
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
- my $text = ($is_group) ? $lt{'gdoc'} : $lt{'docs'};
+ my $text = ($is_community) ? $lt{'gdoc'} : $lt{'docs'};
$docs=(<$text
ENDDOCS
@@ -577,10 +576,22 @@ sub innerregister {
}
# Finally, turn the button on or off
if ($cfile && !$const_space) {
- $editbutton=&switch
- ('','',6,1,'pcstr.gif','edit[_1]','resource[_2]',
+ my $nocrsedit;
+ # Suppress display where CC has switched to student role.
+ if ($env{'request.course.id'}) {
+ unless(&Apache::lonnet::allowed('mdc',
+ $env{'request.course.id'})) {
+ $nocrsedit = 1;
+ }
+ }
+ if ($nocrsedit) {
+ $editbutton=&clear(6,1);
+ } else {
+ $editbutton=&switch
+ ('','',6,1,'pcstr.gif','edit[_1]','resource[_2]',
"go('".$cfile."');","Edit this resource");
- $noeditbutton = 0;
+ $noeditbutton = 0;
+ }
} elsif ($editbutton eq '') {
$editbutton=&clear(6,1);
}
@@ -656,7 +667,7 @@ $menuitems.="Make notes and annotations
}
}
unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) {
- if (!$env{'request.enc'}) {
+ if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) {
$menuitems.=(< 1) {
$role_selector = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles);
$role_selector .= '