line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormHandler::Widget::Field::Span; |
2
|
|
|
|
|
|
|
# ABSTRACT: button field rendering widget |
3
|
|
|
|
|
|
|
$HTML::FormHandler::Widget::Field::Span::VERSION = '0.40068'; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
1634
|
use Moose::Role; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
22
|
|
6
|
2
|
|
|
2
|
|
12296
|
use HTML::FormHandler::Render::Util ('process_attrs'); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
26
|
|
7
|
2
|
|
|
2
|
|
525
|
use namespace::autoclean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
24
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub render_element { |
10
|
3
|
|
|
3
|
0
|
11
|
my ( $self, $result ) = @_; |
11
|
3
|
|
33
|
|
|
15
|
$result ||= $self->result; |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
|
|
10
|
my $output = '<span'; |
14
|
3
|
|
|
|
|
127
|
$output .= ' id="' . $self->id . '"'; |
15
|
3
|
|
|
|
|
26
|
$output .= process_attrs($self->element_attributes($result)); |
16
|
3
|
|
|
|
|
16
|
$output .= '>'; |
17
|
3
|
|
|
|
|
156
|
$output .= $self->value; |
18
|
3
|
|
|
|
|
12
|
$output .= '</span>'; |
19
|
3
|
|
|
|
|
12
|
return $output; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub render { |
23
|
3
|
|
|
3
|
0
|
16
|
my ( $self, $result ) = @_; |
24
|
3
|
|
66
|
|
|
56
|
$result ||= $self->result; |
25
|
3
|
50
|
|
|
|
11
|
die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; |
26
|
3
|
|
|
|
|
19
|
my $output = $self->render_element( $result ); |
27
|
3
|
|
|
|
|
22
|
return $self->wrap_field( $result, $output ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=pod |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=encoding UTF-8 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
HTML::FormHandler::Widget::Field::Span - button field rendering widget |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 VERSION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
version 0.40068 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SYNOPSIS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Renders the NonEditable pseudo-field as a span. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
<span id="my_field" class="test">The Field Value</span> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
FormHandler Contributors - see HTML::FormHandler |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Gerda Shank. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
61
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |