<%perl>; $m->out(qq{
\n}) if ($useTable); # Print out a display label if necessary if ($disp && !$compact) { $m->out(qq{
} . $lang->maketext($disp) . qq{:
\n}); } if (!$useTable) {$compact = 1}; $m->out(qq{
\n}) if $useTable; $m->comp('/widgets/profile/hidden.mc', name => 'select_time|refresh_cb', value => $base_name ); #-- Month Select if ($mon) { $mk_time_field->({'base' => $base_name.'_mon', 'default' => $s->{'mon'}, 'label' => 'Month', 'vals' => \@month, 'width' => $cellWidth, 'compact' => $compact}); $cellsDisplayed++; } #-- Day Select if ($day) { $mk_time_field->({'base' => $base_name.'_day', 'default' => $s->{'day'}, 'label' => 'Day', 'localize'=> 0, 'vals' => $day, 'width' => $cellWidth, 'compact' => $compact}); $cellsDisplayed++; } #-- Year Select if ($year) { $mk_time_field->({'base' => $base_name.'_year', 'default' => $s->{'year'}, 'label' => 'Year', 'vals' => $year, 'localize'=> 0, 'width' => $cellWidth, 'compact' => $compact}); $cellsDisplayed++; } #-- Hour Select if ($hour) { $m->out(" "); $mk_time_field->({'base' => $base_name.'_hour', 'default' => $s->{'hour'}, 'label' => 'Hour', 'localize'=> 0, 'vals' => $hour, 'width' => $cellWidth, 'compact' => $compact}); $cellsDisplayed++; } #-- Minute Select if ($min) { $m->out(":"); $mk_time_field->({'base' => $base_name.'_min', 'default' => $s->{'min'}, 'label' => 'Minute', 'localize' => 0, 'vals' => $min, 'width' => $cellWidth, 'compact' => $compact}); $cellsDisplayed++; } #-- Second Select if ($sec) { $m->out(":"); $mk_time_field->({base => "$base_name\_sec", default => $s->{sec}, label => 'Second', localize => 0, vals => $sec, width => $cellWidth, compact => $compact}); $cellsDisplayed++; } if ($mil || $mic) { my ($key, $label, $size) = $mic ? qw(mic Microseconds 6) : qw(mil Milliseconds 3); $m->out(":"); $m->comp('/widgets/profile/text.mc', length => $size, maxlength => $size, useTable => 0, name => "$base_name\_$key", value => $s->{$key} || '0', ); $cellsDisplayed++; } # End the table unless this is a compact listing. unless ($compact) { # make a cell to use the remaining space, so Netscape can do the right thing $m->out(qq{
\n}); $m->out(qq{
}); } <%args> $s $widget $base_name $year => '' $mon => '' $day => '' $hour => '' $min => '' $sec => '' $mil => '' $mic => '' $formName => "forms[0]" $indent => undef $useTable => 0 $compact => undef $disp => '' <%once>; my @mon_names = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); my $mk_time_field = sub { my ($p) = @_; $p->{label} = $lang->maketext($p->{label}); $m->comp('/widgets/profile/select.mc', 'name' => $p->{base}, 'value' => $p->{default}, 'options' => [ [ '-1' , $p->{label}], @{$p->{vals}} ], 'useTable' => 0, 'localize'=> $p->{localize}); }; <%init>; my $js; my $cw = '80'; my $cellWidth = "width=$cw"; my $cellsDisplayed = 0; $useTable = 0 if $compact; $indent = $useTable ? FIELD_INDENT + 3 : 0 unless defined $indent; my @month = map { [$_,$lang->maketext($mon_names[$_-1])] } ('01'..'12'); if ($year && $mon && $day ) { $js = qq{ onchange="setDays('$base_name\_year', '$base_name\_mon', } . qq{'$base_name\_day', this)"}; }