Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.38 and 1.39

version 1.38, 2004/01/01 20:13:17 version 1.39, 2004/01/02 16:34:03
Line 142  The method used to restrict user input w Line 142  The method used to restrict user input w
 ##############################################  ##############################################
 ##############################################  ##############################################
 sub date_setter {  sub date_setter {
     my ($formname,$dname,$currentvalue,$special) = @_;      my ($formname,$dname,$currentvalue,$special,$includeempty) = @_;
     if (! defined($currentvalue) || $currentvalue eq 'now') {      if (! defined($currentvalue) || $currentvalue eq 'now') {
         $currentvalue = time;   unless ($includeempty) {
       $currentvalue = time;
    } else {
       $currentvalue = 0;
    }
     }      }
     # other potentially useful values:     wkday,yrday,is_daylight_savings      # other potentially useful values:     wkday,yrday,is_daylight_savings
     my ($sec,$min,$hour,$mday,$month,$year,undef,undef,undef) =       my ($sec,$min,$hour,$mday,$month,$year)=('','','','','','');
         localtime($currentvalue);      if ($currentvalue) {
     $year += 1900;   ($sec,$min,$hour,$mday,$month,$year,undef,undef,undef) = 
       localtime($currentvalue);
    $year += 1900;
       }
     my $result = "\n<!-- $dname date setting form -->\n";      my $result = "\n<!-- $dname date setting form -->\n";
     $result .= <<ENDJS;      $result .= <<ENDJS;
 <script language="Javascript">  <script language="Javascript">
Line 201  ENDJS Line 208  ENDJS
                     July    August    September October November December/;                      July    August    September October November December/;
     # Pad @Months with a bogus value to make indexing easier      # Pad @Months with a bogus value to make indexing easier
     unshift(@Months,'If you can read this an error occurred');      unshift(@Months,'If you can read this an error occurred');
       if ($includeempty) { $result.="<option value=''></option>"; }
     for(my $m = 1;$m <=$#Months;$m++) {      for(my $m = 1;$m <=$#Months;$m++) {
         $result .= "      <option value=\"$m\" ";          $result .= "      <option value=\"$m\" ";
         $result .= "selected " if ($m-1 == $month);          $result .= "selected " if ($m-1 eq $month);
         $result .= "> ".&mt($Months[$m])." </option>\n";          $result .= "> ".&mt($Months[$m])." </option>\n";
     }      }
     $result .= "  </select>\n";      $result .= "  </select>\n";
Line 215  ENDJS Line 223  ENDJS
             "onChange=\"javascript:$dname\_checkday()\" />\n";              "onChange=\"javascript:$dname\_checkday()\" />\n";
     $result .= "&nbsp;&nbsp;";      $result .= "&nbsp;&nbsp;";
     $result .= "  <select name=\"$dname\_hour\" ".$special." >\n";      $result .= "  <select name=\"$dname\_hour\" ".$special." >\n";
       if ($includeempty) { $result.="<option value=''></option>"; }
     for (my $h = 0;$h<24;$h++) {      for (my $h = 0;$h<24;$h++) {
         $result .= "      <option value=\"$h\" ";          $result .= "      <option value=\"$h\" ";
         $result .= "selected " if ($hour == $h);          $result .= "selected " if ($hour == $h);

Removed from v.1.38  
changed lines
  Added in v.1.39


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>