--- loncom/interface/lonmenu.pm 2015/05/28 12:37:14 1.431.2.4
+++ loncom/interface/lonmenu.pm 2015/07/17 19:11:06 1.436
@@ -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.436 2015/07/17 19:11:06 raeburn 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.
''.
' ▼'.
'';
@@ -639,8 +634,18 @@ sub innerregister {
&& $maptitle ne $coursetitle);
push @crumbs, {text => $restitle, no_mt => 1} if $restitle;
+ my @tools;
+ if ($env{'request.filename'} =~ /\.page$/) {
+ my %breadcrumb_tools = &Apache::lonhtmlcommon::current_breadcrumb_tools();
+ if (ref($breadcrumb_tools{'tools'}) eq 'ARRAY') {
+ @tools = @{$breadcrumb_tools{'tools'}};
+ }
+ }
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb(@crumbs);
+ if (@tools) {
+ &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',@tools);
+ }
} else {
$resurl = $env{'request.noversionuri'};
my $courseurl = &Apache::lonnet::courseid_to_courseurl($env{'request.course.id'});
@@ -900,13 +905,20 @@ ENDMENUITEMS
my $addremote=0;
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
if ($addremote) {
-
+ my $countdown;
+ if ($env{'request.filename'} =~ /\.page$/) {
+ my %breadcrumb_tools = &Apache::lonhtmlcommon::current_breadcrumb_tools();
+ if (ref($breadcrumb_tools{'tools'}) eq 'ARRAY') {
+ $countdown = $breadcrumb_tools{'tools'}[0];
+ }
+ } else {
+ $countdown = &countdown_timer();
+ }
&Apache::lonhtmlcommon::clear_breadcrumb_tools();
&Apache::lonhtmlcommon::add_breadcrumb_tool(
'navigation', @inlineremote[21,23]);
- my $countdown = &countdown_timer();
if (&hidden_button_check() eq 'yes') {
if ($countdown) {
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);
@@ -932,8 +944,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 +1872,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 +1960,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 +2015,7 @@ sub roles_selector {
}
}
if (@submenu > 0) {
- $switcher = &create_submenu('','',$switchtext,\@submenu);
+ $switcher = &create_submenu('','',&mt('Switch role'),\@submenu);
}
}
return ($js,$form,$switcher);