new package editor
[freeside.git] / httemplate / elements / tr-input-text.html
index 49ae166..f71f2f7 100644 (file)
@@ -35,6 +35,11 @@ my $maxlength = $opt{'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 = ();
 
 push @style, 'text-align: '. $opt{'text-align'}
@@ -43,9 +48,6 @@ push @style, 'text-align: '. $opt{'text-align'}
 push @style, 'background-color: #dddddd'
   if $opt{'disabled'};
 
-$opt{'disabled'} = 'DISABLED'
-  if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah?
-
 my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
 
 my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';