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

raeburn raeburn at source.lon-capa.org
Wed Jun 26 00:27:38 EDT 2013


raeburn		Wed Jun 26 04:27:38 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonmenu.pm 
  Log:
  - For 2.11
    - Backport 1.416.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.42 loncom/interface/lonmenu.pm:1.369.2.43
--- loncom/interface/lonmenu.pm:1.369.2.42	Sun May 26 22:42:06 2013
+++ loncom/interface/lonmenu.pm	Wed Jun 26 04:27:38 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.369.2.42 2013/05/26 22:42:06 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.43 2013/06/26 04:27:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -432,7 +432,7 @@
             } else {
                 $link = '#';
             }
-            my @scndsub;   
+            my @scndsub;
             if (ref($secondary_submenu{$title}) eq 'ARRAY') {
                 foreach my $item (@{$secondary_submenu{$title}}) {
                     if (ref($item) eq 'ARRAY') {
@@ -535,16 +535,18 @@
     foreach my $item (@{$submenu}) {
         $count ++;
         if (ref($item) eq 'ARRAY') {
+            my $href = $item->[0];
+            if ($href =~ /(aboutme|rss\.html)$/) {
+                next unless (($env{'user.name'} ne '') && ($env{'user.domain'} ne ''));
+                $href =~ s/\[domain\]/$env{'user.domain'}/g;
+                $href =~ s/\[user\]/$env{'user.name'}/g;
+            }
             my $borderbot;
             if ($count == $numsub) {
                 $borderbot = 'border-bottom:1px solid black;';
             }
-            if ($item->[0] =~ /(aboutme|rss\.html)$/) {
-                $item->[0] =~ s/\[domain\]/$env{'user.domain'}/g;
-                $item->[0] =~ s/\[user\]/$env{'user.name'}/g;
-            }
             $menu .= '<li style="margin:0;padding:0;'.
-                     $borderbot.'"><a href="'.$item->[0].'">'.
+                     $borderbot.'"><a href="'.$href.'">'.
                      &mt($item->[1]).'</a></li>';
         }
     }




More information about the LON-CAPA-cvs mailing list