[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm

raeburn raeburn at source.lon-capa.org
Mon Jun 7 01:59:43 EDT 2021


raeburn		Mon Jun  7 05:59:43 2021 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - Bug 6907
    - Display name at top left when settings for menu collection in effect
      include it, but "Personal" drop-down list is empty or not not included.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.507 loncom/interface/lonmenu.pm:1.508
--- loncom/interface/lonmenu.pm:1.507	Mon Jun  7 03:32:02 2021
+++ loncom/interface/lonmenu.pm	Mon Jun  7 05:59:43 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.507 2021/06/07 03:32:02 raeburn Exp $
+# $Id: lonmenu.pm,v 1.508 2021/06/07 05:59:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -316,7 +316,21 @@
             $position = 'right';
         }
         if ($env{'request.course.id'} && $menucoll) {
-             next if (($menuitem->[6]) && (!$menuopts{$menuitem->[6]}));
+            if (($menuitem->[6]) && (!$menuopts{$menuitem->[6]})) {
+                if ($menuitem->[6] eq 'pers') {
+                    if ($menuopts{'name'} && !$ltiexc{'fullname'} &&
+                        $env{'user.name'} && $env{'user.domain'}) {
+                        $menu{$position} .= '<li><a href="#">'.
+                            &Apache::loncommon::plainname($env{'user.name'},
+                                                          $env{'user.domain'}).'</a></li>';
+                        next;
+                    } else {
+                        next;
+                    }
+                } else {
+                    next;
+                }
+            }
         }
         if (defined($primary_submenu{$title})) {
             my ($link,$target);
@@ -342,11 +356,14 @@
                     }
                     push(@primsub,$item);
                 }
-                if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'} ) {
-                    unless (($ltiexc{'fullname'}) || 
-                            (($env{'request.course.id'}) && ($menucoll) && (!$menuopts{'name'}))) {
-                        $title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
+                if ($title eq 'Personal') {
+                    if ($env{'user.name'} && $env{'user.domain'} && !$ltiexc{'fullname'}) {
+                        unless (($env{'request.course.id'}) && ($menucoll) && (!$menuopts{'name'})) {
+                            $title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
+                        }
                     }
+                    next if (($env{'request.course.id'}) && ($menucoll) && ($title eq 'Personal') &&
+                             (!@primsub));
                 } else {
                     $title = &mt($title);
                 }




More information about the LON-CAPA-cvs mailing list