| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTML::Widget::Element::Hidden; |
|
2
|
|
|
|
|
|
|
|
|
3
|
88
|
|
|
88
|
|
100104
|
use warnings; |
|
|
88
|
|
|
|
|
190
|
|
|
|
88
|
|
|
|
|
2982
|
|
|
4
|
88
|
|
|
88
|
|
469
|
use strict; |
|
|
88
|
|
|
|
|
192
|
|
|
|
88
|
|
|
|
|
2901
|
|
|
5
|
88
|
|
|
88
|
|
473
|
use base 'HTML::Widget::Element'; |
|
|
88
|
|
|
|
|
178
|
|
|
|
88
|
|
|
|
|
12138
|
|
|
6
|
88
|
|
|
88
|
|
529
|
use NEXT; |
|
|
88
|
|
|
|
|
155
|
|
|
|
88
|
|
|
|
|
540
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw/value retain_default/); |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
HTML::Widget::Element::Hidden - Hidden Element |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $e = $widget->element( 'Hidden', 'foo' ); |
|
17
|
|
|
|
|
|
|
$e->value('bar'); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Hidden Element. |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 METHODS |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head2 value |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Default value is 1. |
|
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 new |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new { |
|
40
|
6
|
|
|
6
|
1
|
61
|
shift->NEXT::new(@_)->value(1); |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 containerize |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub containerize { |
|
48
|
12
|
|
|
12
|
1
|
32
|
my ( $self, $w, $value, $errors, $args ) = @_; |
|
49
|
|
|
|
|
|
|
|
|
50
|
12
|
50
|
|
|
|
44
|
$value = ref $value eq 'ARRAY' ? shift @$value : $value; |
|
51
|
|
|
|
|
|
|
|
|
52
|
12
|
100
|
100
|
|
|
65
|
$value = $self->value |
|
|
|
|
66
|
|
|
|
|
|
53
|
|
|
|
|
|
|
if ( not defined $value ) |
|
54
|
|
|
|
|
|
|
and $self->retain_default || not $args->{submitted}; |
|
55
|
|
|
|
|
|
|
|
|
56
|
12
|
|
|
|
|
256
|
my $i = $self->mk_input( $w, { type => 'hidden', value => $value } ); |
|
57
|
|
|
|
|
|
|
|
|
58
|
12
|
|
|
|
|
79
|
return $self->container( { element => $i } ); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
L |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 AUTHOR |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Sebastian Riedel, C |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 LICENSE |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
|
72
|
|
|
|
|
|
|
the same terms as Perl itself. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |