| 1 | package HTML::FormHandler::Widget::Wrapper::Table; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: wrapper class for table layout | ||||||||||||||||||||||||||||
| 3 | 2 | $HTML::FormHandler::Widget::Wrapper::Table::VERSION = '0.410002'; | |||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | with 'HTML::FormHandler::Widget::Wrapper::Base'; | |||||||||||||||||||||||||||
| 6 | 2 | ▶ | use HTML::FormHandler::Render::Util ('process_attrs'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use HTML::Entities qw( encode_entities ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 39 | ▶ | sub wrap_field { | ||||||||||||||||||||||||||
|
Subroutine
wrap_field: called CC=9 SCAR=22.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | 39 | my ( $self, $result, $rendered_widget ) = @_; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 39 | ▶ | return $rendered_widget if ( $self->has_flag('is_compound') && $self->get_tag('no_compound_wrapper') ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->has_flag("is_compound") and $self->get_tag("no_compound_wrapper")
MC/DC0%0/2
$self->has_flag("is_compound") and $self->get_tag("no_compound_wrapper")
$self->has_flag("is_compound")
$self->get_tag("no_compound_wrapper")
Truth table66%2/3
A and B
A= $self->has_flag("is_compound")B= $self->get_tag("no_compound_wrapper")
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 39 | my $output = "\n<tr" . process_attrs($self->wrapper_attributes($result)) . ">"; | |||||||||||||||||||||||||||
| 15 | 39 | ▶ | if ( $self->has_flag('is_compound') ) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 16 | 4 | $output .= '<td>' . $self->do_render_label($result) . '</td></tr>'; | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | ▶ | elsif ( $self->do_label && length( $self->label ) > 0 ) { | |||||||||||||||||||||||||||
|
Condition66%2/3
$self->do_label and length $self->label > 0
MC/DC50%1/2
$self->do_label and length $self->label > 0
$self->do_label
length $self->label > 0
Truth table66%2/3
A and B
A= $self->do_labelB= length $self->label > 0
| |||||||||||||||||||||||||||||
| 19 | 29 | $output .= '<td>' . $self->do_render_label($result) . '</td>'; | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | 39 | ▶ | if ( !$self->has_flag('is_compound') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 35 | $output .= '<td>'; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | 39 | $output .= $rendered_widget; | |||||||||||||||||||||||||||
| 25 | $output .= qq{\n<span class="error_message">$_</span>} | ||||||||||||||||||||||||||||
| 26 | 39 | for map { encode_entities($_) } $result->all_errors; | |||||||||||||||||||||||||||
| 27 | 39 | ▶ | if ( !$self->has_flag('is_compound') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 35 | $output .= "</td></tr>\n"; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 39 | return $output; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 2 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 34 | 2 | 1; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | __END__ | ||||||||||||||||||||||||||||