line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widget::Element::Password; |
2
|
|
|
|
|
|
|
|
3
|
88
|
|
|
88
|
|
86865
|
use warnings; |
|
88
|
|
|
|
|
192
|
|
|
88
|
|
|
|
|
4710
|
|
4
|
88
|
|
|
88
|
|
506
|
use strict; |
|
88
|
|
|
|
|
180
|
|
|
88
|
|
|
|
|
3054
|
|
5
|
88
|
|
|
88
|
|
624
|
use base 'HTML::Widget::Element'; |
|
88
|
|
|
|
|
200
|
|
|
88
|
|
|
|
|
29880
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw/comment fill label value retain_default/); |
8
|
|
|
|
|
|
|
__PACKAGE__->mk_attr_accessors(qw/size maxlength/); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
HTML::Widget::Element::Password - Password Element |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $e = $widget->element( 'Password', 'foo' ); |
17
|
|
|
|
|
|
|
$e->comment('(Required)'); |
18
|
|
|
|
|
|
|
$e->fill(1); |
19
|
|
|
|
|
|
|
$e->label('Foo'); |
20
|
|
|
|
|
|
|
$e->size(23); |
21
|
|
|
|
|
|
|
$e->value('bar'); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Password Element. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 METHODS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 retain_default |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
If true, overrides the default behaviour, so that after a field is missing |
32
|
|
|
|
|
|
|
from the form submission, the xml output will contain the default value, |
33
|
|
|
|
|
|
|
rather than be empty. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 containerize |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub containerize { |
40
|
10
|
|
|
10
|
1
|
25
|
my ( $self, $w, $value, $errors, $args ) = @_; |
41
|
|
|
|
|
|
|
|
42
|
10
|
50
|
|
|
|
34
|
$value = ref $value eq 'ARRAY' ? shift @$value : $value; |
43
|
|
|
|
|
|
|
|
44
|
10
|
100
|
100
|
|
|
54
|
$value = $self->value |
|
|
|
66
|
|
|
|
|
45
|
|
|
|
|
|
|
if ( not defined $value ) |
46
|
|
|
|
|
|
|
and $self->retain_default || not $args->{submitted}; |
47
|
|
|
|
|
|
|
|
48
|
10
|
100
|
|
|
|
127
|
$value = undef unless $self->fill; |
49
|
|
|
|
|
|
|
|
50
|
10
|
|
|
|
|
90
|
my $l = $self->mk_label( $w, $self->label, $self->comment, $errors ); |
51
|
10
|
|
|
|
|
101
|
my $i = $self->mk_input( $w, { type => 'password', value => $value }, |
52
|
|
|
|
|
|
|
$errors ); |
53
|
10
|
|
|
|
|
60
|
my $e = $self->mk_error( $w, $errors ); |
54
|
|
|
|
|
|
|
|
55
|
10
|
|
|
|
|
70
|
return $self->container( { element => $i, error => $e, label => $l } ); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SEE ALSO |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
L |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Sebastian Riedel, C |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 LICENSE |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
69
|
|
|
|
|
|
|
the same terms as Perl itself. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |