[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonmenu.pm
raeburn
raeburn at source.lon-capa.org
Tue Aug 13 10:17:37 EDT 2013
raeburn Tue Aug 13 14:17:37 2013 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonmenu.pm
Log:
- For 2.11
- Backport 1.419, 1.420
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.45 loncom/interface/lonmenu.pm:1.369.2.46
--- loncom/interface/lonmenu.pm:1.369.2.45 Thu Aug 8 02:31:11 2013
+++ loncom/interface/lonmenu.pm Tue Aug 13 14:17:37 2013
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.45 2013/08/08 02:31:11 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.46 2013/08/13 14:17:37 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -281,7 +281,7 @@
push(@primsub,$item);
}
if (@primsub > 0) {
- $menu{$position} .= &create_submenu($link,$target,$title,\@primsub);
+ $menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1);
} elsif ($link) {
$menu{$position} .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>';
}
@@ -455,7 +455,7 @@
}
}
if (@scndsub > 0) {
- $menu .= &create_submenu($link,$target,$title,\@scndsub);
+ $menu .= &create_submenu($link,$target,$title,\@scndsub,1);
} elsif ($link ne '#') {
$menu .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>';
}
@@ -517,7 +517,7 @@
}
sub create_submenu {
- my ($link,$target,$title,$submenu) = @_;
+ my ($link,$target,$title,$submenu,$translate) = @_;
return unless (ref($submenu) eq 'ARRAY');
my $disptarget;
if ($target ne '') {
@@ -555,8 +555,13 @@
$borderbot = 'border-bottom:1px solid black;';
}
$menu .= '<li style="margin:0;padding:0;'.
- $borderbot.'"><a href="'.$href.'">'.
- &mt($item->[1]).'</a></li>';
+ $borderbot.'"><a href="'.$href.'">';
+ if ($translate) {
+ $menu .= &mt($item->[1]);
+ } else {
+ $menu .= $item->[1];
+ }
+ $menu .= '</a></li>';
}
}
$menu .= '</ul></li>';
@@ -2274,7 +2279,7 @@
}
}
}
- $switchtext = &mt('Switch role');
+ $switchtext = 'Switch role'; # do not translate here
my @roles_order = ($ccrole,'in','ta','ep','ad','st');
my $numdiffsec;
if (keys(%seccount) == 1) {
More information about the LON-CAPA-cvs
mailing list