--- loncom/interface/lonmenu.pm 2006/05/30 12:46:09 1.183 +++ loncom/interface/lonmenu.pm 2006/07/14 16:46:36 1.195 @@ -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.195 2006/07/14 16:46:36 www 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' => 'Groups', + 'gdoc' => 'Group Documents', + 'teams' => 'Teams', + ); } # ============================= This gets called at the top of the body section @@ -97,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; } @@ -126,11 +129,11 @@ ENDRELOAD $lt{'docs'} ENDDOCS } - if ($showgroups) { - $groups =(<$lt{'groups'} -ENDGROUPS - } +# if ($showgroups) { +# $groups =(<$lt{'groups'} +#ENDGROUPS +# } } my $form=&serverform(); my $utility=&utilityfunctions(); @@ -172,11 +175,8 @@ ENDMAINMENU $lt{'exit'} - - Logo - LON-CAPA  - - + LON-CAPALogo + ENDINLINEMENU @@ -191,16 +191,19 @@ 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) { - $groups =(<$lt{'groups'} -ENDGROUPS - } +# if ($showgroups) { +# my $text = ($is_group) ? $lt{'teams'} : $lt{'groups'}; +# $groups =(<$text +#ENDGROUPS +# } if ( ($env{'request.noversionuri'}=~m[^/(res|public)/] && $env{'request.symb'} eq '') @@ -234,6 +237,13 @@ ENDCRELOAD if ($env{'user.adv'}) { $remote = ''.$lt{'launch'}.'' } + my $helptopic='Student_Intro'; + if ($env{'request.role'}=~/^(ca|au)/) { + $helptopic='Authoring_Intro'; + } elsif ($env{'request.role'}=~/^cc/) { + $helptopic='Course_Coordination_Intro'; + } + my $helplink=&Apache::loncommon::help_open_topic($helptopic,'Help'); return (< // BEGIN LON-CAPA Internal @@ -243,6 +253,8 @@ $utility + $reloadlink $navmaps @@ -250,8 +262,8 @@ $docs $groups $remote - - + +
$lt{'main'}$lt{'roles'}$lt{'exit'}$helplink$lt{'exit'}
$form @@ -439,10 +451,7 @@ sub innerregister { ('','',6,1,'cstr.gif','edit[_1]','resource[_2]', "go('".$cfile."');","Edit this resource"); } elsif ($editbutton eq '') { - $editbutton=&switch('','',6,1,'port.gif', - 'port-[_1]','folio[_1]', - "go('/adm/portfolio');", - "Enter my portfolio space"); + $editbutton=&clear(6,1); } } ### @@ -774,7 +783,7 @@ ENDRESIZE $returnval.=(<'.$returnval.''; @@ -921,12 +930,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 +1268,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 {