--- loncom/interface/lonhtmlcommon.pm 2005/02/17 08:29:42 1.103
+++ loncom/interface/lonhtmlcommon.pm 2006/02/22 19:22:49 1.121
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.103 2005/02/17 08:29:42 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.121 2006/02/22 19:22:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -55,10 +55,11 @@ html.
package Apache::lonhtmlcommon;
+use strict;
use Time::Local;
use Time::HiRes;
use Apache::lonlocal;
-use strict;
+use Apache::lonnet;
##############################################
##############################################
@@ -99,7 +100,7 @@ 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='';
@@ -206,6 +207,28 @@ sub checkbox {
return $Str;
}
+
+=pod
+
+=item radiobutton
+
+=cut
+
+##############################################
+##############################################
+sub radio {
+ my ($name,$checked,$value) = @_;
+ my $Str = '\n";
$result .= <
@@ -435,8 +477,8 @@ sub get_date_from_form {
my ($dname) = @_;
my ($sec,$min,$hour,$day,$month,$year);
#
- if (defined($ENV{'form.'.$dname.'_second'})) {
- my $tmpsec = $ENV{'form.'.$dname.'_second'};
+ if (defined($env{'form.'.$dname.'_second'})) {
+ my $tmpsec = $env{'form.'.$dname.'_second'};
if (($tmpsec =~ /^\d+$/) && ($tmpsec >= 0) && ($tmpsec < 60)) {
$sec = $tmpsec;
}
@@ -444,8 +486,8 @@ sub get_date_from_form {
} else {
$sec = 0;
}
- if (defined($ENV{'form.'.$dname.'_minute'})) {
- my $tmpmin = $ENV{'form.'.$dname.'_minute'};
+ if (defined($env{'form.'.$dname.'_minute'})) {
+ my $tmpmin = $env{'form.'.$dname.'_minute'};
if (($tmpmin =~ /^\d+$/) && ($tmpmin >= 0) && ($tmpmin < 60)) {
$min = $tmpmin;
}
@@ -453,28 +495,28 @@ sub get_date_from_form {
} else {
$min = 0;
}
- if (defined($ENV{'form.'.$dname.'_hour'})) {
- my $tmphour = $ENV{'form.'.$dname.'_hour'};
+ if (defined($env{'form.'.$dname.'_hour'})) {
+ my $tmphour = $env{'form.'.$dname.'_hour'};
if (($tmphour =~ /^\d+$/) && ($tmphour >= 0) && ($tmphour < 24)) {
$hour = $tmphour;
}
} else {
$hour = 0;
}
- if (defined($ENV{'form.'.$dname.'_day'})) {
- my $tmpday = $ENV{'form.'.$dname.'_day'};
+ if (defined($env{'form.'.$dname.'_day'})) {
+ my $tmpday = $env{'form.'.$dname.'_day'};
if (($tmpday =~ /^\d+$/) && ($tmpday > 0) && ($tmpday < 32)) {
$day = $tmpday;
}
}
- if (defined($ENV{'form.'.$dname.'_month'})) {
- my $tmpmonth = $ENV{'form.'.$dname.'_month'};
+ if (defined($env{'form.'.$dname.'_month'})) {
+ my $tmpmonth = $env{'form.'.$dname.'_month'};
if (($tmpmonth =~ /^\d+$/) && ($tmpmonth > 0) && ($tmpmonth < 13)) {
$month = $tmpmonth - 1;
}
}
- if (defined($ENV{'form.'.$dname.'_year'})) {
- my $tmpyear = $ENV{'form.'.$dname.'_year'};
+ if (defined($env{'form.'.$dname.'_year'})) {
+ my $tmpyear = $env{'form.'.$dname.'_year'};
if (($tmpyear =~ /^\d+$/) && ($tmpyear > 1900)) {
$year = $tmpyear - 1900;
}
@@ -505,11 +547,13 @@ parameter setting wizard.
##############################################
sub pjump_javascript_definition {
my $Str = <'; }
$output.=''.$prefix.'/';
- if ($ENV{'user.adv'}) {
+ if ($env{'user.adv'}) {
my $path=$prefix.'/';
foreach my $dir (split('/',$uri)) {
if (! $dir) { next; }
@@ -931,13 +975,14 @@ sub crumbs {
sub spellheader {
my $html=&Apache::lonxml::xmlbegin();
+ my $nothing=&javascript_nothing();
return (<
//