--- loncom/interface/lonhtmlcommon.pm 2009/12/11 17:25:01 1.254
+++ loncom/interface/lonhtmlcommon.pm 2009/12/22 17:27:28 1.257
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.254 2009/12/11 17:25:01 bisitz Exp $
+# $Id: lonhtmlcommon.pm,v 1.257 2009/12/22 17:27:28 faziophi Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -384,7 +384,7 @@ dname_hour, dname_min, and dname_sec.
The current setting for this time parameter. A unix format time
(time in seconds since the beginning of Jan 1st, 1970, GMT.
An undefined value is taken to indicate the value is the current time
-unless it is requested to leave it empty. See $includeempty.
+unless it is requested to leave it empty. See $includeempty.
Also, to be explicit, a value of 'now' also indicates the current time.
=item $special
@@ -418,8 +418,8 @@ sub date_setter {
my $now = time;
my $tzname;
- my ($sec,$min,$hour,$mday,$month,$year) = ('','',undef,'','','');
- # other potentially useful values: wkday,yrday,is_daylight_savings
+ my ($sec,$min,$hour,$mday,$month,$year) = ('', '', undef,''.''.'');
+ #other potentially useful values: wkday,yrday,is_daylight_savings
if (! defined($state) || $state ne 'disabled') {
$state = '';
@@ -427,29 +427,26 @@ sub date_setter {
if (! defined($no_hh_mm_ss)) {
$no_hh_mm_ss = 0;
}
-
if ($currentvalue eq 'now') {
$currentvalue = $now;
}
-
+
# Default value: Set empty date field to current time
# unless empty inclusion is requested
if ((!$includeempty) && (!$currentvalue)) {
- $currentvalue = $now;
+ $currentvalue = $now;
}
# Do we have a date? Split it!
if ($currentvalue) {
- ($tzname,$sec,$min,$hour,$mday,$month,$year) = &get_timedates($currentvalue);
+ ($tzname,$sec,$min,$hour,$mday,$month,$year) = &get_timedates($currentvalue);
- # No values provided for hour, min, sec? Use default 0
+ #No values provided for hour, min, sec? Use default 0
if (($defhour) || ($defmin) || ($defsec)) {
$sec = ($defsec ? $defsec : 0);
$min = ($defmin ? $defmin : 0);
$hour = ($defhour ? $defhour : 0);
}
}
-
- # Create Output
my $result = "\n\n";
$result .= <
@@ -1243,11 +1240,18 @@ ENDLINK
}
sub htmlareaheaders {
- return if (&htmlareablocked());
- return if (!&htmlareabrowser());
- return (<
-ENDHEADERS
+
+ENDEDITOR
+ }
+ $s.=(<
+
+ENDJQUERY
+ return $s;
}
# ----------------------------------------------------------------- Preferences
@@ -1286,16 +1290,98 @@ sub htmlareaselectactive {
my $output='