--- loncom/interface/lonmenu.pm 2009/12/15 05:25:07 1.309.2.4 +++ loncom/interface/lonmenu.pm 2010/01/15 04:12:54 1.309.2.12 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.309.2.4 2009/12/15 05:25:07 raeburn Exp $ +# $Id: lonmenu.pm,v 1.309.2.12 2010/01/15 04:12:54 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -131,6 +131,7 @@ use Apache::lonhtmlcommon(); use Apache::loncommon(); use Apache::lonenc(); use Apache::lonlocal; +use Apache::loncoursequeueadmin; use LONCAPA qw(:DEFAULT :match); use HTML::Entities(); @@ -296,6 +297,9 @@ sub gci_secondary_menu { 'managetest' => '/adm/menu', ); my $current = 'managetest'; + if ($env{'form.destinationurl'} eq '/adm/gci_info') { + undef($current); + } foreach my $key (keys(%courses)) { $links{$key} = "javascript:switchpage('$key');"; if ($env{'request.course.id'} eq $courses{$key}) { @@ -1377,29 +1381,55 @@ sub inlinemenu { undef(@inlineremote); undef(%category_members); my $output; - if ($context eq 'gcicustom') { - my $createtext = &mt('Create Concept Test'); - if ($switcher) { - $createtext = &mt('Create New Test'); - } + if (($context eq 'gcicustom') || ($context eq 'gcistudent') || + ($context eq 'gcinorole')) { $output=''. ''; - if (($env{'request.course.id'}) && - (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) { - $output.= ''; + $output .= ''. +''; + if ($env{'request.course.id'}) { + if (($context eq 'gcicustom') && (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) { + $output.= '
'. '
'. '

'.&mt('Utilities').'

'. - ''; + '
choose role'.$createtext.'
'; + if ($context eq 'gcicustom') { + my $createtext = &mt('Create Concept Test'); + if ($switcher) { + $createtext = &mt('Create New Test'); + } + $output .= ''; + } if ($switcher) { $output .= ''; } - $output .= '
choose role'.$createtext.'
choose role'.$switcher.'
communication'.&mt('Send/Display Messages').'
'. - '
'. - '

'.&mt('Test Management').'

'. - ''."\n". - ''."\n". - ''."\n". - '
course contentsConcept Test Contents
assemble testAssemble Concept Test
user privs'.&mt('Manage Enrollment').'
what is new'.&mt("What's New?").'
communication'.&mt('Send/Display Messages').'
user preferences'.&mt('Set my user preferences').'
'. + ''. + '
'. + '

'.&mt('Test Management').'

'. + ''."\n". + ''."\n". + ''."\n". + ''. + '
course contentsConcept Test Contents
assemble testAssemble Concept Test
user privs'.&mt('Manage Enrollment').'
what is new'.&mt("What's New?").'
Test Statistics'.&mt("Concept Test Statistics").'
'; + } else { + my $navtext = &mt('Table of Contents'); + if ($env{'request.role.domain'} eq 'gcitest') { + $navtext = &mt('Display Test Contents'); + } + $output .= 'course contents'.$navtext.''; + } + } else { + $output.=''; + } + if ($context eq 'gcinorole') { + my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle'); + if ($queued) { + $output .= ''. + '
'. + '

'.&mt('Pending Enrollment Requests').'

'. + $queued. + '
'; + } } $output.=''; } else { @@ -1733,7 +1763,7 @@ sub utilityfunctions { my $gcimenujs; if ($custommenu) { - my %concepttests = &Apache::loncommon::existing_gcitest_courses(); + my %concepttests = &Apache::loncommon::existing_gcitest_courses('cc'); my $managetesturl = '/adm/menu'; my $createtesturl = '/adm/requestcourse'; if (($env{'request.course.id'}) && @@ -2010,7 +2040,9 @@ sub hidden_button_check { return; } if ($env{'request.role.adv'}) { - return; + unless (&Apache::loncommon::needs_gci_custom()) { + return; + } } my $buttonshide = &Apache::lonnet::EXT('resource.0.buttonshide'); return $buttonshide;