--- loncom/interface/lonhtmlcommon.pm 2006/06/16 22:37:10 1.134 +++ loncom/interface/lonhtmlcommon.pm 2006/06/26 22:31:56 1.137 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.134 2006/06/16 22:37:10 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.137 2006/06/26 22:31:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -99,25 +99,31 @@ sub recent_filename { } sub store_recent { - my ($area,$name,$value)=@_; + my ($area,$name,$value,$freeze)=@_; my $file=&recent_filename($area); my %recent=&Apache::lonnet::dump($file); if (scalar(keys(%recent))>20) { # remove oldest value - my $oldest=time; + my $oldest=time(); my $delkey=''; - foreach (keys %recent) { - my $thistime=(split(/\&/,$recent{$_}))[0]; - if ($thistime<$oldest) { + foreach my $item (keys(%recent)) { + my $thistime=(split(/\&/,$recent{$item}))[0]; + if (($thistime ne "always_include") && ($thistime<$oldest)) { $oldest=$thistime; - $delkey=$_; + $delkey=$item; } } &Apache::lonnet::del($file,[$delkey]); } # store new value + my $timestamp; + if ($freeze) { + $timestamp = "always_include"; + } else { + $timestamp = time(); + } &Apache::lonnet::put($file,{ $name => - time.'&'.&escape($value) }); + $timestamp.'&'.&escape($value) }); } sub remove_recent { @@ -132,11 +138,11 @@ sub select_recent { my $return="\n}; # Month my @Months = qw/January February March April May June @@ -455,7 +477,7 @@ ENDJS $result .= &mt('[_7]Select Date[_8]',$cal_link,''); } } - $result .= "\n\n"; + $result .= "\n\n"; return $result; } @@ -1244,9 +1266,9 @@ returns: nothing # $icons .= &Apache::loncommon::help_open_bug($bug); # } if ($helplink ne 'nohelp') { - $icons .= &Apache::loncommon::help_open_menu(undef,$component, + $icons .= &Apache::loncommon::help_open_menu($component, $component_help, - undef,$faq,$bug); + $faq,$bug); } if ($icons ne '') { $Str .= $icons.' ';