combine ticket notification scrips, #15353
[freeside.git] / httemplate / elements / select.html
index 268e0d2..efcf27b 100644 (file)
@@ -4,6 +4,8 @@
         ID            = "<% $opt{id} %>"
         previousValue = "<% $curr_value %>"
         previousText  = "<% $labels->{$curr_value} || $curr_value %>"
+        <% $style %>
+        <% $opt{disabled} %>
         <% $onchange %>
 >
 
 
 my %opt = @_;
 
-my $onchange = $opt{'onchange'}
-                 ? 'onChange="'. $opt{'onchange'}. '(this)"'
-                 : '';
-
 my $labels = $opt{'option_labels'} || $opt{'labels'};
 
 my $curr_value = $opt{'curr_value'};
@@ -60,4 +58,18 @@ if ( $opt{'onchange'} ) {
   $onchange = 'onChange="'. $onchange. '"' unless $onchange =~ /^onChange=/i;
 }
 
+$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'} )
+                : ();
+
+my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
+
+
 </%init>