QBit/WebInterface/Controller/Form/Field/button.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 34 CC 7 SCAR 37.8
CC
7
Cov
0%
control_html
56.0
BEGIN
2.0
BEGIN
2.0
CRAP 44.0
1 package QBit::WebInterface::Controller::Form::Field::button;
2 $QBit::WebInterface::Controller::Form::Field::button::VERSION = '0.033';
3 use qbit;
4  
5 use base qw(QBit::WebInterface::Controller::Form::Field);
6  
7 sub control_html {
8 my ($self) = @_;
9  
10 my $html = '<button class="btn';
11 $html .= ' btn-' . $self->{'info_type'} if defined($self->{'info_type'});
12 $html .= ' btn-' . $self->{'size'} if defined($self->{'size'});
13 $html .= ' disabled' if $self->{'disabled'};
14 $html .= ' ' . $self->{'class'} if defined($self->{'class'});
15 $html .= '"';
16  
17 $html .= ' type="' . (defined($self->{'type'}) ? $self->{'type'} : 'button') . '"';
18  
19 $html .= '>' . html_encode(ref($self->value) eq "CODE" ? $self->value->() : $self->value) . '</button>';
20  
21 return $html;
22 }
23  
24 TRUE;