line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Test::Form::Widget::Hidden; |
2
|
14
|
|
|
14
|
|
47
|
use strict; |
|
14
|
|
|
|
|
14
|
|
|
14
|
|
|
|
|
326
|
|
3
|
14
|
|
|
14
|
|
39
|
use warnings; |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
245
|
|
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
|
|
41
|
use Carp; |
|
14
|
|
|
|
|
17
|
|
|
14
|
|
|
|
|
677
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
# This class models a FORM hidden field. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
|
21
|
14
|
|
|
14
|
|
51
|
use base qw(CGI::Test::Form::Widget); |
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
2033
|
|
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
|
|
64
|
my $this = shift; |
44
|
83
|
|
|
|
|
66
|
my ($node) = shift; |
45
|
83
|
|
|
|
|
169
|
$this->_parse_attr($node, \%attr); |
46
|
83
|
|
|
|
|
95
|
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
|
|
81
|
my $this = shift; |
58
|
97
|
|
|
|
|
174
|
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
|
|
|
|
|
|
|
|