--- loncom/interface/lonmenu.pm 2006/05/30 20:09:25 1.184 +++ loncom/interface/lonmenu.pm 2006/07/19 10:52:27 1.199 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.184 2006/05/30 20:09:25 raeburn Exp $ +# $Id: lonmenu.pm,v 1.199 2006/07/19 10:52:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,9 +63,8 @@ sub initlittle { 'docs' => 'Course Documents', 'exit' => 'Exit', 'launch' => 'Launch Remote Control', - 'groups' => 'Course Groups', + 'groups' => 'Groups', 'gdoc' => 'Group Documents', - 'teams' => 'Teams', ); } @@ -91,6 +90,10 @@ sub menubuttons { my $escurl=&escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'})); my $escsymb=&escape(&Apache::lonenc::check_encrypt($env{'request.symb'})); + my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); + $logo = 'LON-CAPA Logo'; + if ($env{'request.state'} eq 'construct') { if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) { my $returnurl = $env{'request.filename'}; @@ -100,11 +103,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'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')); 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; } @@ -131,7 +134,7 @@ ENDDOCS } if ($showgroups) { $groups =(<$lt{'groups'} +$lt{'groups'} ENDGROUPS } } @@ -168,18 +171,15 @@ ENDMAINMENU my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain); my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') { - my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); return (< - + $logo + + $lt{'exit'} - - Logo - LON-CAPA  - - + ENDINLINEMENU @@ -194,24 +194,16 @@ 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'}; - } $groups =(<$text +$lt{'groups'} ENDGROUPS } if ( @@ -242,11 +234,12 @@ ENDCRELOAD } my $form=&serverform(); my $utility=&utilityfunctions(); - my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); my $remote; if ($env{'user.adv'}) { $remote = ''.$lt{'launch'}.'' } + + my $helplink=&Apache::loncommon::top_nav_help('Help'); return (< // BEGIN LON-CAPA Internal @@ -256,6 +249,7 @@ $utility +$logo $reloadlink $navmaps @@ -263,8 +257,8 @@ $docs $groups $remote - - + +
$lt{'main'}$lt{'roles'}$lt{'exit'}$helplink$lt{'exit'}
$form @@ -393,7 +387,7 @@ sub innerregister { &Apache::lonnet::allowed('opa',$crs)) { $hwkadd.=&switch('','',7,3,'pparm.gif','problem[_2]','parms[_2]', "gocmd('/adm/parmset','set')", - 'Modify deadlines, etc, for this resource'); + 'Modify parameter settings for this resource'); } # -- End Homework ### @@ -452,10 +446,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); } } ### @@ -787,7 +778,7 @@ ENDRESIZE $returnval.=(<'.$returnval.''; @@ -940,7 +931,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 +1263,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') {