% $opt{'prefix'} %>
<% $maxlength %>
<% $style %>
<% $opt{autocomplete} ? 'autocomplete="off"' : '' %>
<% $opt{disabled} %>
<% $onchange %>
><% $opt{'postfix'} %>
<%init>
my %opt = @_;
my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};
$value = $value / 60;
my $onchange = $opt{'onchange'}
? join(' ', map $_.'="'. $opt{'onchange'}. '(this)"',
qw( onChange onKeyDown onKeyUp onKeyPress )
)
: '';
$opt{'size'} ||= 4;
my $size = 'SIZE="'. $opt{'size'}. '"';
$opt{'maxlength'} ||= 3;
my $maxlength = 'MAXLENGTH="'. $opt{'maxlength'}. '"';
$opt{'disabled'} = &{ $opt{'disabled'} }( \%opt )
if ref($opt{'disabled'}) eq 'CODE';
$opt{'disabled'} = 'DISABLED'
if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah?
my @style = ref($opt{'style'})
? @{ $opt{'style'} }
: $opt{'style'}
? ( $opt{'style'} )
: ();
push @style, 'text-align: '. $opt{'text-align'}
if $opt{'text-align'};
push @style, 'background-color: #dddddd'
if $opt{'disabled'} && ! $opt{'nodarken_disabled'};
my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
%init>