--- loncom/interface/lonmenu.pm 2012/05/25 23:47:16 1.369.2.8
+++ loncom/interface/lonmenu.pm 2012/05/28 14:45:20 1.369.2.10
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.8 2012/05/25 23:47:16 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.10 2012/05/28 14:45:20 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -449,7 +449,6 @@ sub create_submenu {
}
$menu .= '
'.
- '" style="padding:0;">'.
&mt($item->[1]).'';
}
}
@@ -809,9 +808,18 @@ ENDMENUITEMS
&Apache::lonhtmlcommon::add_breadcrumb_tool(
'navigation', @inlineremote[21,23]);
- if(hidden_button_check() ne 'yes') {
+ my $countdown = &countdown_timer();
+ if (&hidden_button_check() eq 'yes') {
+ if ($countdown) {
+ &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);
+ }
+ } else {
+ my @tools = @inlineremote[93,91,81,82,83];
+ if ($countdown) {
+ unshift(@tools,$countdown);
+ }
&Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'tools', @inlineremote[93,91,81,82,83]);
+ 'tools',@tools);
#publish button in construction space
if ($env{'request.state'} eq 'construct'){
@@ -1080,9 +1088,19 @@ sub switch {
}
} else {
# Inline Menu
- $inlineremote[$idx]=
+ my @tools = (93,91,81,82,83);
+ unless ($env{'request.state'} eq 'construct') {
+ push(@tools,63);
+ }
+ if (($env{'environment.icons'} eq 'iconsonly') &&
+ (grep(/^$idx$/,@tools))) {
+ $inlineremote[$idx] =
+ '';
+ } else {
+ $inlineremote[$idx] =
'';
+ }
}
return '';
}
@@ -1390,6 +1408,27 @@ END
}
+sub countdown_toggle_js {
+ return <<"END";
+
+function toggleCountdown() {
+ var countdownid = document.getElementById('duedatecountdown');
+ var currstyle = countdownid.style.display;
+ if (currstyle == 'inline') {
+ countdownid.style.display = 'none';
+ document.getElementById('ddcountcollapse').innerHTML='';
+ document.getElementById('ddcountexpand').innerHTML='◄ ';
+ } else {
+ countdownid.style.display = 'inline';
+ document.getElementById('ddcountcollapse').innerHTML='► ';
+ document.getElementById('ddcountexpand').innerHTML='';
+ }
+ return;
+}
+
+END
+}
+
sub utilityfunctions {
my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
if ($currenturl =~ m{^/adm/wrapper/ext/}
@@ -1424,6 +1463,8 @@ sub utilityfunctions {
my $esc_url=&escape($currenturl);
my $esc_symb=&escape($currentsymb);
+ my $countdown = &countdown_toggle_js();
+
return (< time) {
+ my ($collapse,$expand,$title,$currdisp);
+ my @interval=&Apache::lonnet::EXT("resource.0.interval");
+ if (@interval > 1) {
+ $currdisp = 'inline';
+ $collapse = '► ';
+ } else {
+ $currdisp = 'none';
+ $expand = '◄ ';
+ }
+ unless ($env{'environment.icons'} eq 'iconsonly') {
+ $title = &mt('Timer');
+ }
+ my $desc = &mt('Countdown to due date/time');
+ return <