--- loncom/interface/lonhtmlcommon.pm 2003/03/07 19:09:11 1.16 +++ loncom/interface/lonhtmlcommon.pm 2003/05/21 16:16:32 1.22 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.16 2003/03/07 19:09:11 albertel Exp $ +# $Id: lonhtmlcommon.pm,v 1.22 2003/05/21 16:16:32 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -65,6 +65,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,6 +85,12 @@ 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. +=back + +Bugs + +The method used to restrict user input will fail in the year 2400. + =cut ############################################## @@ -177,8 +186,12 @@ ENDJS ############################################## ############################################## +=pod + =item &get_date_from_form +get_date_from_form retrieves the date specified in an &date_setter form. + Inputs: =over 4 @@ -249,174 +262,97 @@ sub get_date_from_form { ############################################## ############################################## -sub AscendOrderOptions { - my ($order, $page, $formName)=@_; - - my $OpSel1 = ''; - my $OpSel2 = ''; +=pod - if($order eq 'Ascending') { - $OpSel1 = ' selected'; - } else { - $OpSel2 = ' selected'; - } +=item &pjump_javascript_definition() - my $Str = ''; - $Str .= ''."\n"; +Returns javascript defining the 'pjump' function, which opens up a +parameter setting wizard. - return $Str; -} - -sub MapOptions { - my ($data, $page, $formName)=@_; - my $Str = ''; - $Str .= ''."\n"; } @@ -690,11 +630,15 @@ sub Increment_PrgWin { } else { $time_est .= ' seconds'; } - + my $lasttime = time-$$prog_state{'laststart'}; + if ($lasttime == 1) { + $lasttime = '('.$lasttime.' second for '.$extraInfo.')'; + } else { + $lasttime = '('.$lasttime.' seconds for '.$extraInfo.')'; + } $r->print(''); + ': '.$time_est.' remaining '.$lasttime.'";'.''); $$prog_state{'laststart'}=time; $r->rflush(); }