--- loncom/interface/lonhtmlcommon.pm 2004/10/12 23:26:48 1.93
+++ loncom/interface/lonhtmlcommon.pm 2005/06/18 17:23:25 1.109
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.93 2004/10/12 23:26:48 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.109 2005/06/18 17:23:25 www 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;
##############################################
##############################################
@@ -80,7 +81,7 @@ sub authorbombs {
foreach (keys %bombs) {
if ($_=~/^$udom\/$uname\//) {
return '
'.
+ '">
'.
&Apache::loncommon::help_open_topic('About_Bombs');
}
}
@@ -127,11 +128,12 @@ sub select_recent {
my ($area,$fieldname,$event)=@_;
my %recent=&Apache::lonnet::dump(&recent_filename($area));
my $return="\n\n";
+ my $minuteselector = qq{};
+ my $secondselector= qq{};
+ my $cal_link = qq{};
+ #
+ if ($no_hh_mm_ss) {
+ $result .= &mt('[_1] [_2] [_3] [_4]Select Date[_5]',
+ $monthselector,$dayselector,$yearselector,
+ $cal_link,'');
+ } else {
+ $result .= &mt('[_1] [_2] [_3] [_4] [_5]m [_6]s [_7]Select Date[_8]',
+ $monthselector,$dayselector,$yearselector,
+ $hourselector,$minuteselector,$secondselector,
+ $cal_link,'');
+ }
+ $result .= "\n\n";
return $result;
}
@@ -412,8 +443,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;
}
@@ -421,8 +452,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;
}
@@ -430,28 +461,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;
}
@@ -482,11 +513,13 @@ parameter setting wizard.
##############################################
sub pjump_javascript_definition {
my $Str = <'.
"var popwin;
function openpopwin () {
popwin=open(\'\',\'popwin\',\'width=400,height=100\');".
- "popwin.document.writeln(\'$title".
+ "popwin.document.writeln(\'".$html."$title".
"".
"$heading
".
"