line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#============================================================= -*-Perl-*- |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Template::Plugin::CGI |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# DESCRIPTION |
6
|
|
|
|
|
|
|
# Simple Template Toolkit plugin interfacing to the CGI.pm module. |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# AUTHOR |
9
|
|
|
|
|
|
|
# Andy Wardley |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# COPYRIGHT |
12
|
|
|
|
|
|
|
# Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved. |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# This module is free software; you can redistribute it and/or |
15
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
#============================================================================ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
package Template::Plugin::CGI; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
22
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
23
|
1
|
|
|
1
|
|
5
|
use base 'Template::Plugin'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
674
|
|
24
|
1
|
|
|
1
|
|
8
|
use CGI; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our $VERSION = 2.70; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new { |
29
|
2
|
|
|
2
|
1
|
6
|
my $class = shift; |
30
|
2
|
|
|
|
|
5
|
my $context = shift; |
31
|
2
|
|
|
|
|
20
|
CGI->new(@_); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# monkeypatch CGI::params() method to Do The Right Thing in TT land |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub CGI::params { |
37
|
3
|
|
|
3
|
0
|
52
|
my $self = shift; |
38
|
3
|
|
|
|
|
8
|
local $" = ', '; |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
66
|
|
|
44
|
return $self->{ _TT_PARAMS } ||= do { |
41
|
|
|
|
|
|
|
# must call Vars() in a list context to receive |
42
|
|
|
|
|
|
|
# plain list of key/vals rather than a tied hash |
43
|
1
|
|
|
|
|
15
|
my $params = { $self->Vars() }; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# convert any null separated values into lists |
46
|
2
|
100
|
|
|
|
21
|
@$params{ keys %$params } = map { |
47
|
1
|
|
|
|
|
1897
|
/\0/ ? [ split /\0/ ] : $_ |
48
|
|
|
|
|
|
|
} values %$params; |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
22
|
$params; |
51
|
|
|
|
|
|
|
}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |