| 1 | package HTML::FormHandler::Widget::Field::Password; | ||||||||||||||||||||
| 2 | # ABSTRACT: password rendering widget | ||||||||||||||||||||
| 3 | 6 | $HTML::FormHandler::Widget::Field::Password::VERSION = '0.410001'; | |||||||||||||||||||
| 4 | 6 | ▶ | use Moose::Role; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 6 | ▶ | use namespace::autoclean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 6 | ▶ | use HTML::FormHandler::Render::Util ('process_attrs'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | sub render_element { | ||||||||||||||||||||
| 10 | 7 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
render_element: called CC=4 SCAR=14.4
Pod
undocumented
| |||||||||||||||||||||
| 11 | 7 | ▶ | my $result = shift || $self->result; | ||||||||||||||||||
|
Condition33%1/3
shift() || $self->result
MC/DC0%0/2
shift() || $self->result
shift()
$self->result
Truth table33%1/3
A || B
A= shift()B= $self->result
| |||||||||||||||||||||
| 12 | 7 | my $t; | |||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 7 | my $output = '<input type="password" name="' | |||||||||||||||||||
| 15 | . $self->html_name . '" id="' . $self->id . '"'; | ||||||||||||||||||||
| 16 | 7 | ▶ | $output .= qq{ size="$t"} if $t = $self->size; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 17 | 7 | ▶ | $output .= qq{ maxlength="$t"} if $t = $self->maxlength; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 18 | 7 | $output .= ' value="' . $self->html_filter($result->fif) . '"'; | |||||||||||||||||||
| 19 | 7 | $output .= process_attrs($self->element_attributes($result)); | |||||||||||||||||||
| 20 | 7 | $output .= ' />'; | |||||||||||||||||||
| 21 | 7 | return $output; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | sub render { | ||||||||||||||||||||
| 25 | 7 | ▶ | my ( $self, $result ) = @_; | ||||||||||||||||||
|
Subroutine
render: called CC=3 SCAR=11.8
Pod
undocumented
| |||||||||||||||||||||
| 26 | 7 | ▶ | $result ||= $self->result; | ||||||||||||||||||
|
Condition33%1/3
$result ||= $self->result
MC/DC0%0/2
$result ||= $self->result
$result
$self->result
Truth table33%1/3
A ||= B
A= $resultB= $self->result
| |||||||||||||||||||||
| 27 | 7 | ▶ | die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 28 | 7 | my $output = $self->render_element( $result ); | |||||||||||||||||||
| 29 | 7 | return $self->wrap_field( $result, $output ); | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 6 | 1; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | =pod | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | =encoding UTF-8 | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | =head1 NAME | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | HTML::FormHandler::Widget::Field::Password - password rendering widget | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | =head1 VERSION | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | version 0.410001 | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | =head1 SYNOPSIS | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | Renders a password field | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | =head1 AUTHOR | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | FormHandler Contributors - see HTML::FormHandler | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | This software is copyright (c) 2017 by Gerda Shank. | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||
| 61 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | =cut | ||||||||||||||||||||