--- loncom/interface/lonmenu.pm 2005/12/01 19:00:46 1.164
+++ loncom/interface/lonmenu.pm 2006/02/21 20:14:49 1.165
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.164 2005/12/01 19:00:46 albertel Exp $
+# $Id: lonmenu.pm,v 1.165 2006/02/21 20:14:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -64,7 +64,8 @@ sub initlittle {
'Roles':'Courses'),
'docs' => 'Course Documents',
'exit' => 'Exit',
- 'launch' => 'Launch Remote Control');
+ 'launch' => 'Launch Remote Control',
+ 'groups' => 'Groups');
}
# ============================= This gets called at the top of the body section
@@ -82,6 +83,8 @@ sub menubuttons {
my $navmaps='';
my $reloadlink='';
my $docs='';
+ my $groups='';
+ my $showgroups=0;
my $escurl=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'}));
my $escsymb=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.symb'}));
my $face= 'face="Arial,Helvetica,sans-serif"';
@@ -92,6 +95,18 @@ sub menubuttons {
$escurl = &Apache::lonnet::escape($returnurl);
}
}
+ if ($env{'request.course.id'}) {
+ my %coursegroups;
+ 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;
+ }
+ }
+
if ($env{'browser.interface'} eq 'textual') {
# Textual display only
$pgbg='#FFFFFF';
@@ -114,6 +129,12 @@ ENDRELOAD
$lt{'docs'}
ENDDOCS
}
+ if ($showgroups) {
+ $groups =(<
+$lt{'groups'}
+ENDGROUPS
+ }
}
my $form=&serverform();
my $utility=&utilityfunctions();
@@ -123,7 +144,7 @@ ENDDOCS
$utility
$lt{'main'}
-$reloadlink $navmaps $docs
+$reloadlink $navmaps $docs $groups
$lt{'roles'}
$lt{'exit'}
@@ -192,6 +213,12 @@ ENDNAV
$lt{'docs'}
ENDDOCS
}
+ if ($showgroups) {
+ $groups =(<
+$lt{'groups'}
+ENDGROUPS
+ }
if (
($env{'request.noversionuri'}=~m[^/(res|public)/] &&
$env{'request.symb'} eq '')
@@ -239,6 +266,7 @@ $utility
$reloadlink
$navmaps
$docs
+$groups
$lt{'launch'} |