--- loncom/interface/lonhtmlcommon.pm 2003/05/12 22:04:41 1.21 +++ loncom/interface/lonhtmlcommon.pm 2003/06/20 16:13:06 1.26 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.21 2003/05/12 22:04:41 matthew Exp $ +# $Id: lonhtmlcommon.pm,v 1.26 2003/06/20 16:13:06 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -58,6 +58,45 @@ package Apache::lonhtmlcommon; use Time::Local; use strict; + +############################################## +############################################## + +=pod + +=item textbox + +=cut + +############################################## +############################################## +sub textbox { + my ($name,$value,$size,$special) = @_; + $size = 40 if (! defined($size)); + my $Str = ''; + return $Str; +} + +############################################## +############################################## + +=pod + +=item checkbox + +=cut + +############################################## +############################################## +sub checkbox { + my ($name) = @_; + my $Str = ''; + return $Str; +} + + + ############################################## ############################################## @@ -65,6 +104,9 @@ use strict; =item &date_setter +&date_setter returns html and javascript for a compact date-setting form. +To retrieve values from it, use &get_date_from_form(). + Inputs =over 4 @@ -82,12 +124,23 @@ The current setting for this time parame An undefined value is taken to indicate the value is the current time. Also, to be explicit, a value of 'now' also indicates the current time. +=item $special + +Additional html/javascript to be associated with each element in +the date_setter. See lonparmset for example usage. + +=back + +Bugs + +The method used to restrict user input will fail in the year 2400. + =cut ############################################## ############################################## sub date_setter { - my ($formname,$dname,$currentvalue) = @_; + my ($formname,$dname,$currentvalue,$special) = @_; if (! defined($currentvalue) || $currentvalue eq 'now') { $currentvalue = time; } @@ -130,7 +183,7 @@ sub date_setter { } ENDJS - $result .= " \n"; $result .= " \n"; $result .= " \n"; $result .= "  "; - $result .= " \n"; for (my $h = 0;$h<24;$h++) { $result .= "