[freeside-commits] freeside/httemplate/elements tr-input-text.html, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Sun Apr 13 01:21:46 PDT 2008


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv7492

Modified Files:
	tr-input-text.html 
Log Message:
add disabled option to text elements

Index: tr-input-text.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-input-text.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- tr-input-text.html	4 Jan 2008 02:18:36 -0000	1.2
+++ tr-input-text.html	13 Apr 2008 08:21:42 -0000	1.3
@@ -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 @@
                 ? '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'};
 
-my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+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'}. '"' : '';
 
 </%init>



More information about the freeside-commits mailing list