--- loncom/interface/lonmenu.pm 2006/06/12 18:10:37 1.185 +++ 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.185 2006/06/12 18:10:37 albertel Exp $ +# $Id: lonmenu.pm,v 1.186 2006/06/27 18:16:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -194,22 +194,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{'groups'} : $lt{'teams'}; $groups =(<$text ENDGROUPS @@ -940,7 +933,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 +1265,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') {