--- loncom/interface/lonmenu.pm 2012/05/28 19:00:58 1.379 +++ loncom/interface/lonmenu.pm 2012/09/04 20:47:56 1.386 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.379 2012/05/28 19:00:58 raeburn Exp $ +# $Id: lonmenu.pm,v 1.386 2012/09/04 20:47:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -247,9 +247,7 @@ sub primary_menu { my @primsub; if (ref($primary_submenu{$title}) eq 'ARRAY') { foreach my $item (@{$primary_submenu{$title}}) { - next if (($item->[2] eq 'wishlist') && - ((!&Apache::lonnet::allowed('bre',"/res/$env{'user.domain'}/")) && - (!&Apache::lonnet::allowed('bro',"/res/$env{'user.domain'}/")))); + next if (($item->[2] eq 'wishlist') && (!$env{'user.adv'})); next if (($item->[2] eq 'reqcrs') && (!&check_for_rcrs())); next if ((($item->[2] eq 'portfolio') || ($item->[2] eq 'blog')) && @@ -395,8 +393,10 @@ sub secondary_menu { } $menu =~ s/\[uname\]/$$author{user}/g; $menu =~ s/\[udom\]/$$author{dom}/g; - - return ""; + if ($menu) { + $menu = ""; + } + return $menu; } sub create_submenu { @@ -663,7 +663,7 @@ sub innerregister { ### ### # Prepare the rest of the buttons - my $menuitems; + my ($menuitems,$got_prt,$got_wishlist); if ($const_space) { # # We are in construction space @@ -699,7 +699,7 @@ ENDMENUITEMS } elsif ( defined($env{'request.course.id'}) && $env{'request.symb'} ne '' ) { # -# We are in a course and looking at a registred URL +# We are in a course and looking at a registered URL # Should probably be in mydesk.tab # $menuitems=(<'.&Apache::lonnet::plaintext($role).''; } } - $role_selector .= ''."\n". + $role_selector .= ''."\n"; + if ($destsymb ne '') { + $role_selector .= ''."\n"; + } + $role_selector .= ''."\n". ''."\n". @@ -1814,10 +1846,20 @@ sub countdown_timer { ($env{'request.filename'}=~/$LONCAPA::assess_re/) && ($Apache::inputtags::status[-1] eq 'CAN_ANSWER')) { my $duedate = &Apache::lonnet::EXT("resource.0.duedate"); - if ($duedate && $duedate > time) { + my @interval=&Apache::lonnet::EXT("resource.0.interval"); + my $hastimeleft; + if (@interval > 1) { + my $first_access=&Apache::lonnet::get_first_access($interval[1]); + if ($first_access > 0) { + if ($first_access+$interval[0] > time) { + $hastimeleft = 1; + } + } + } + if (($duedate && $duedate > time) || + (!$duedate && $hastimeleft)) { my ($collapse,$expand,$alttxt,$title,$currdisp); - my @interval=&Apache::lonnet::EXT("resource.0.interval"); - if (@interval > 1) { + if (@interval > 1 && $hastimeleft) { $currdisp = 'inline'; $collapse = '► '; } else {