--- loncom/interface/lonmenu.pm 2015/06/17 03:57:15 1.435 +++ loncom/interface/lonmenu.pm 2015/09/14 13:45:01 1.437 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.435 2015/06/17 03:57:15 musolffc Exp $ +# $Id: lonmenu.pm,v 1.437 2015/09/14 13:45:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -634,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'}); @@ -895,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); @@ -2269,10 +2286,12 @@ sub countdown_timer { } my $duedate = &Apache::lonnet::EXT("resource.0.duedate"); my @interval=&Apache::lonnet::EXT("resource.0.interval"); + my ($timelimit,$usesdone); if (@interval > 1) { + ($timelimit,$usesdone) = split(/_/,$interval[0]); my $first_access=&Apache::lonnet::get_first_access($interval[1]); if ($first_access > 0) { - if ($first_access+$interval[0] > time) { + if ($first_access+$timelimit > time) { $hastimeleft = 1; } } @@ -2286,7 +2305,9 @@ sub countdown_timer { $currdisp = 'inline'; $collapse = '► '; if ((@interval > 1) && ($hastimeleft)) { - $donebutton = &done_button_js($interval[1]); + if ($usesdone eq 'done') { + $donebutton = &done_button_js($interval[1]); + } } } else { $currdisp = 'none';