line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SparkX::Form::Printer::List; |
2
|
|
|
|
|
|
|
our $VERSION = '0.2102'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: A list-printer for SparkX::Form. Spouts out form elements in a (X)HTML list. |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
1168
|
use Moose::Role; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
29
|
|
8
|
|
|
|
|
|
|
with 'Spark::Form::Printer'; |
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
12470
|
use HTML::Tiny; |
|
3
|
|
|
|
|
3766
|
|
|
3
|
|
|
|
|
488
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub to_xhtml { |
13
|
1
|
|
|
1
|
1
|
2
|
my ($self, @args) = @_; |
14
|
1
|
|
|
|
|
10
|
return $self->_render('to_xhtml', HTML::Tiny->new(mode => 'xml'), @args); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub to_html { |
18
|
1
|
|
|
1
|
1
|
468
|
my ($self, @args) = @_; |
19
|
1
|
|
|
|
|
3
|
return $self->_render('to_html', HTML::Tiny->new(mode => 'html'), @args); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _render { |
23
|
2
|
|
|
2
|
|
77
|
my ($self, $func, $html, @params) = @_; |
24
|
2
|
|
|
|
|
4
|
return $html->ul( |
25
|
|
|
|
|
|
|
join q{ }, $self->_get_lis($func, $html) |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _get_lis { |
30
|
2
|
|
|
2
|
|
3
|
my ($self, $func, $html) = @_; |
31
|
|
|
|
|
|
|
return map { |
32
|
2
|
|
|
|
|
8
|
$html->li($html->label($_->human_name)) => $html->li($_->$func) |
|
6
|
|
|
|
|
315
|
|
33
|
|
|
|
|
|
|
} $self->fields; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=pod |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
SparkX::Form::Printer::List - A list-printer for SparkX::Form. Spouts out form elements in a (X)HTML list. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
version 0.2102 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 EXPORT |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
A list of functions that can be exported. You can delete this section |
53
|
|
|
|
|
|
|
if you don't export anything, such as for a purely object-oriented module. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 FUNCTIONS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 to_html |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Prints the form to HTML |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 to_xhtml |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Prints the form to XHTML |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
James Laver L<http://jameslaver.com> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This software is copyright (c) 2009 by James Laver C<< <sprintf qw(%s@%s.%s cpan jameslaver com)> >>. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
78
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |
85
|
|
|
|
|
|
|
|