--- loncom/interface/lonmenu.pm 2006/06/12 18:10:37 1.185
+++ loncom/interface/lonmenu.pm 2006/06/30 02:14:58 1.189
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.185 2006/06/12 18:10:37 albertel Exp $
+# $Id: lonmenu.pm,v 1.189 2006/06/30 02:14:58 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -63,7 +63,7 @@ sub initlittle {
'docs' => 'Course Documents',
'exit' => 'Exit',
'launch' => 'Launch Remote Control',
- 'groups' => 'Course Groups',
+ 'groups' => 'Groups',
'gdoc' => 'Group Documents',
'teams' => 'Teams',
);
@@ -100,11 +100,11 @@ sub menubuttons {
}
if ($env{'request.course.id'}) {
my %coursegroups;
- my $viewgrps_permission =
- &Apache::lonnet::allowed('vcg',$env{'request.course.id'});
+ my $viewgrps_permission =
+ &Apache::lonnet::allowed('vcg',$env{'request.course.id'});
if (!$viewgrps_permission) {
%coursegroups = &Apache::lonnet::get_active_groups($env{'user.domain'},$env{'user.name'},$env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'});
- }
+ }
if ((keys(%coursegroups) > 0) || ($viewgrps_permission)) {
$showgroups = 1;
}
@@ -175,11 +175,8 @@ ENDMAINMENU
$lt{'exit'}
|
-
-
- LON-CAPA
- |
-
+ LON-CAPA |
+
ENDINLINEMENU
@@ -194,22 +191,15 @@ ENDINLINEMENU
$navmaps=(<$lt{'nav'}
ENDNAV
+my $is_group = (&Apache::loncommon::course_type() eq 'Group');
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
- my $text = $lt{'docs'};
- if ($env{'course.'.$env{'request.course.id'}.'.type'} eq
- 'Group') {
- $text = $lt{'gdoc'};
- }
+ my $text = ($is_group) ? $lt{'gdoc'} : $lt{'docs'};
$docs=(<$text
ENDDOCS
}
if ($showgroups) {
- my $text = $lt{'groups'};
- if ($env{'course.'.$env{'request.course.id'}.'.type'} eq
- 'Group') {
- $text = $lt{'teams'};
- }
+ my $text = ($is_group) ? $lt{'teams'} : $lt{'groups'};
$groups =(<$text
ENDGROUPS
@@ -264,7 +254,7 @@ $groups
$remote
$lt{'roles'} |
$lt{'exit'} |
- LON-CAPA |
+LON-CAPA |
$form
@@ -940,7 +930,7 @@ sub rawconfig {
$prt=~s/\$udom/$udom/g;
$prt=~s/\$crs/$crs/g;
$prt=~s/\$requested_domain/$requested_domain/g;
- my $type = $env{'course.'.$env{'request.course.id'}.'.type'};
+ my $type = &Apache::loncommon::course_type();
if ($type eq 'Group') {
$desc = &convert_menu_function($desc,$type);
}
@@ -1272,6 +1262,8 @@ sub get_nav_status {
return $navstatus;
}
+#FIXME this needs to move into mydesktab and the other locations
+# the text is generated
sub convert_menu_function {
my ($rolename,$type) = @_;
if ($type eq 'Group') {