--- loncom/interface/lonmenu.pm 2009/11/18 04:59:56 1.302 +++ loncom/interface/lonmenu.pm 2009/12/07 20:04:18 1.309.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.302 2009/11/18 04:59:56 raeburn Exp $ +# $Id: lonmenu.pm,v 1.309.2.1 2009/12/07 20:04:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -160,6 +160,7 @@ sub prep_menuitem { # entries from mydesk.tab sub primary_menu { my $menu; + my $custommenu = &Apache::loncommon::needs_gci_custom(); # each element of @primary contains following array: # (link url, icon path, alt text, link text, condition) foreach my $menuitem (@primary_menu) { @@ -175,6 +176,10 @@ sub primary_menu { next if $$menuitem[4] eq 'onlypublic'# hide links which are && $env{'user.name'} ne 'public' # only visible to public && $env{'user.domain'} ne 'public'; # users + next if $$menuitem[4] eq 'roles' # hide links which are + && $custommenu; # not visible when GCI + next if $$menuitem[4] eq 'courses' # tabbed interface in use + && $custommenu; # next if $$menuitem[4] eq 'roles' ##show links depending on && &Apache::loncommon::show_course(); ##term 'Courses' or next if $$menuitem[4] eq 'courses' ##'Roles' wanted @@ -277,6 +282,53 @@ sub secondary_menu { return "
"; } +sub gci_secondary_menu { + my %courses = ( + 'review' => 'gci_9615072b469884921gcil1', + 'submit' => 'gci_1H96711d710194bfegcil1', + ); + my %linktext = ( + 'review' => 'Review Questions', + 'submit' => 'Submit Questions', + 'createtest' => 'Create a Test', + ); + my (%links,$current); + foreach my $key (keys(%courses)) { + $links{$key} = "javascript:switchpage('$key');"; + if ($env{'request.course.id'} eq $courses{$key}) { + $links{$key} = '/adm/navmaps'; + $current = $key; + } + } + $links{'createtest'} = "javascript:switchpage('createtest');"; + if (($ENV{'REQUEST_URI'} eq '/adm/requestcourse') || + ($env{'form.orgurl'} eq '/adm/requestcourse')) { + $current = 'createtest'; + } + my @menutabs = ('review','submit','createtest'); + if ($env{'user.adv'}) { + my $key = 'managetest'; + push(@menutabs,$key); + $linktext{$key} = 'Manage Tests'; + $links{$key} = "javascript:switchpage('$key');"; + if (($current eq '') && (($ENV{'REQUEST_URI'} eq '/adm/menu') || + ($env{'form.orgurl'} eq '/adm/menu'))) { + $current = $key; + } + } + my $tabs; + foreach my $item (@menutabs) { + if ($item eq $current) { + $tabs .= '';
- for (my $row=1; $row<=8; $row++) {
- foreach my $cat (keys(%category_members)) {
- if ($category_positions{$cat} ne "$col,$row") { next; }
- #$output.='
'.
+ ' ';
+ if (($env{'request.course.id'}) &&
+ (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
+ $output.= ''.
+ ' ';
+ }
+ $output.='';
+ for (my $row=1; $row<=8; $row++) {
+ foreach my $cat (keys(%category_members)) {
+ if ($category_positions{$cat} ne "$col,$row") { next; }
+ $output.=' | ";
+ $output.="";
+ }
+ $output.="';
+ $output.=' ';
}
- }
- $output.="'.&mt($category_names{$cat}).''; + $output.=' |