line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widget::Constraint::SingleValue; |
2
|
|
|
|
|
|
|
|
3
|
88
|
|
|
88
|
|
94177
|
use warnings; |
|
88
|
|
|
|
|
295
|
|
|
88
|
|
|
|
|
2764
|
|
4
|
88
|
|
|
88
|
|
511
|
use strict; |
|
88
|
|
|
|
|
198
|
|
|
88
|
|
|
|
|
2916
|
|
5
|
88
|
|
|
88
|
|
479
|
use base 'HTML::Widget::Constraint'; |
|
88
|
|
|
|
|
174
|
|
|
88
|
|
|
|
|
19312
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
HTML::Widget::Constraint::SingleValue - SingleValue Constraint |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $c = $widget->constraint( 'SingleValue', 'foo' ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Ensures that multiple values were not submitted for the named element. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 METHODS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head2 process |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub process { |
26
|
5
|
|
|
5
|
1
|
14
|
my ( $self, $w, $params ) = @_; |
27
|
5
|
|
|
|
|
6
|
my $results = []; |
28
|
5
|
|
|
|
|
6
|
my ($name) = @{ $self->names }; |
|
5
|
|
|
|
|
15
|
|
29
|
|
|
|
|
|
|
|
30
|
5
|
100
|
|
|
|
33
|
if ( ref $params->{$name} ) { |
31
|
2
|
|
|
|
|
14
|
push @$results, HTML::Widget::Error->new( |
32
|
|
|
|
|
|
|
{ name => $name, message => $self->mk_message } ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
5
|
|
|
|
|
29
|
return $results; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 AUTHOR |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Carl Franks, C |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 LICENSE |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
45
|
|
|
|
|
|
|
the same terms as Perl itself. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |