diff options
author | ivan <ivan> | 2008-04-13 08:21:42 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-04-13 08:21:42 +0000 |
commit | 7aef77aa2c25b7bca3569376f08b1d2cc57a1592 (patch) | |
tree | 0f8a08c43d032f974fd8cd31a78532d6978c98ce /httemplate | |
parent | e3dffa23a03cd9f88946ceb78bc75ada29bc013a (diff) |
add disabled option to text elements
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/elements/tr-input-text.html | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/httemplate/elements/tr-input-text.html b/httemplate/elements/tr-input-text.html index c8bec5ea6..49ae166ee 100644 --- a/httemplate/elements/tr-input-text.html +++ b/httemplate/elements/tr-input-text.html @@ -1,6 +1,6 @@ <% include('tr-td-label.html', @_ ) %> - <TD <% $style %>> + <TD <% $cell_style %>> <% $opt{'prefix'} %><INPUT TYPE = "<% $opt{type} || 'text' %>" NAME = "<% $opt{field} %>" @@ -8,7 +8,8 @@ VALUE = "<% $value |h %>" <% $size %> <% $maxlength %> - <% $align %> + <% $style %> + <% $opt{disabled} %> <% $onchange %> ><% $opt{'postfix'} %> @@ -34,11 +35,19 @@ my $maxlength = $opt{'maxlength'} ? 'MAXLENGTH="'. $opt{'maxlength'}. '"' : ''; -my $align = $opt{'text-align'} - ? 'STYLE="text-align: '. $opt{'text-align'}. '"' - : ''; +my @style = (); + +push @style, 'text-align: '. $opt{'text-align'} + if $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 $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; +my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; </%init> |