--- loncom/interface/lonmenu.pm 2006/05/30 12:46:09 1.183 +++ loncom/interface/lonmenu.pm 2006/06/27 18:16:03 1.186 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.183 2006/05/30 12:46:09 www Exp $ +# $Id: lonmenu.pm,v 1.186 2006/06/27 18:16:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,7 +63,10 @@ sub initlittle { 'docs' => 'Course Documents', 'exit' => 'Exit', 'launch' => 'Launch Remote Control', - 'groups' => 'Groups'); + 'groups' => 'Course Groups', + 'gdoc' => 'Group Documents', + 'teams' => 'Teams', + ); } # ============================= This gets called at the top of the body section @@ -172,7 +175,7 @@ ENDMAINMENU $lt{'exit'} - + Logo LON-CAPA  @@ -191,14 +194,17 @@ 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 = ($is_group) ? $lt{'gdoc'} : $lt{'docs'}; $docs=(<$lt{'docs'} +$text ENDDOCS } if ($showgroups) { + my $text = ($is_group) ? $lt{'groups'} : $lt{'teams'}; $groups =(<$lt{'groups'} +$text ENDGROUPS } if ( @@ -921,12 +927,16 @@ sub rawconfig { my $con=($env{'request.state'} eq 'construct'); my $rol=$env{'request.role'}; my $requested_domain = $env{'request.role.domain'}; - foreach (@desklines) { - my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc)=split(/\:/,$_); + foreach my $line (@desklines) { + my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc)=split(/\:/,$line); $prt=~s/\$uname/$uname/g; $prt=~s/\$udom/$udom/g; $prt=~s/\$crs/$crs/g; $prt=~s/\$requested_domain/$requested_domain/g; + my $type = &Apache::loncommon::course_type(); + if ($type eq 'Group') { + $desc = &convert_menu_function($desc,$type); + } if ($pro eq 'clear') { $output.=&clear($row,$col); } elsif ($pro eq 'any') { @@ -1255,6 +1265,20 @@ 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') { + $rolename =~ s/student/member/g; + $rolename =~ s/group/team/g; + $rolename =~ s/course/group/g; + $rolename =~ s/Course/Group/g; + } + return $rolename; +} + + # ================================================================ Main Program BEGIN {