Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.25 and 1.26

version 1.25, 2003/06/19 15:02:37 version 1.26, 2003/06/20 16:13:06
Line 58  package Apache::lonhtmlcommon; Line 58  package Apache::lonhtmlcommon;
 use Time::Local;  use Time::Local;
 use strict;  use strict;
   
   
   ##############################################
   ##############################################
   
   =pod
   
   =item textbox
   
   =cut
   
   ##############################################
   ##############################################
   sub textbox {
       my ($name,$value,$size,$special) = @_;
       $size = 40 if (! defined($size));
       my $Str = '<input type="text" name="'.$name.'" size="'.$size.'" '.
           'value="'.$value.'" '.$special.' />';
       return $Str;
   }
   
   ##############################################
   ##############################################
   
   =pod
   
   =item checkbox
   
   =cut
   
   ##############################################
   ##############################################
   sub checkbox {
       my ($name) = @_;
       my $Str = '<input type="checkbox" name="'.$name.'" />';
       return $Str;
   }
   
   
   
 ##############################################  ##############################################
 ##############################################  ##############################################
   
Line 85  The current setting for this time parame Line 124  The current setting for this time parame
 An undefined value is taken to indicate the value is the current time.  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.  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  =back
   
 Bugs  Bugs
Line 96  The method used to restrict user input w Line 140  The method used to restrict user input w
 ##############################################  ##############################################
 ##############################################  ##############################################
 sub date_setter {  sub date_setter {
     my ($formname,$dname,$currentvalue) = @_;      my ($formname,$dname,$currentvalue,$special) = @_;
     if (! defined($currentvalue) || $currentvalue eq 'now') {      if (! defined($currentvalue) || $currentvalue eq 'now') {
         $currentvalue = time;          $currentvalue = time;
     }      }
Line 139  sub date_setter { Line 183  sub date_setter {
     }      }
 </script>  </script>
 ENDJS  ENDJS
     $result .= "  <select name=\"$dname\_month\" ".      $result .= "  <nobr><select name=\"$dname\_month\" ".$special.' '.
         "onChange=\"javascript:$dname\_checkday()\" >\n";          "onChange=\"javascript:$dname\_checkday()\" >\n";
     my @Months = qw/January February  March     April   May      June       my @Months = qw/January February  March     April   May      June 
                     July    August    September October November December/;                      July    August    September October November December/;
Line 152  ENDJS Line 196  ENDJS
     }      }
     $result .= "  </select>\n";      $result .= "  </select>\n";
     $result .= "  <input type=\"text\" name=\"$dname\_day\" ".      $result .= "  <input type=\"text\" name=\"$dname\_day\" ".
             "value=\"$mday\" size=\"3\" ".              "value=\"$mday\" size=\"3\" ".$special.' '.
             "onChange=\"javascript:$dname\_checkday()\" />\n";              "onChange=\"javascript:$dname\_checkday()\" />\n";
     $result .= "  <input type=\"year\" name=\"$dname\_year\" ".      $result .= "  <input type=\"year\" name=\"$dname\_year\" ".
             "value=\"$year\" size=\"5\" ".              "value=\"$year\" size=\"5\" ".$special.' '.
             "onChange=\"javascript:$dname\_checkday()\" />\n";              "onChange=\"javascript:$dname\_checkday()\" />\n";
     $result .= "&nbsp;&nbsp;";      $result .= "&nbsp;&nbsp;";
     $result .= "  <select name=\"$dname\_hour\" >\n";      $result .= "  <select name=\"$dname\_hour\" ".$special." >\n";
     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);
Line 175  ENDJS Line 219  ENDJS
         $result .= " </option>\n";          $result .= " </option>\n";
     }       } 
     $result .= "  </select>\n";      $result .= "  </select>\n";
     $result .= "  <input type=\"text\" name=\"$dname\_minute\" ".      $result .= "  <input type=\"text\" name=\"$dname\_minute\" ".$special.' '.
         "value=\"$min\" size=\"3\" /> m\n";          "value=\"$min\" size=\"3\" /> m\n";
     $result .= "  <input type=\"text\" name=\"$dname\_second\" ".      $result .= "  <input type=\"text\" name=\"$dname\_second\" ".$special.' '.
         "value=\"$sec\" size=\"3\" /> s\n";          "value=\"$sec\" size=\"3\" /> s\n";
     $result .= "<!-- end $dname date setting form -->\n";      $result .= "</nobr>\n<!-- end $dname date setting form -->\n";
     return $result;      return $result;
 }  }
   

Removed from v.1.25  
changed lines
  Added in v.1.26


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