« QBit/WebInterface/Controller/Form/Field/checkbox.pm
↑ Summary
QBit/WebInterface/Controller/Form/Field/email.pm »
| 1 | package QBit::WebInterface::Controller::Form::Field::textarea; | ||
| 2 | $QBit::WebInterface::Controller::Form::Field::textarea::VERSION = '0.033'; | ||
| 3 | use qbit; | ||
| 4 | |||
| 5 | use base qw(QBit::WebInterface::Controller::Form::Field); | ||
| 6 | |||
| 7 | sub init { | ||
| 8 | my ($self) = @_; | ||
| 9 | |||
| 10 | $self->SUPER::init(); | ||
| 11 | |||
| 12 | $self->{'rows'} ||= 8; | ||
| 13 | } | ||
| 14 | |||
| 15 | sub control_html { | ||
| 16 | my ($self) = @_; | ||
| 17 | |||
| 18 | my $html = '<textarea'; | ||
| 19 | |||
| 20 | $html .= $self->_class('span9'); | ||
| 21 | |||
| 22 | foreach (qw(id name style cols rows)) { | ||
| 23 | $html .= " $_=\"" . html_encode($self->{$_}) . '"' if defined($self->{$_}); | ||
| 24 | } | ||
| 25 | |||
| 26 | $html .= '>' . html_encode($self->value); | ||
| 27 | |||
| 28 | $html .= '</textarea>'; | ||
| 29 | |||
| 30 | $html .= $self->_html_error(); | ||
| 31 | |||
| 32 | return $html; | ||
| 33 | } | ||
| 34 | |||
| 35 | TRUE; |