--- loncom/interface/lonmenu.pm 2015/05/28 12:37:14 1.431.2.4
+++ loncom/interface/lonmenu.pm 2015/06/17 03:57:15 1.435
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.431.2.4 2015/05/28 12:37:14 raeburn Exp $
+# $Id: lonmenu.pm,v 1.435 2015/06/17 03:57:15 musolffc Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -288,6 +288,11 @@ sub primary_menu {
push(@primsub,$item);
}
if (@primsub > 0) {
+ if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'} ) {
+ $title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
+ } else {
+ $title = &mt($title);
+ }
$menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1);
} elsif ($link) {
$menu{$position} .= '
'.&mt($title).'';
@@ -510,19 +515,9 @@ sub create_submenu {
if ($target ne '') {
$disptarget = ' target="'.$target.'"';
}
- my $name;
- if ($title eq 'Personal') {
- if ($env{'user.name'} && $env{'user.domain'}) {
- $name = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'});
- } else {
- $name = &mt($title);
- }
- } else {
- $name = &mt($title);
- }
my $menu = ''.
''.
- ''.$name.
+ ''.$title.
''.
' ▼'.
'';
@@ -932,8 +927,8 @@ ENDMENUITEMS
}
my ($topic_help,$topic_help_text);
if ($is_const_dir == 2) {
- if ((($ENV{'SERVER_PORT'} == 443) ||
- ($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) &&
+ if ((($ENV{'SERVER_PORT'} == 443) ||
+ ($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) &&
(&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},'webdav'))) {
$topic_help = 'Authoring_WebDAV,Authoring_WebDAV_Mac_10v6,Authoring_WebDAV_Mac_10v10,'.
'Authoring_WebDAV_Windows_v7,Authoring_WebDAV_Linux_Centos';
@@ -1860,7 +1855,7 @@ sub roles_selector {
my $now = time;
my (%courseroles,%seccount,%courseprivs);
my $is_cc;
- my ($js,$form,$switcher,$switchtext);
+ my ($js,$form,$switcher);
my $ccrole;
if ($crstype eq 'Community') {
$ccrole = 'co';
@@ -1948,7 +1943,6 @@ sub roles_selector {
}
}
}
- $switchtext = 'Switch role'; # do not translate here
my @roles_order = ($ccrole,'in','ta','ep','ad','st');
my $numdiffsec;
if (keys(%seccount) == 1) {
@@ -2004,7 +1998,7 @@ sub roles_selector {
}
}
if (@submenu > 0) {
- $switcher = &create_submenu('','',$switchtext,\@submenu);
+ $switcher = &create_submenu('','',&mt('Switch role'),\@submenu);
}
}
return ($js,$form,$switcher);