--- loncom/interface/lonhtmlcommon.pm 2003/06/19 15:02:37 1.25 +++ loncom/interface/lonhtmlcommon.pm 2003/12/29 19:01:27 1.36 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.25 2003/06/19 15:02:37 matthew Exp $ +# $Id: lonhtmlcommon.pm,v 1.36 2003/12/29 19:01:27 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -56,8 +56,48 @@ html. package Apache::lonhtmlcommon; use Time::Local; +use Apache::lonlocal; 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; +} + + + ############################################## ############################################## @@ -85,6 +125,11 @@ 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 @@ -96,7 +141,7 @@ The method used to restrict user input w ############################################## ############################################## sub date_setter { - my ($formname,$dname,$currentvalue) = @_; + my ($formname,$dname,$currentvalue,$special) = @_; if (! defined($currentvalue) || $currentvalue eq 'now') { $currentvalue = time; } @@ -137,9 +182,19 @@ sub date_setter { document.$formname.$dname\_day.value = 30; } } + + function $dname\_opencalendar() { + var calwin=window.open( +"/adm/announcements?pickdate=yes&formname=$formname&element=$dname&month="+ +document.$formname.$dname\_month.value+"&year="+ +document.$formname.$dname\_year.value, + "LONCAPAcal", + "height=350,width=350,scrollbars=yes,resizable=yes,menubar=no"); + + } ENDJS - $result .= " \n"; $result .= " \n"; $result .= " \n"; $result .= "  "; - $result .= " \n"; for (my $h = 0;$h<24;$h++) { $result .= "