line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Application::Plugin::DevPopup::Params; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: Params.pm 15 2009-12-07 10:52:17Z stro $ |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
43498
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
90
|
|
6
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
102
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
23
|
use base qw/Exporter/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
252
|
|
9
|
2
|
|
|
2
|
|
99828
|
use Data::Dumper; |
|
2
|
|
|
|
|
7940
|
|
|
2
|
|
|
|
|
944
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
14
|
1
|
|
|
1
|
|
11
|
my $c = scalar caller; |
15
|
1
|
|
|
|
|
10
|
$c->add_callback( 'devpopup_report', \&_param_report ); |
16
|
1
|
|
|
|
|
2553
|
goto &Exporter::import; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _param_report { |
20
|
1
|
|
|
1
|
|
51134
|
my $self = shift; |
21
|
1
|
|
|
|
|
4
|
my $cgi = _cgi_report($self); |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
4
|
return $self->devpopup->add_report( |
24
|
|
|
|
|
|
|
'title' => 'CGIApp params', |
25
|
|
|
|
|
|
|
'summary' => 'CGI::Application parameters', |
26
|
|
|
|
|
|
|
'report' => qq!!, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _cgi_report { |
32
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
3
|
my $r=0; |
35
|
1
|
|
|
|
|
1
|
my $q = $self; |
36
|
1
|
|
|
|
|
3
|
my $report = ''; |
37
|
1
|
|
|
|
|
1
|
my $param; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
2
|
$report = ' |
param | value |
' .
40
|
|
|
|
|
|
|
join ($/, map { |
41
|
2
|
|
|
|
|
19
|
$r=1-$r; |
42
|
1
|
|
|
|
|
4
|
$param = Data::Dumper->Dump([$q->param($_)]); |
43
|
1
|
|
|
|
|
135
|
$param = substr($param, 7, length($param) - 9); |
44
|
1
|
50
|
|
|
|
3
|
qq{ |
$_ | @{ [$param] } |
}
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
7
|
|
45
|
1
|
|
|
|
|
5
|
} grep { not /^__CAP_DEVPOPUP/x } sort $q->param()); |
46
|
1
|
|
|
|
|
4
|
return $report; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NAME |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
CGI::Application::Plugin::DevPopup::Params - show CGI::Application parameters in DevPopup window |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SYNOPSIS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
use CGI::Application::Plugin::DevPopup; |
58
|
|
|
|
|
|
|
use CGI::Application::Plugin::DevPopup::Params; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
The rest of your application follows |
61
|
|
|
|
|
|
|
... |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This module is a plugin for L. |
66
|
|
|
|
|
|
|
Whenever used, it creates a "Params" section in the DevPopup output. This |
67
|
|
|
|
|
|
|
section contains a list of CGI::Application parameters set by "param" |
68
|
|
|
|
|
|
|
method. Internal DevPopup parameters are omitted from output, since it's |
69
|
|
|
|
|
|
|
unlikely that you need them. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
See L for parameters description. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 VERSION |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1.01 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SEE ALSO |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L, L |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Not known. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Not known. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Serguei Trouchelle, L |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Most of code is based by CGI::Application::Plugin::DevPopup by Rhesa Rozendaal, L |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This module is distributed under the same terms as Perl itself. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Copyright (c) 2009 Serguei Trouchelle |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
102
|
|
|
|
|
|
|
|