Date field type
authorJamie Cameron <jcameron@webmin.com>
Fri, 19 Aug 2011 21:26:15 +0000 (14:26 -0700)
committerJamie Cameron <jcameron@webmin.com>
Fri, 19 Aug 2011 21:26:15 +0000 (14:26 -0700)
custom/custom-lib.pl
custom/lang/en

index 07c86f9..f597ce9 100755 (executable)
@@ -446,6 +446,11 @@ foreach my $a (@{$cmd->{'args'}}) {
                        }
                $rv = join(" ", @vals);
                }
+       elsif ($a->{'type'} == 13) {
+               $rv = $setin->{$n."_year"}."-".
+                     $setin->{$n."_month"}."-".
+                     $setin->{$n."_day"};
+               }
        if ($rv eq '' && $a->{'must'} && $a->{'type'} != 7) {
                &error(&text('run_emust', $a->{'desc'}));
                }
@@ -586,6 +591,12 @@ elsif ($a->{'type'} == 12) {
        return &ui_select($n, undef, [ &read_opts_file($a->{'opts'}) ],
                          5, 1);
        }
+elsif ($a->{'type'} == 13) {
+       my ($year, $month, $day) = split(/\-/, $v);
+       return &ui_date_input($day, $month, $year,
+                             $n."_day", $n."_month", $n."_year")."&nbsp;".
+              &date_chooser_button($n."_day", $n."_month", $n."_year");
+       }
 else {
        return "Unknown parameter type $a->{'type'}";
        }
index d7b29a4..2004d51 100644 (file)
@@ -47,6 +47,7 @@ edit_type9=Menu..
 edit_type10=Upload
 edit_type11=Text box
 edit_type12=Multi menu..
+edit_type13=Date
 edit_noshow=Hide command when executing?
 edit_usermin=Available in Usermin?
 edit_timeout=Maximum time to wait for command?