--- loncom/interface/lonhtmlcommon.pm 2004/10/12 22:55:21 1.92 +++ loncom/interface/lonhtmlcommon.pm 2006/06/22 15:53:48 1.135 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.92 2004/10/12 22:55:21 albertel Exp $ +# $Id: lonhtmlcommon.pm,v 1.135 2006/06/22 15:53:48 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -55,10 +55,13 @@ html. package Apache::lonhtmlcommon; +use strict; use Time::Local; use Time::HiRes; use Apache::lonlocal; -use strict; +use Apache::lonnet; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; ############################################## ############################################## @@ -80,7 +83,7 @@ sub authorbombs { foreach (keys %bombs) { if ($_=~/^$udom\/$uname\//) { return ''. + '">'. &Apache::loncommon::help_open_topic('About_Bombs'); } } @@ -92,14 +95,14 @@ sub authorbombs { sub recent_filename { my $area=shift; - return 'nohist_recent_'.&Apache::lonnet::escape($area); + return 'nohist_recent_'.&escape($area); } sub store_recent { my ($area,$name,$value)=@_; my $file=&recent_filename($area); my %recent=&Apache::lonnet::dump($file); - if (scalar(keys(%recent))>10) { + if (scalar(keys(%recent))>20) { # remove oldest value my $oldest=time; my $delkey=''; @@ -114,7 +117,7 @@ sub store_recent { } # store new value &Apache::lonnet::put($file,{ $name => - time.'&'.&Apache::lonnet::escape($value) }); + time.'&'.&escape($value) }); } sub remove_recent { @@ -127,12 +130,13 @@ sub select_recent { my ($area,$fieldname,$event)=@_; my %recent=&Apache::lonnet::dump(&recent_filename($area)); my $return="\n'; return $Str; @@ -181,6 +215,28 @@ sub checkbox { return $Str; } + +=pod + +=item radiobutton + +=cut + +############################################## +############################################## +sub radio { + my ($name,$checked,$value) = @_; + my $Str = ' + ENDJS - $result .= " }; # Month my @Months = qw/January February March April May June July August September October November December/; # Pad @Months with a bogus value to make indexing easier unshift(@Months,'If you can read this an error occurred'); - if ($includeempty) { $result.=""; } + if ($includeempty) { $monthselector.=""; } for(my $m = 1;$m <=$#Months;$m++) { - $result .= "