line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Test::Form::Widget::Hidden; |
2
|
14
|
|
|
14
|
|
50
|
use strict; |
|
14
|
|
|
|
|
14
|
|
|
14
|
|
|
|
|
331
|
|
3
|
14
|
|
|
14
|
|
48
|
use warnings; |
|
14
|
|
|
|
|
13
|
|
|
14
|
|
|
|
|
249
|
|
4
|
|
|
|
|
|
|
################################################################## |
5
|
|
|
|
|
|
|
# $Id: Hidden.pm 411 2011-09-26 11:19:30Z nohuhu@nohuhu.org $ |
6
|
|
|
|
|
|
|
# $Name: cgi-test_0-104_t1 $ |
7
|
|
|
|
|
|
|
################################################################## |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Copyright (c) 2001, Raphael Manfredi |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# You may redistribute only under the terms of the Artistic License, |
12
|
|
|
|
|
|
|
# as specified in the README file that comes with the distribution. |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
|
15
|
14
|
|
|
14
|
|
42
|
use Carp; |
|
14
|
|
|
|
|
11
|
|
|
14
|
|
|
|
|
571
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
# This class models a FORM hidden field. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
|
21
|
14
|
|
|
14
|
|
45
|
use base qw(CGI::Test::Form::Widget); |
|
14
|
|
|
|
|
17
|
|
|
14
|
|
|
|
|
2151
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# |
24
|
|
|
|
|
|
|
# %attr |
25
|
|
|
|
|
|
|
# |
26
|
|
|
|
|
|
|
# Defines which HTML attributes we should look at within the node, and how |
27
|
|
|
|
|
|
|
# to translate that into class attributes. |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my %attr = ('name' => 'name', |
31
|
|
|
|
|
|
|
'value' => 'value', |
32
|
|
|
|
|
|
|
'disabled' => 'is_disabled', |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# |
36
|
|
|
|
|
|
|
# ->_init |
37
|
|
|
|
|
|
|
# |
38
|
|
|
|
|
|
|
# Per-widget initialization routine. |
39
|
|
|
|
|
|
|
# Parse HTML node to determine our specific parameters. |
40
|
|
|
|
|
|
|
# |
41
|
|
|
|
|
|
|
sub _init |
42
|
|
|
|
|
|
|
{ |
43
|
83
|
|
|
83
|
|
73
|
my $this = shift; |
44
|
83
|
|
|
|
|
67
|
my ($node) = shift; |
45
|
83
|
|
|
|
|
184
|
$this->_parse_attr($node, \%attr); |
46
|
83
|
|
|
|
|
100
|
return; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# |
50
|
|
|
|
|
|
|
# ->_is_successful -- defined |
51
|
|
|
|
|
|
|
# |
52
|
|
|
|
|
|
|
# Is the enabled widget "successful", according to W3C's specs? |
53
|
|
|
|
|
|
|
# Any hidden field with a VALUE attribute is. |
54
|
|
|
|
|
|
|
# |
55
|
|
|
|
|
|
|
sub _is_successful |
56
|
|
|
|
|
|
|
{ |
57
|
97
|
|
|
97
|
|
72
|
my $this = shift; |
58
|
97
|
|
|
|
|
171
|
return defined $this->value(); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# |
62
|
|
|
|
|
|
|
# Attribute access |
63
|
|
|
|
|
|
|
# |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub gui_type |
66
|
|
|
|
|
|
|
{ |
67
|
0
|
|
|
0
|
1
|
|
return "hidden field"; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# |
71
|
|
|
|
|
|
|
# Global widget predicates |
72
|
|
|
|
|
|
|
# |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub is_read_only |
75
|
|
|
|
|
|
|
{ |
76
|
0
|
|
|
0
|
1
|
|
return 1; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# |
80
|
|
|
|
|
|
|
# High-level classification predicates |
81
|
|
|
|
|
|
|
# |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub is_hidden |
84
|
|
|
|
|
|
|
{ |
85
|
0
|
|
|
0
|
1
|
|
return 1; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 NAME |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
CGI::Test::Form::Widget::Hidden - A hidden field |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 SYNOPSIS |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
# Inherits from CGI::Test::Form::Widget |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 DESCRIPTION |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This class represents a hidden field, which is meant to be resent as-is |
101
|
|
|
|
|
|
|
upon submit. Such a widget is therefore read-only. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
The interface is the same as the one described |
104
|
|
|
|
|
|
|
in L. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 AUTHORS |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
The original author is Raphael Manfredi. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Steven Hilton was long time maintainer of this module. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Current maintainer is Alexander Tokarev Ftokarev@cpan.orgE>. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 SEE ALSO |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
CGI::Test::Form::Widget(3). |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=cut |
119
|
|
|
|
|
|
|
|