Diff for /loncom/interface/lonmenu.pm between versions 1.309.2.18 and 1.309.2.20

version 1.309.2.18, 2010/11/08 22:51:23 version 1.309.2.20, 2010/12/02 13:07:08
Line 168  sub primary_menu { Line 168  sub primary_menu {
     my $numdc = &Apache::loncommon::check_for_gci_dc();      my $numdc = &Apache::loncommon::check_for_gci_dc();
     # each element of @primary contains following array:      # each element of @primary contains following array:
     # (link url, icon path, alt text, link text, condition)      # (link url, icon path, alt text, link text, condition)
       my $public;
       if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
           || (($env{'user.name'} eq '') && ($env{'user.domain'} eq ''))) {
           $public = 1;
       }
     foreach my $menuitem (@primary_menu) {      foreach my $menuitem (@primary_menu) {
         # evaluate conditions           # evaluate conditions 
         next if    ref($menuitem)       ne 'ARRAY';    #          next if    ref($menuitem)       ne 'ARRAY';    #
Line 176  sub primary_menu { Line 181  sub primary_menu {
         next if    $$menuitem[4]        eq 'newmsg'    # arrived or not          next if    $$menuitem[4]        eq 'newmsg'    # arrived or not
                 && !&Apache::lonmsg::mynewmail();      #                   && !&Apache::lonmsg::mynewmail();      # 
         next if    $$menuitem[4]        !~ /public/    ##we've a public user,           next if    $$menuitem[4]        !~ /public/    ##we've a public user, 
                 && $env{'user.name'}    eq 'public'    ##who should not see all                   && $public;                            ##who should not see all 
                 && $env{'user.domain'}  eq 'public';   ##links                                                         ##links
         next if    $$menuitem[4]        eq 'onlypublic'# hide links which are           next if    $$menuitem[4]        eq 'onlypublic'# hide links which are 
                 && $env{'user.name'}    ne 'public'    # only visible to public                  && !$public;                           # only visible to public
                 && $env{'user.domain'}  ne 'public';   # users                                                         # users
         next if    $$menuitem[4]        eq 'gci'          next if    $$menuitem[4]        eq 'gci'
                 && (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/});                  && (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/});
         next if    $$menuitem[4]        eq 'home'          next if    $$menuitem[4]        eq 'home'
Line 199  sub primary_menu { Line 204  sub primary_menu {
                   
                           
         if ($$menuitem[3] eq 'Help') { # special treatment for helplink          if ($$menuitem[3] eq 'Help') { # special treatment for helplink
             $menu .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>';              if ($public) {
                   my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
                   my $defdom = &Apache::lonnet::default_login_domain();
                   my $to = &Apache::loncommon::build_recipient_list(undef,
                                                                     'helpdeskmail',
                                                                     $defdom,$origmail);
                   if ($to ne '') {
                       $menu .= &prep_menuitem($menuitem);
                   }
               } else {
                   $menu .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>';
               }
         } else {          } else {
             my @items = @{$menuitem};              my @items = @{$menuitem};
             $items[0] = 'javascript:'.$menuitem->[0].';';              $items[0] = 'javascript:'.$menuitem->[0].';';

Removed from v.1.309.2.18  
changed lines
  Added in v.1.309.2.20


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>