--- loncom/interface/lonmenu.pm 2006/05/08 22:34:01 1.180 +++ loncom/interface/lonmenu.pm 2008/12/13 15:51:51 1.239.4.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.180 2006/05/08 22:34:01 albertel Exp $ +# $Id: lonmenu.pm,v 1.239.4.1 2008/12/13 15:51:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,24 +44,44 @@ use Apache::lonhtmlcommon(); use Apache::loncommon(); use Apache::lonenc(); use Apache::lonlocal; +use LONCAPA qw(:DEFAULT :match); -use vars qw(@desklines $readdesk); +use vars qw(@desklines %category_names %category_members %category_positions $readdesk); my @inlineremote; + + # ================================================================ Little texts +sub show_course { + my $course = !$env{'user.adv'}; + if (!$env{'user.adv'}) { + foreach my $env (keys(%env)) { + next if ($env !~ m/^user\.priv\./); + if ($env !~ m/^user\.priv\.(?:st|cm)/) { + $course = 0; + last; + } + } + } + return $course; +} sub initlittle { return &Apache::lonlocal::texthash('ret' => 'Return to Last Location', 'nav' => 'Navigate Contents', 'main' => 'Main Menu', - 'roles' => ($env{'user.adv'}? - 'Roles':'Courses'), - 'docs' => 'Course Documents', + 'roles' => (&show_course()? + 'Courses':'Roles'), + 'other' => 'Other Roles', + 'docs' => 'Edit Course', 'exit' => 'Exit', + 'login' => 'Log In', 'launch' => 'Launch Remote Control', - 'groups' => 'Groups'); + 'groups' => 'Groups', + 'gdoc' => 'Group Documents', + ); } # ============================= This gets called at the top of the body section @@ -82,39 +102,50 @@ sub menubuttons { my $reloadlink=''; my $docs=''; my $groups=''; + my $roles=''.$lt{'roles'}.''; + my $role_selector; 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 ($cnum,$cdom); + 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 = '
$lt{'main'} | $reloadlink $navmaps $docs $groups -$remote -$lt{'roles'} | -$lt{'exit'} | -LON-CAPA | +$roles +$helplink | +$lt{'exit'} |
';
+ for (my $row=1; $row<=8; $row++) {
+ foreach my $cat (keys(%category_members)) {
+ if ($category_positions{$cat} ne "$col,$row") { next; }
+ $output.='
| ";
+ }
+ $output.="