line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
HTML::FormEngine::SkinComplex - a complete but complex FormEngine skin |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 ABOUT |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
This is a complete useable skin for FormEngine, it is based on the |
8
|
|
|
|
|
|
|
abstract class HTML::FormEngine::Skin. So read |
9
|
|
|
|
|
|
|
L for more information on its methods and |
10
|
|
|
|
|
|
|
about the template system. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
It is called I because its more flexible than |
13
|
|
|
|
|
|
|
HTML::FormEngine::SkinClassic but also a bit more complicated. To |
14
|
|
|
|
|
|
|
understand it try out I, play with it and compare it |
15
|
|
|
|
|
|
|
to the other examples. Normally you'll be more happy with |
16
|
|
|
|
|
|
|
I. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
###################################################################### |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
package HTML::FormEngine::SkinComplex; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
25
|
1
|
|
|
1
|
|
4
|
use vars qw(@ISA); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
26
|
1
|
|
|
1
|
|
530
|
use HTML::FormEngine::Skin; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
309
|
|
27
|
|
|
|
|
|
|
@ISA = qw(HTML::FormEngine::Skin); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
###################################################################### |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#NOTE: its important that templates which do not implement a certain field but are of a generic type (reuseable) begin with _, else the seperate algorithm does not work |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _get_templ { |
34
|
1
|
|
|
1
|
|
2
|
my $confirm_handler = shift; |
35
|
1
|
|
|
|
|
2
|
my %skin = %{HTML::FormEngine::Skin::_get_templ()}; |
|
1
|
|
|
|
|
4
|
|
36
|
1
|
|
|
|
|
10
|
my @baseskin = keys(%skin); |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
4
|
$skin{main} = ' |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
cellspacing=<&FORM_TABLE_CELLSP&> cellpadding=<&FORM_TABLE_CELLPAD&> align="<&FORM_ALIGN&>" <&FORM_TABLE_EXTRA&>><~
41
|
|
|
|
|
|
|
| ><&TEMPL&> ~TEMPL FORM_ROW_EXTRA~>
42
|
|
|
|
|
|
|
| >
43
|
|
|
|
|
|
|
| > |
44
|
|
|
|
|
|
|
" name="<&FORMNAME&>" <&SUBMIT_EXTRA&>/>!SUBMIT!> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
| |
48
|
|
|
|
|
|
|
<~<&HIDDEN&>~HIDDEN~> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
'; |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
|
|
2
|
$skin{_row} = '<~<start_collect_results #get_value,VALUES1&> |
53
|
|
|
|
|
|
|
| >><not_null&>!TITLE!> |
54
|
|
|
|
|
|
|
| ><&_column <arg 0&>,<arg 1&>,<arg 2&>&> |
55
|
|
|
|
|
|
|
| ><error&> | <seperate ,1&>~~>
56
|
|
|
|
|
|
|
'; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
#original: |
59
|
|
|
|
|
|
|
# $skin{_row} = '<~<start_collect_results #get_value,VALUES1&> |
60
|
|
|
|
|
|
|
# | >><not_null&>!TITLE!> |
61
|
|
|
|
|
|
|
# | ><&_column <arg 0&>&> |
62
|
|
|
|
|
|
|
# | ><error&> | ~~><seperate ,1&>
63
|
|
|
|
|
|
|
#'; |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
3
|
$skin{_row_notitle} = '<~ |
66
|
|
|
|
|
|
|
| ><&_column <arg 0&>,<arg 1&>,<arg 2&>&> |
67
|
|
|
|
|
|
|
| ><error&> | <seperate ,1&>~~>
68
|
|
|
|
|
|
|
'; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
#original |
71
|
|
|
|
|
|
|
# $skin{_row_notitle} = '<~ |
72
|
|
|
|
|
|
|
# | ><&_column <arg 0&>&> |
73
|
|
|
|
|
|
|
# | ><error&> | ~~><seperate ,1&>
74
|
|
|
|
|
|
|
#'; |
75
|
|
|
|
|
|
|
|
76
|
1
|
|
|
|
|
1
|
$skin{_row_notitle_noerror} = '<~ |
77
|
|
|
|
|
|
|
| ><&_column <arg 0&>,<arg 1&>,<arg 2&>&> | <seperate ,1&>~~>
78
|
|
|
|
|
|
|
'; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
#original: |
81
|
|
|
|
|
|
|
# $skin{_row_notitle_noerror} = '<~ |
82
|
|
|
|
|
|
|
# | ><&_column <arg 0&>&> | ~~><seperate ,1&>
83
|
|
|
|
|
|
|
#'; |
84
|
|
|
|
|
|
|
|
85
|
1
|
|
|
|
|
2
|
$skin{_row_noerror} = '<~ |
86
|
|
|
|
|
|
|
| >><not_null&>!TITLE!> |
87
|
|
|
|
|
|
|
| colspan=2><&_column <arg 0&>,<arg 1&>,<arg 2&>&> | <seperate ,1&>~~>
88
|
|
|
|
|
|
|
'; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# original |
91
|
|
|
|
|
|
|
# $skin{_row_noerror} = '<~ |
92
|
|
|
|
|
|
|
# | >><not_null&>!TITLE!> |
93
|
|
|
|
|
|
|
# | colspan=2><&_column <arg 0&>&> | ~~><seperate ,1&>
94
|
|
|
|
|
|
|
#'; |
95
|
|
|
|
|
|
|
|
96
|
1
|
|
|
|
|
2
|
$skin{_row2} = '<~ |
97
|
|
|
|
|
|
|
| >><not_null&>!TITLE!> |
98
|
|
|
|
|
|
|
| valign="top" colspan=2> |
99
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
| <seperate ,1&>~~>
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
'; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# original |
112
|
|
|
|
|
|
|
# $skin{_row2} = '<~ |
113
|
|
|
|
|
|
|
# | >><not_null&>!TITLE!> |
114
|
|
|
|
|
|
|
# | colspan=2><&_column <arg 0&>&> | ~~>
115
|
|
|
|
|
|
|
# |
116
|
|
|
|
|
|
|
# |
<~
117
|
|
|
|
|
|
|
# | ><error_in&> | ~~><seperate ,1&>
118
|
|
|
|
|
|
|
#'; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
#original |
122
|
|
|
|
|
|
|
#$skin{_column} = ' |
123
|
|
|
|
|
|
|
# cellspacing=<&TABLE_CELLSP&> cellpadding=<&TABLE_CELLPAD&> <&TABLE_EXTRA&>><~
124
|
|
|
|
|
|
|
# | ><~
125
|
|
|
|
|
|
|
# | ><seperate&> |
126
|
|
|
|
|
|
|
# cellspacing=<&TABLE_CELLSP_IN&> cellpadding=<&TABLE_CELLPAD_IN&> <&TABLE_EXTRA_IN&>>
127
|
|
|
|
|
|
|
# | >
128
|
|
|
|
|
|
|
# | >><not_null ERROR_IN&>!SUBTITLE!><&PREFIX&> |
129
|
|
|
|
|
|
|
# | > |
130
|
|
|
|
|
|
|
# <&<arg 0&>&> |
131
|
|
|
|
|
|
|
# |
132
|
|
|
|
|
|
|
# | ><&POSTFIX&> |
133
|
|
|
|
|
|
|
# |
134
|
|
|
|
|
|
|
# | >> | ><error_in ERROR_IN&> |
135
|
|
|
|
|
|
|
# | |
136
|
|
|
|
|
|
|
# | ~NAME VALUE MAXLEN SIZE PREFIX POSTFIX SUBTITLE ERROR_IN ID ACCESSKEY READONLY~>
137
|
|
|
|
|
|
|
# | ~NAME VALUE MAXLEN SIZE PREFIX POSTFIX SUBTITLE ERROR_IN ID ACCESSKEY READONLY~>
138
|
|
|
|
|
|
|
# | |
139
|
|
|
|
|
|
|
#'; |
140
|
|
|
|
|
|
|
|
141
|
1
|
|
|
|
|
2
|
$skin{_column} = '<&<arg 2&>&> |
142
|
|
|
|
|
|
|
cellspacing=<&TABLE_CELLSP&> cellpadding=<&TABLE_CELLPAD&> <&TABLE_EXTRA&>><~
143
|
|
|
|
|
|
|
| ><~
144
|
|
|
|
|
|
|
| ><seperate&> |
145
|
|
|
|
|
|
|
cellspacing=<&TABLE_CELLSP_IN&> cellpadding=<&TABLE_CELLPAD_IN&> <&TABLE_EXTRA_IN&>>
146
|
|
|
|
|
|
|
| >
147
|
|
|
|
|
|
|
| >><not_null ERROR_IN&>!SUBTITLE!><&PREFIX&> |
148
|
|
|
|
|
|
|
| > |
149
|
|
|
|
|
|
|
<&<arg 0&>&> |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
| ><&POSTFIX&> |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
| >> | ><&<arg 1&> ERROR_IN&> |
154
|
|
|
|
|
|
|
| |
155
|
|
|
|
|
|
|
| ~~>
156
|
|
|
|
|
|
|
| ~~>
157
|
|
|
|
|
|
|
| |
158
|
|
|
|
|
|
|
'; |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
1
|
|
|
|
|
1
|
my %error_handler; |
162
|
1
|
|
|
|
|
3
|
$error_handler{'_check'} = '#error_check'; |
163
|
|
|
|
|
|
|
|
164
|
1
|
50
|
|
|
|
4
|
$confirm_handler = {} unless(ref($confirm_handler) eq 'HASH'); |
165
|
|
|
|
|
|
|
|
166
|
1
|
|
|
|
|
4
|
foreach $_ (@baseskin) { |
167
|
19
|
|
|
|
|
25
|
my $templ = $_; |
168
|
19
|
100
|
|
|
|
69
|
if(s/^_//) { |
169
|
15
|
|
|
|
|
23
|
foreach my $alias ('', '_notitle', '_notitle_noerror', '2') { |
170
|
60
|
|
100
|
|
|
343
|
$templ .= ',' . ($error_handler{$templ} || '#error_in') . ',' . ($confirm_handler->{$templ} || ''); |
|
|
|
50
|
|
|
|
|
171
|
60
|
100
|
|
|
|
314
|
$skin{$_.$alias} = '<&_row'.$alias.' '.$templ.'&>' unless(defined($skin{$_.$alias})); |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
#$skin{text} = '<&row _text&>'; |
177
|
|
|
|
|
|
|
|
178
|
1
|
|
|
|
|
40
|
return \%skin; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub _get_default { |
182
|
1
|
|
|
1
|
|
2
|
my %default = %{HTML::FormEngine::Skin::_get_default()}; |
|
1
|
|
|
|
|
4
|
|
183
|
1
|
|
|
|
|
7
|
$default{_column} = {}; |
184
|
1
|
|
|
|
|
3
|
$default{_column}->{PREFIX} = ' '; |
185
|
1
|
|
|
|
|
3
|
$default{_column}->{POSTFIX} = ' '; |
186
|
|
|
|
|
|
|
#$default{_column}->{TD_SUBTITLE_VALIGN} = 'top'; |
187
|
|
|
|
|
|
|
#$default{_column}->{TD_EXTRA_IN_IN} = 'valign=top'; |
188
|
1
|
|
|
|
|
5
|
return \%default; |
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
1; |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
__END__ |